Reputation: 608
I would like to have my files sorted this way:
abc.c
Makefile
readme.txt
but the netrw file browser sorts them like this (using empty sort sequence):
Makefile
abc.c
readme.txt
How do I fix that?
BTW, it would also be nice to jump to file/directory by typing the first few letters of it's name. Is that possible?
Upvotes: 7
Views: 4815
Reputation: 5821
Sorting in netrw is controlled two ways. You can use the s key to toggle between sorting by size, time, and name. If that doesn't do what you want, the sorting sequence in netrw can also be controlled by a variable named g:netrw_sort_sequence
. The default should be suitable for what you want, but it can be changed by setting the variable manually. You can read the Vim help topic netrw_sort_sequence
for more info (:help netrw_sort_sequence
)
Upvotes: 5
Reputation: 6749
usually Linux collation is POSIX so i think you need just to change collation like this
export LC_COLLATE=C
issue the command on the terminal wich runs the VIM or put it in .profile or .bashrc to be be executed always
Upvotes: 1
Reputation: 172688
netrw indeed can do case-insensitive sorting (which I suppose is what you want): Put the following into your ~/.vimrc
:
let g:netrw_sort_options = "i"
As the netrw file listing is a plain Vim buffer, you can quickly locate entries via the default /
search command. If you want a solution that filters the list of candidates as you type, you need a different plugin like FuzzyFinder or Command-T.
Upvotes: 11