Skip to content

Instantly share code, notes, and snippets.

@scrooloose
Created October 7, 2009 09:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scrooloose/203928 to your computer and use it in GitHub Desktop.
Save scrooloose/203928 to your computer and use it in GitHub Desktop.
nerd tree plugin to add a mapping on S that starts a :shell
"put this in ~/.vim/nerdtree_plugin/startshell_mapping.vim
call NERDTreeAddKeyMap({
\ 'key': 'S',
\ 'callback': 'NERDTreeStartShell',
\ 'quickhelpText': 'start a :shell in this dir' })
function! NERDTreeStartShell()
let n = g:NERDTreeDirNode.GetSelected()
let oldCWD = getcwd()
try
exec 'lcd ' . n.path.str({'format': 'Cd'})
redraw!
shell
finally
exec 'lcd ' . oldCWD
endtry
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment