mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-25 09:41:03 +08:00
Allow modification of menu keybindings (#923)
This commit is contained in:
parent
370eb5bcb4
commit
c905a5d7b8
|
@ -605,6 +605,22 @@ menu item to execute executable files.
|
||||||
|
|
||||||
Related tags: |NERDTree-m| |NERDTreeApi|
|
Related tags: |NERDTree-m| |NERDTreeApi|
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*NERDTreeMenu-j*
|
||||||
|
Default key: j
|
||||||
|
Map option: NERDTreeMenuDown
|
||||||
|
Applies to: The NERD tree menu.
|
||||||
|
|
||||||
|
Moves the cursor down.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*NERDTreeMenu-k*
|
||||||
|
Default key: k
|
||||||
|
Map option: NERDTreeMenuUp
|
||||||
|
Applies to: The NERD tree menu.
|
||||||
|
|
||||||
|
Moves the cursor up.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3. Customisation *NERDTreeOptions*
|
3. Customisation *NERDTreeOptions*
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ endfunction
|
||||||
|
|
||||||
"FUNCTION: MenuController._echoPrompt() {{{1
|
"FUNCTION: MenuController._echoPrompt() {{{1
|
||||||
function! s:MenuController._echoPrompt()
|
function! s:MenuController._echoPrompt()
|
||||||
echo "NERDTree Menu. Use j/k/enter and the shortcuts indicated"
|
echo "NERDTree Menu. Use " . g:NERDTreeMenuDown . "/" . g:NERDTreeMenuUp . "/enter and the shortcuts indicated"
|
||||||
echo "=========================================================="
|
echo "=========================================================="
|
||||||
|
|
||||||
for i in range(0, len(self.menuItems)-1)
|
for i in range(0, len(self.menuItems)-1)
|
||||||
|
@ -71,9 +71,9 @@ endfunction
|
||||||
"change the selection (if appropriate) and return 1 if the user has made
|
"change the selection (if appropriate) and return 1 if the user has made
|
||||||
"their choice, 0 otherwise
|
"their choice, 0 otherwise
|
||||||
function! s:MenuController._handleKeypress(key)
|
function! s:MenuController._handleKeypress(key)
|
||||||
if a:key == 'j'
|
if a:key == g:NERDTreeMenuDown
|
||||||
call self._cursorDown()
|
call self._cursorDown()
|
||||||
elseif a:key == 'k'
|
elseif a:key == g:NERDTreeMenuUp
|
||||||
call self._cursorUp()
|
call self._cursorUp()
|
||||||
elseif a:key == nr2char(27) "escape
|
elseif a:key == nr2char(27) "escape
|
||||||
let self.selection = -1
|
let self.selection = -1
|
||||||
|
|
|
@ -148,6 +148,8 @@ call s:initVariable("g:NERDTreeMapToggleZoom", "A")
|
||||||
call s:initVariable("g:NERDTreeMapUpdir", "u")
|
call s:initVariable("g:NERDTreeMapUpdir", "u")
|
||||||
call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
|
call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
|
||||||
call s:initVariable("g:NERDTreeMapCWD", "CD")
|
call s:initVariable("g:NERDTreeMapCWD", "CD")
|
||||||
|
call s:initVariable("g:NERDTreeMenuDown", "j")
|
||||||
|
call s:initVariable("g:NERDTreeMenuUp", "k")
|
||||||
|
|
||||||
"SECTION: Load class files{{{2
|
"SECTION: Load class files{{{2
|
||||||
call nerdtree#loadClassFiles()
|
call nerdtree#loadClassFiles()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user