Skip to content

Commit 4906888

Browse files
committed
feat: add nerdtree plugin yank path
1 parent d3c2fa5 commit 4906888

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ snippets=(
4040
snippets/javascript.snippets
4141
)
4242
for i in ${snippets[@]}; do curl -L $repo/$i > $bundle/snipmate.vim/$i; done
43+
curl -L $repo/plugins/yank_mapping.vim > $bundle/snipmate.vim/nerdtree/plugin/yank_mapping.vim
4344

4445
# install npm dependencies
4546
command -v eslint >/dev/null 2>&1 || npm install -g eslint eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-plugin-standard

plugins/yank_mapping.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
" ~/.vim/bundle/nerdtree/plugin/yank_mapping.vim
2+
call NERDTreeAddKeyMap({
3+
\ 'key': 'yy',
4+
\ 'callback': 'NERDTreeYankCurrentNode',
5+
\ 'quickhelpText': 'put full path of current node into the "+ register' })
6+
7+
function! NERDTreeYankCurrentNode()
8+
let n = g:NERDTreeFileNode.GetSelected()
9+
if n != {}
10+
call setreg('+', n.path.str())
11+
endif
12+
endfunction

0 commit comments

Comments
 (0)