nerdtree icon indicating copy to clipboard operation
nerdtree copied to clipboard

map h and l to map a new root node

Open fabolous005 opened this issue 3 years ago • 6 comments

Hi there, i am used to cfiles, where i am able to naviagte between directories with vim keybinds. So i want the same functionality in NerdTree I tried this: nnoremap h :NERDTreeMapUpdir<CR> nnoremap l :NERDTree-C<CR> but it wont work. How is this possible? Best regards

fabolous005 avatar May 30 '22 07:05 fabolous005

try adding <CR> to the command

nnorenap I :NERDTree-C<CR>

ghost avatar May 30 '22 11:05 ghost

It still wont work but i saw that you mapped a big i to :NERDTree-C but not to a small L which is what i want I tried using the exact same command you gave me "nnorenap I :NERDTree-C<CR>", but I as well as l or h would still not give the expected result. Big i (I) will show hidden files and with h and l i am able to move like normal vim binds

fabolous005 avatar May 31 '22 10:05 fabolous005

sorry for the error, later today I'll be trying again

ghost avatar May 31 '22 12:05 ghost

ok so I found out in my old configs how to proper do exactly what you want. instead of remapping, you should set a variable like this:

let NERDTreeMapChangeRoot='l' let NERDTreeMapUpdir='h'

ghost avatar May 31 '22 20:05 ghost

Thank you this worked for me

fabolous005 avatar Jun 01 '22 08:06 fabolous005

you're welcome, I'm glad it worked

ghost avatar Jun 01 '22 10:06 ghost