Tip #623: External Paste Buffer
tip karma |
Rating 12/3, Viewed by 1106
|
created: |
|
December 17, 2003 10:31 |
|
complexity: |
|
basic |
author: |
|
zzapper |
|
as of Vim: |
|
5.7 |
We are forever using copy and paste to copy information from application to application. Inevitably however we need to edit/reformat the buffer contents . This tip allows you to quickly open a separate VIM containing just the paste contents. You may then edit these contents as required, writing or closing VIM automatically causes the changed contents to be rewritten to the paste buffer.
The following is a CygWin script (could just as easily be a Win32 batch file)
function vxp
{
# description : Edit paste contents
gvim -c 'normal ggdG"*p' c:/aaa/xp
}
Such that I just type vxp and it opens a new Vim just containing the
current paste buffer.
To automatically cause the rewriting of the paste buffer add the following to your .vimrc
autocmd bufWritePost c:/aaa/xp normal ggVG"*y
(Thanks to Bob Chan et al from comp.editors)
<<Deleting a buffer without changing your window layout |
Insert template files into buffer ( HTML editing for example) >>
Additional Notes
|