Created
October 7, 2009 09:59
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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