Closed zealotrush closed 4 years ago
Did you try navigating to another directory? It should work for all directories except "current directory" (:pwd
). Because
:sort ,^.*[\/],
depends on at least one slash (/) existing in each buffer line. With relative paths some lines may not have slashes. See also :help :sort
.
This works instead:
:sort ,^\v(.*[\/])|\ze,
More discussion in https://github.com/justinmk/vim-dirvish/issues/89 .
It worked. Thanks!
But now I cannot hide hidden files in Dirvish buffer with g:dirvish_relative_paths = 1
. Here is my dirvish config:
let g:dirvish_mode =
\ ':sort ,^\v(.*[\/])|\ze, | silent keeppatterns g@\v/\.[^\/]+/?$@d _'
let g:dirvish_relative_paths = 1
The regex is a little bit obscure to me. Could you please help me?
Here is a simple way to reproduce this issue.
$MYVIMRC
file, add these settings:-
to open Dirvish. It can be seen that folders are displayed first, which means theg:dirvish_mode
settings is effective.g:dirvish_relative_paths
to 1. Repeat step 3. Folders are no longer displayed first.By saying vim, I'm actually referring to Neovim v0.4.3.
Is this a bug, or it's just I missed something?