-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: order by buffer name #561
Comments
If you're interested you could submit a PR, adding a new order command is as simple as writing a sort function: barbar.nvim/lua/barbar/api.lua Lines 364 to 370 in 1d6b138
|
Thanks, I will try it soon. |
Thanks for implementing this feature! But I'm not sure if currently sort by name does exactly the same (or without specifically sorting directories, which is irrelevant from this point of view) than sorting by directory. This is better seen in a detailed example: I have some open buffers whose names starts by '1_', '2_', '4_', '7_' in the same sub-folder, and another buffer starting by '6_' in the current folder. Sorting by directory the '6_' file is placed the first one, and the others are sorted after it. Good job! However, sorting by name they are placed exactly equal, while I would expect the '6_' buffer would placed between '4_' and '7_' buffers. I'm not sure if my issue was not clear enough, but I expected that sorting by name takes into account only the filename for it. Thanks! PS: I know I said that the current sorting by directory feature would be enough, and it is, thanks! But then I think that the current sorting by name feature is not very useful. |
I'm not proficient in Lua nor in Neovim API, but I think that = string.match([[/mnt/tmp/myfile.txt.1]], "(.-)([^\\/]-%.?([^%.\\/]*))$")
"/mnt/tmp/" "myfile.txt.1" "1" Thanks! |
First, thanks for this great plugin!
There is currently an option to order buffers by directory, but his option does not takes into account buffer names. I think modifying this option to be order by name (being the directory part of the name) or creating a new option order by name would be a good feature for the plugin.
This can be useful in any use case, but it becomes even better when editing a text directory (tex, MD, etc.) with chapters with the chapter number as a prefix.
Thanks!
The text was updated successfully, but these errors were encountered: