Skip to content

Instantly share code, notes, and snippets.

@scrooloose
Created June 20, 2010 06:41
Show Gist options
  • Save scrooloose/445618 to your computer and use it in GitHub Desktop.
Save scrooloose/445618 to your computer and use it in GitHub Desktop.
if exists("g:loaded_nerdtree_edit_menuitem")
finish
endif
let g:loaded_nerdtree_edit_menuitem = 1
call NERDTreeAddMenuItem({
\ 'text': 'start :(e)dit command',
\ 'shortcut': 'e',
\ 'callback': 'NERDTreeStartEditCommand' })
function! NERDTreeStartEditCommand()
let node = g:NERDTreeFileNode.GetSelected()
let fname = input(':e ', node.path.str({'format': 'Edit'}))
wincmd p
exec 'e ' . fname
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment