Search code examples
vimnetrw

How to sort files like `sort` does using the vim's netrw file browser?


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?


Solution

  • 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.