FeiyouG / commander.nvim

Create and manage keybindings and commands in a more organized manner, and search them quickly through Telescope

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

axkirillov opened this issue · 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

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?

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.

commented

^ 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?

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?

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

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

thanks, works like a charm!