Skip to content

Commit 1e0ce21

Browse files
committed
Merge pull request #26 from nickstenning/custom-yank-keys
2 parents 05b7373 + 067dd4f commit 1e0ce21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

autoload/yankstack.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ let s:yankstack_tail = []
99
let g:yankstack_size = 30
1010
let s:last_paste = { 'changedtick': -1, 'key': '', 'mode': 'n', 'count': 1, 'register': '' }
1111

12+
if !exists('g:yankstack_yank_keys')
13+
let g:yankstack_yank_keys = ['c', 'C', 'd', 'D', 's', 'S', 'x', 'X', 'y', 'Y']
14+
endif
15+
1216
function! s:yank_with_key(key)
1317
call s:before_yank()
1418
return a:key
@@ -153,11 +157,10 @@ function! yankstack#setup()
153157
if exists('g:yankstack_did_setup') | return | endif
154158
let g:yankstack_did_setup = 1
155159

156-
let yank_keys = ['c', 'C', 'd', 'D', 's', 'S', 'x', 'X', 'y', 'Y']
157160
let paste_keys = ['p', 'P', 'gp', 'gP']
158161
let word_characters = split("qwertyuiopasdfghjklzxcvbnm1234567890_", '\zs')
159162

160-
for key in yank_keys
163+
for key in g:yankstack_yank_keys
161164
exec 'nnoremap <expr>' key '<SID>yank_with_key("' . key . '")'
162165
exec 'xnoremap <expr>' key '<SID>yank_with_key("' . key . '")'
163166
endfor

0 commit comments

Comments
 (0)