1
1
" yankring.vim - Yank / Delete Ring for Vim
2
2
" ---------------------------------------------------------------
3
- " Version: 17 .0
3
+ " Version: 18 .0
4
4
" Author: David Fishburn <dfishburn dot vim at gmail dot com>
5
5
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
6
- " Last Modified: 2013 Apr 28
6
+ " Last Modified: 2013 Sep 19
7
7
" Script: http://www.vim.org/scripts/script.php?script_id=1234
8
8
" Based On: Mocked up version by Yegappan Lakshmanan
9
9
" http://groups.yahoo.com/group/vim/post?act=reply&messageNum=34406
@@ -19,7 +19,7 @@ if v:version < 700
19
19
finish
20
20
endif
21
21
22
- let loaded_yankring = 170
22
+ let loaded_yankring = 180
23
23
24
24
" Turn on support for line continuations when creating the script
25
25
let s: cpo_save = &cpo
42
42
endfor
43
43
endif
44
44
45
+ if ! exists (' g:yankring_buffer_name' )
46
+ let g: yankring_buffer_name = ' [YankRing]'
47
+ endif
48
+
45
49
if ! exists (' g:yankring_history_file' )
46
50
let g: yankring_history_file = ' yankring_history'
47
51
endif
@@ -263,7 +267,6 @@ if !exists('g:yankring_default_menu_mode')
263
267
endif
264
268
265
269
" Script variables for the yankring buffer
266
- let s: yr_buffer_name = ' [YankRing]'
267
270
let s: yr_buffer_last_winnr = -1
268
271
let s: yr_buffer_last = -1
269
272
let s: yr_buffer_id = -1
@@ -538,7 +541,7 @@ function! s:YRGetElem(...)
538
541
if a: 0 > 1
539
542
" If the user indicated to paste above or below
540
543
" let direction = ((a:2 ==# 'P') ? 'P' : 'p')
541
- if a: 2 = ~ ' \(p\|gp\|P\|gP\)'
544
+ if a: 2 = ~ ' \<\ (p\|gp\|P\|gP\)\> '
542
545
let direction = a: 2
543
546
endif
544
547
endif
@@ -1651,8 +1654,6 @@ endfunction
1651
1654
1652
1655
1653
1656
" Handle macros (@).
1654
- " This routine is not used, YRMapsExpression is used to
1655
- " handle the @ symbol.
1656
1657
function ! s: YRMapsMacro (bang , ... )
1657
1658
" If we are repeating a series of commands we must
1658
1659
" unmap the _zap_ keys so that the user is not
@@ -1673,7 +1674,7 @@ function! s:YRMapsMacro(bang, ...)
1673
1674
return " "
1674
1675
endif
1675
1676
1676
- if zapto !~ ' \(\w\|@\)'
1677
+ if zapto !~ ' \(\w\|@\|:\ )'
1677
1678
" Abort if the user does not specify a register
1678
1679
call s: YRWarningMsg ( " YR:No register specified, aborting macro" )
1679
1680
return " "
@@ -2302,7 +2303,7 @@ function! s:YRWindowOpen(results)
2302
2303
2303
2304
" Using :e and hide prevents the alternate buffer
2304
2305
" from being changed.
2305
- exec " :e " . escape (s: yr_buffer_name , ' ' )
2306
+ exec " :e " . escape (g: yankring_buffer_name , ' ' )
2306
2307
" Save buffer id
2307
2308
let s: yr_buffer_id = bufnr (' %' ) + 0
2308
2309
else
@@ -2342,13 +2343,15 @@ function! s:YRWindowOpen(results)
2342
2343
2343
2344
syn match yankringKey # ^AutoClose.*<enter># hs =e - 6
2344
2345
syn match yankringKey # ^AutoClose.*\[ g\] p# hs =e - 3 contains =yankringKey
2345
- syn match yankringKey # ^AutoClose.*\[ p \] P# hs =e - 3 contains =yankringKey
2346
+ syn match yankringKey # ^AutoClose.*\[ g \] P# hs =e - 3 contains =yankringKey
2346
2347
syn match yankringKey # ^AutoClose.*,d,# hs =e - 1 ,he =e - 1 contains =yankringKey
2347
2348
syn match yankringKey # ^AutoClose.*,r,# hs =e - 1 ,he =e - 1 contains =yankringKey
2348
2349
syn match yankringKey # ^AutoClose.*,s,# hs =e - 1 ,he =e - 1 contains =yankringKey
2349
2350
syn match yankringKey # ^AutoClose.*,a,# hs =e - 1 ,he =e - 1 contains =yankringKey
2350
2351
syn match yankringKey # ^AutoClose.*,c,# hs =e - 1 ,he =e - 1 contains =yankringKey
2352
+ syn match yankringKey # ^AutoClose.*,i,# hs =e - 1 ,he =e - 1 contains =yankringKey
2351
2353
syn match yankringKey # ^AutoClose.*,u,# hs =e - 1 ,he =e - 1 contains =yankringKey
2354
+ syn match yankringKey # ^AutoClose.*,R,# hs =e - 1 ,he =e - 1 contains =yankringKey
2352
2355
syn match yankringKey # ^AutoClose.*,q,# hs =e - 1 ,he =e - 1 contains =yankringKey
2353
2356
syn match yankringKey # ^AutoClose.*<space># hs =e - 6 contains =yankringKey
2354
2357
syn match yankringKey # ^AutoClose.*?$# hs =e contains =yankringKey
@@ -2498,7 +2501,7 @@ function! s:YRWindowAction(op, cmd_mode) range
2498
2501
" so set it to at least 1
2499
2502
let v_count = ((v_count > 0 )?(v_count):1 )
2500
2503
2501
- if ' [dr] ' = ~ opcode
2504
+ if ' \<[drP]\> ' = ~# opcode
2502
2505
" Reverse the order of the lines to act on
2503
2506
let begin = lastline
2504
2507
while begin >= firstline
0 commit comments