Skip to content

Instantly share code, notes, and snippets.

@scrooloose
Created January 5, 2012 20:23
Show Gist options
  • Save scrooloose/1567086 to your computer and use it in GitHub Desktop.
Save scrooloose/1567086 to your computer and use it in GitHub Desktop.
NERDTree custom mappings to make i and s reuse existing windows
call NERDTreeAddKeyMap({
\ 'key': 'i',
\ 'scope': 'FileNode',
\ 'callback': "NERDTreeCustomOpenSplit",
\ 'quickhelpText': 'open split reusing if able' })
function! NERDTreeCustomOpenSplit(node)
call a:node.open({'split': 'h', 'reuse': 1})
endfunction
call NERDTreeAddKeyMap({
\ 'key': 's',
\ 'scope': 'FileNode',
\ 'callback': "NERDTreeCustomOpenVSplit",
\ 'quickhelpText': 'open vsplit reusing if able' })
function! NERDTreeCustomOpenVSplit(node)
call a:node.open({'split': 'v', 'reuse': 1})
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment