Closed davidsierradz closed 6 years ago
I dont see any changes in the way the dirvish buffer shows the current path in the statusline
It doesn't affect the statusline. Dirvish buffer name is always absolute, for predictability. The way Vim changes the buffer name depending on current directory is insane.
g:dirvish_relative_paths
affects the buffer contents. You can check it with:
:set conceallevel=0
Investigating more after :cd % if I press R to reload the buffer, the error doesn't happen, maybe do a refresh of the buffer after :cd %
If you change CWD while viewing an existing Dirvish buffer, the relative paths in the buffer are no longer valid. Yes, R
is required then.
:set statusline=%f
shows the buffer name. If you want it to be relative, use something like
:set statusline=%{fnamemodify(bufname('%'),':.')}
Nvim has a DirChanged
event which could be used to reload all dirvish buffers when CWD changes. But this is ugly, for little gain. g:dirvish_relative_paths
is not really needed if you have a recent version of vim, anyways.
if exists('##DirChanged') && get(g:, 'dirvish_relative_paths', 0)
augroup dirvish_dirchanged
autocmd!
autocmd DirChanged * " TODO: reload all dirvish buffers ...
augroup END
endif
I think
let g:dirvish_relative_paths = 1
its not working, I dont see any changes in the way the dirvish buffer shows the current path in the statusline (its always absolute paths), also if set to1
the error in the title is showManjaro Linux - i3: 17.0.6 Neovim version: NVIM v0.2.2-5-ge98bcf052
minimal
init.vim
file:Open a terminal:
$ pwd
shows/home/user
$ nvim Code/FooBar
opens neovim inside a dirvish buffer:pwd
shows/home/user
:cd %
:pwd
shows/home/user/Code/FooBar
Try to open some directory or file shows (For example the App directory):
dirvish: invalid (or access denied): Code/FooBar/App/
Investigating more after
:cd %
if I pressR
to reload the buffer, the error doesn't happen, maybe do a refresh of the buffer after:cd %
? If I setlet g:dirvish_relative_paths = 0
there is no need to pressR
after:cd %
.If I
:set statusline=%f
to show relative paths in the statusline inside a dirvish buffer the statusline always show absolute paths, doesn't matter what valueg:dirvish_relative_paths
is set to.Sorry bad english, and thanks!