Modifiers with Alt (<M-
or <A-
) is troublesome in a lot of environments, especially in terminals over SSH with a terminal multiplexer, and I therefore try not to use it. Even if I do get it to work on my desktop, it might not work somewhere else for some obscure reason. There's plenty of keybinds to take from. Unless you have a big reason to use Alt, I'd advice against it.
That being said you can find which command is being invoked when pressing Enter (or o) to open a folder in NERDTree using the :verb
command. This has to be run while the NERDTree pane is selected:
:verb map <Enter>
n o *@:call nerdtree#invokeKeyMap("o")<CR>
Last set from ~/.vim/bundle/nerdtree/lib/nerdtree/key_map.vim
Now that you the correct command there's no point in hacking with rebinding something else to <Enter>
or <CR>
.
Generally you'd use <A-x>
, but if ≈
works for you then that's fine I guess:
:nnoremap ≈ :call nerdtree#invokeKeyMap("o")<CR>
Bottom line:
I would like to note that I don't see why you would want to use such a mapping. You can use o, and you would/should be in close range of this (same could be said for Enter).