ANN: YankRing 2.1

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ANN: YankRing 2.1

David Fishburn
 
 
YankRing.vim : Maintains a history of previous yanks and deletes
http://www.vim.org/scripts/script.php?script_id=1234


The major enhancements for the version 2.0 release is a GUI, similar to the
TagList plugin and many of the buffer plugins.  This makes it far easier to
use.

Version 2.1 will also allow the yankring to manage Vim's numbered registers.
This is off by default, but if you turn it on, then the registers 0-9 will
contain the top 10 items of the yankring.  This allows you to paste them
with "5p.


description
Vim already maintains a list of numbered registers containing the last 9
deletes.  These previous deletes can be referenced using [register]p, so "1p
will paste the last delete, "2p the 2nd last delete.  For more information
see |quote_number|.

Vim does not provide any mechanism to reference previous yanked text.  In
Emacs this feature is called the "kill ring".

The yankring plugin allows the user to configure the number of yanked and
deleted text.  After text has been pasted, it can be replaced with a
previous value from the yankring.


The major improvement for this release is the yankring window.

You can create a map to display a buffer displaying the yankring's contents:
    nnoremap <silent> <F11> :YRShow<CR>

YRShow creates a new split buffer (you can configure where it should be and
it's size)
        :YRShow  
            AutoClose=1;Cmds:<enter>,[g]p,[p]P,d,r,a,u,q,<space>;Help=?
            --- YankRing ---
            Elem  Content
            3     three^@
            2     two^@
            1     one^@
            5     five^@
            4     four^@
You can simply hit 'p', <enter>, double click on an item and it will be
pasted into your document.  The window will automatically close (by
default) after you have made a choice.  The element will be pasted into the
correct buffer if you have multiple split windows.

The new "GUI" supports all the usual Vim commands: p, P, gp, gP.
You can paste multiple items using visual mode.
You can also remove items from the yankring.


As usual, suggestions and bug reports are always welcome.


Enjoy.
Dave