Skip to content

Instantly share code, notes, and snippets.

@AndrewRadev
Created June 13, 2014 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRadev/5a7e821c3a6ce7bcd3e8 to your computer and use it in GitHub Desktop.
Save AndrewRadev/5a7e821c3a6ce7bcd3e8 to your computer and use it in GitHub Desktop.
if exists("g:loaded_nerdree_yank_filename_mapping")
finish
endif
let g:loaded_nerdree_yank_filename_mapping = 1
call NERDTreeAddKeyMap({
\ 'key': 'Y',
\ 'callback': 'NERDTreeYankFilename',
\ 'quickhelpText': 'Yank filename to unnamed register',
\ })
function! NERDTreeYankFilename()
let current_node = g:NERDTreeFileNode.GetSelected()
if current_node == {}
return
else
let @" = fnamemodify(current_node.path.str(), ':t')
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment