1
1
*yankring.txt* For Vim version 6.2.
2
2
3
- Author: David Fishburn March 28 , 2005
4
- Version: 1.4
3
+ Author: David Fishburn May 7 , 2005
4
+ Version: 1.6
5
5
6
6
For instructions on installing this file, type
7
7
:help add-local-help | add-local-help | inside Vim.
@@ -32,6 +32,7 @@ For instructions on installing this file, type
32
32
4.13 YRReplace.........................: | YRReplace |
33
33
4.14 YRMapsCreate......................: | YRMapsCreate |
34
34
4.15 YRMapsDelete......................: | YRMapsDelete |
35
+ 4.16 YRSearch..........................: | YRSearch |
35
36
5. Tutorial...............................: | yankring-tutorial |
36
37
5.1 YRShow............................: | YRShow-example |
37
38
5.2 YRReplace.........................: | YRReplace-example |
@@ -44,6 +45,7 @@ For instructions on installing this file, type
44
45
5.9 Visual modes......................: | yankring-visual-example |
45
46
5.10 Using ranges......................: | YRYankRange-example |
46
47
5.11 :global...........................: | global-example |
48
+ 5.12 YRSearch..........................: | YRSearch-example |
47
49
6. History................................: | yankring-history |
48
50
49
51
==============================================================================
@@ -254,6 +256,7 @@ For instructions on installing this file, type
254
256
255
257
4.2 YRClear *YRClear*
256
258
Clears all elements from the yankring.
259
+ See also | YRClear-example | .
257
260
258
261
259
262
4.3 YRShow *YRShow*
@@ -280,7 +283,8 @@ For instructions on installing this file, type
280
283
281
284
Examples: >
282
285
:YRSetTop 3 " Sets element 3 as the next pasted element
283
- <
286
+ < See also | YRSetTop-example | .
287
+
284
288
285
289
4.5 YRGetElem *YRGetElem*
286
290
This command has two modes. If no parameters are provided, it
@@ -290,7 +294,8 @@ For instructions on installing this file, type
290
294
number specified is outside of the yankring an error is returned.
291
295
You may want to create a separate mapping for this call. >
292
296
nnoremap <silent> <Leader>yr :YRGetElem<CR>
293
- <
297
+ < See also | YRSearch | .
298
+
294
299
Examples:
295
300
Assume there are 10 elements in the yankring and element 6 is
296
301
at the top of the ring. >
@@ -299,7 +304,8 @@ For instructions on installing this file, type
299
304
:YRGetElem 12 " Will paste element 6.
300
305
:YRGetElem 99 " Error, invalid choice is reported
301
306
:YRGetElem 0 " Error, invalid choice is reported
302
- <
307
+ < See also | YRGetElem-example | .
308
+
303
309
304
310
4.6 YRGetMultiple *YRGetMultiple*
305
311
Will paste many elements from the yankring in one command.
@@ -317,7 +323,8 @@ For instructions on installing this file, type
317
323
:YRGetMultiple 12 " Will paste elements 6,5,4,3,2,1,10,9,8,7
318
324
:YRGetMultiple 99 " Will paste elements 6,5,4,3,2,1,10,9,8,7
319
325
:YRGetMultiple 0 " Will paste element 6
320
- <
326
+ < See also | YRGetMultiple-example | .
327
+
321
328
322
329
4.7 YRPush *YRPush*
323
330
Allows the user to "push" additional entries into the yankring.
@@ -329,7 +336,8 @@ For instructions on installing this file, type
329
336
:YRPush " Push the " register's contents
330
337
:YRPush * " Push the * register's contents (clipboard)
331
338
:YRPush a " Push the "a register's contents
332
- <
339
+ < See also | YRPush-example | .
340
+
333
341
334
342
4.8 YRPop *YRPop*
335
343
Allows you to pop off the top elements from the yankring. You
@@ -343,7 +351,8 @@ For instructions on installing this file, type
343
351
yankring
344
352
:YRPop 5 " Removes the 5 highest numbered elements from the
345
353
yankring
346
- <
354
+ < See also | YRPop-example | .
355
+
347
356
348
357
4.9 YRYankCount *YRYankCount*
349
358
This command has the most mappings created for it. If you are
@@ -384,6 +393,7 @@ For instructions on installing this file, type
384
393
and the "a register.
385
394
10"zyy - Places 10 lines into both the yankring and the "z
386
395
register.
396
+ See also | yankring-tutorial | .
387
397
388
398
389
399
4.10 YRYankRange *YRYankRange*
@@ -401,10 +411,11 @@ For instructions on installing this file, type
401
411
Repeat using V and Control-V.
402
412
403
413
Normal mode
404
- -----------
414
+ ----------- >
405
415
:5,20YRYankRange " Will yank lines 5-20 into the yankring
406
416
:5,20YRDeleteRange " Will delete lines 5-20 and add them to
407
417
the yankring
418
+ < See also | YRYankRange-example | .
408
419
409
420
410
421
4.11 YRDeleteRange *YRDeleteRange*
@@ -426,6 +437,7 @@ For instructions on installing this file, type
426
437
"ap " Ignore the yankring and paste the contents of register "a
427
438
5"ap " Ignore the yankring and paste the contents of register "a
428
439
5 times
440
+ See also | yankring-tutorial | .
429
441
430
442
431
443
4.13 YRReplace *YRReplace*
@@ -450,6 +462,15 @@ For instructions on installing this file, type
450
462
This public function removes the yankring maps and disables
451
463
the yankring. This function is called by the YRToggle command.
452
464
465
+
466
+ 4.16 YRSearch *YRSearch*
467
+ This command is similar to | YRGetElem | . The command takes
468
+ one parameter which is a regular expression. Similar to
469
+ YRGetElem, it will display all items in the yankring that match
470
+ the regular expression. It is also interactive, and will
471
+ prompt you to enter which match you wish pasted.
472
+ See also | YRSearch-example | .
473
+
453
474
454
475
==============================================================================
455
476
5. Tutorial *yankring-tutorial*
@@ -554,6 +575,7 @@ For instructions on installing this file, type
554
575
which so happened to be the line 'two^@'. Since it had a
555
576
newline character in it (when it was yanked) the newline is
556
577
included when it is pasted.
578
+
557
579
*YRPush-example*
558
580
Assume you need to paste text from the system clipboard, and this
559
581
is text you will need routinely. We can simulate this by running
@@ -717,7 +739,50 @@ For instructions on installing this file, type
717
739
order, therefore the elements are reversed. Using YRGetMultiple! will
718
740
paste the elements in FIFO (First In First Out) maintaining the order of
719
741
the original buffer (since you read and yanked from top to bottom).
720
- *YRPop-example*
742
+
743
+ *YRSearch-example*
744
+ You can remove elements from the top of the yankring with the YRPop
745
+ command. It optionally takes one parameter. >
746
+ :YRShow
747
+ --- YankRing ---
748
+ Elem Content
749
+ 4 Three Mississippi
750
+ 3 Two Mississippi
751
+ 2 One Mississippi
752
+ 1 @", '\\/.*$^~[]' )
753
+ :YRSearch Mississippi
754
+ --- YankRing ---
755
+ Elem Content
756
+ 4 Three Mississippi
757
+ 3 Two Mississippi
758
+ 2 One Mississippi
759
+ :Enter # to paste:
760
+ < Consider some items which require escaping the search string: >
761
+ :YRSearch @", '\\
762
+ --- YankRing ---
763
+ Elem Content
764
+ 1 @", '\\/.*$^~[]' )
765
+ :Enter # to paste:
766
+ < Forward slashes and various other symbols require escapes, in this
767
+ case the slash was not escaped enough: >
768
+ :YRSearch @", '\\/
769
+ --- YankRing ---
770
+ Elem Content
771
+ :Hit ENTER or type command to continue
772
+ < There are enough escapes this time: >
773
+ :YRSearch @", '\\\\/
774
+ --- YankRing ---
775
+ Elem Content
776
+ 1 @", '\\/.*$^~[]' )
777
+ :Enter # to paste:
778
+ < Period, star, dollar and so on require one slash: >
779
+ :YRSearch @", '\\\\/\.\*\$\^\~\[\]
780
+ --- YankRing ---
781
+ Elem Content
782
+ 1 @", '\\/.*$^~[]' )
783
+ :Enter # to paste:
784
+
785
+ < *YRPop-example*
721
786
You can remove elements from the top of the yankring with the YRPop
722
787
command. It optionally takes one parameter. >
723
788
:YRPop
@@ -772,11 +837,24 @@ For instructions on installing this file, type
772
837
:g - for each line in the buffer
773
838
/addme - check if the string "addme" is in the line
774
839
/YRYankCount 'yy' - Ask the yankring to execute the 'yy' command
775
-
840
+
776
841
777
842
==============================================================================
778
843
6. History *yankring-history*
779
844
845
+ 1.6: April 20, 2005:
846
+ NF: YRSearch is similar to YRGetElem. Given a regular expression
847
+ it will interactively display all the elements in the yankring
848
+ that match the regular expression. You can enter the number
849
+ of the element to paste it. If you have many elements within
850
+ the yankring, this can help you identify them more easily.
851
+ NF: Updated the default history size from 30 to 100, which is
852
+ partially the reason for the YRSearch command.
853
+ NF: By default it supports "gp" and "gP", in addition to "p" and "P".
854
+ NF: Added support for the expression register (:h quote=). Here
855
+ is an example of how it is used:
856
+ "="X"<CR> P
857
+
780
858
1.5: March 30, 2005:
781
859
NF: The yankring now respects the cpoptions setting, if 'y' is
782
860
included and you press '.', the previous yank command is executed
0 commit comments