Sometimes I got carried away using cd (<C-]>) mapping to traverse among directories and at some point I want to cd into the directory where I was before which is my root directory. So, is there any way to achieve this via a mapping or a function call? vim's :cd command also raises this problem because it effectively changes the current working directory.
i don't think i actually change the vim directory when doing <C-]>. root path handling is not well synced with neovim, i want to fix this in the rewrite but lately i really have not much time to fix this.
And maybe a <C-o> based function would help a little indeed, i find mysef needing this too sometimes.
i don't think i actually change the vim directory when doing
<C-]>.
I mean, consider this, you're currently at ~/some-folder/ and LuaTree open, if you go and type :cd ~/other-project you have to manually go that folder via LuaTree to show files/folders there.
defx provides a workaround for this:
nnoremap <buffer><silent><expr> gh defx#do_action('cd', getcwd())
oh yes i didn't bind the change_dir to DirChanged, now fixed in master.
Perfect! Thanks a lot.
hum i had to cancel this commit because it introduced bugs. The startup of the tree is quite old and not really easy to modify. I think i'll do the rewrite bit by bit, it'll be easier this way
Most helpful comment
hum i had to cancel this commit because it introduced bugs. The startup of the tree is quite old and not really easy to modify. I think i'll do the rewrite bit by bit, it'll be easier this way