문제

Since ? is usually used to search strings upwards I'd love to be able to use this also in NERDTree.

Using ? in NERDTree always brings me to help, but I just want to search upwards and don't want to cycle through the whole tree with / (downwards search)

도움이 되었습니까?

해결책 2

NERD_Tree provides a way to change its default mappings via global config variables. Just put the following into your ~/.vimrc to change it to F1:

:let g:NERDTreeMapHelp = '<F1>'

다른 팁

NERD_Tree sets a custom filetype when it creates its window. You can hook into that with an :autocmd that removes the buffer-local mapping for ?. Unfortunately, it apparently sets the filetype before setting up it's mappings, but something like this should work (except for directly after opening the tree for the first time):

Put the following into your ~/.vimrc:

:autocmd FileType nerdtree autocmd WinEnter,CursorHold <buffer> silent! nunmap <buffer> ?

Edit: I've just submitted a patch to the author that would enable this shorter and better hook (though the config variable would still be preferred for this particular use case):

:autocmd FileType nerdtree silent! nunmap <buffer> ?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top