-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmymapping.vim
More file actions
31 lines (27 loc) · 871 Bytes
/
mymapping.vim
File metadata and controls
31 lines (27 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
call NERDTreeAddKeyMap({
\ 'key': 'b',
\ 'callback': 'NERDTreeBookmarkThis',
\ 'quickhelpText': 'Bookmark this node',
\ 'scope': 'Node' })
function! NERDTreeBookmarkThis(node)
let currentNode = a:node
if currentNode != {}
let name = currentNode.path.getLastPathComponent(0)
try
call currentNode.bookmark(name)
call b:NERDTree.render()
catch /^NERDTree.IllegalBookmarkNameError/
call nerdtree#echo("bookmark names must not contain spaces")
endtry
else
call nerdtree#echo("select a node first")
endif
endfunction
call NERDTreeAddKeyMap({
\ 'key': 'N',
\ 'callback': 'NERDTreeAddNodeHandler',
\ 'quickhelpText': '',
\ 'scope': 'Node' })
function! NERDTreeAddNodeHandler(...)
call NERDTreeAddNode()
endfunction