commander.nvim icon indicating copy to clipboard operation
commander.nvim copied to clipboard

On each new nvim session the commands are shown in random order

Open axkirillov opened this issue 2 years ago • 2 comments

Each new nvim session I get a new order of my commands in the command center for ex open nvim, open command center (:Telescope command_center) image close nvim, open nvim again, open command center image The order of the commands should be fixed and prefereably to the order in which the command_center.add() functions are called

axkirillov avatar Sep 02 '22 11:09 axkirillov

Duplicate of #16. I am gonna ask the same question that I asked in that issue: Do you have a strong reason for displaying the commands in the same order that they were inserted?

FeiyouG avatar Sep 09 '22 06:09 FeiyouG

Yes, I usually put the most used commands up top and use up/down navigation most of the time instead of fuzzy finding. Generally I think it is confusing for the user to have them appear in random order on each load.

axkirillov avatar Sep 14 '22 08:09 axkirillov

^ That's a good reason, and I'll add one: I'd like my commands to be ordered by category first, so (for example) I can see everything related to git together, then everything related to system commands, etc. I don't remember everything that's in the command center, so I look at the list before I start typing, and it's easier to have an idea of what to type if I can quickly scan and see what I want.

I actually thought that's what the sort_by key did in the extension config, but that's different. Maybe this could be an optional key like order_by that lets you order the commands in different ways? By category, by insertion order, or if it's not set, however is best for performance?

tjkirch avatar Oct 17 '22 18:10 tjkirch

I have the same workflow as tjkirch, and also initially thought sort_by in the config applied to both the initial loading of the commands as well as filtering. Any reason it doesn't apply to the initial list?

kagbodji avatar Nov 14 '22 16:11 kagbodji

Hi. I switched to my own implementation, so I don't need this feature anymore.

axkirillov avatar Nov 14 '22 16:11 axkirillov

I finally got some time today and added this feature. Please check it out!

FeiyouG avatar Nov 20 '22 04:11 FeiyouG

thanks, works like a charm!

kagbodji avatar Nov 21 '22 14:11 kagbodji