Created
June 13, 2014 12:37
-
-
Save AndrewRadev/5a7e821c3a6ce7bcd3e8 to your computer and use it in GitHub Desktop.
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
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