sponsor Vim development Vim logo Vim Book Ad

CaptureClipboard : Append system clipboard changes to current buffer.

 script karma  Rating 18/6, Downloaded by 883    Comments, bugs, improvements  Vim wiki

created by
Ingo Karkat
 
script type
utility
 
description
DESCRIPTION
Quotes or text fragments can be collected from various sources outside Vim
into a single text document through the clipboard. This plugin makes
consecutive copy-and-pastes into Vim much more comfortable by monitoring the
system clipboard for changes and appending them into the current Vim buffer
automatically. Feedback about the number of captures is given in Vim's window
title, so one does not have to switch back and forth between applications any
more, and can completely focus on text collection via CTRL-C, CTRL-C, ...

USAGE
:[count]CaptureClipboard[!] [{delimiter}]
:[count]CaptureClipboardReverse[!] [{delimiter}]
                        Monitors the clipboard for changes and inserts any
                        change of clipboard contents into the current buffer
                        (in new lines, or delimited by {delimiter} if given).
                        To stop, press <CTRL-C> or copy a literal dot (".") to
                        the clipboard. If [count] is given, the capture stops
                        after [count] captures.

                        If [!] is given, whitespace (including new lines) is
                        trimmed from the beginning and end of each capture.

                        With :CaptureClipboardReverse, changes are prepended,
                        reverting the insertion order. Normally, changes are
                        appended to the current or given [line].
                        Use :$|CaptureClipboard to append to the end of the
                        current buffer.

                        {delimiter} is evaluated as an expression if it is
                        (single- or double-)quoted, or contains backslashes.
                        The default {delimiter} is "\n"; each capture is
                        placed on a new line. Use '' to place everything next
                        to each other, ' ' to put a space character in
                        between, "\n--\n" to insert a -- separator line
                        between captures. When {delimiter} contains a newline
                        character, the first capture will already start on a
                        new line.

CTRL-R ?                Wait for one capture from the clipboard and insert it
                        at the current cursor position.
 
install details
INSTALLATION
This script is packaged as a vimball. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vmb.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the :UseVimball command.
    vim CaptureClipboard*.vmb.gz
    :so %
To uninstall, use the :RmVimball command.

DEPENDENCIES
- Requires Vim 7.0 or higher.

CONFIGURATION
For a permanent configuration, put the following commands into your vimrc:

By default, each capture will be placed on a new line in the capture buffer;
i.e. the delimiter between captures is a newline character:
    let g:CaptureClipboard_DefaultDelimiter = "\n"

The marker text that will stop capturing can be changed via:
    let g:CaptureClipboard_EndOfCaptureMarker = '.'

If you capture a lot of text or the captured information is very valuable, you
can automatically persist the capture buffer after each capture. Enable via:
    let g:CaptureClipboard_IsAutoSave = 1

In X, changes to the current selection ("*) are captured. If you want
to only capture changes to the X clipboard ("+), not every change in
selection, use:
    let g:CaptureClipboard_Register = '+'
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
CaptureClipboard-1.11.vmb.gz 1.11 2012-12-30 7.0 Ingo Karkat Implement check for no-modifiable buffer via noop-modification instead of checking for 'modifiable'; this also handles the read-only warning.
CaptureClipboard-1.10.vmb.gz 1.10 2012-10-29 7.0 Ingo Karkat Add mapping to wait for and insert one capture.
CaptureClipboard.vba.gz 1.00 2010-09-20 7.0 Ingo Karkat Initial upload
ip used for rating: 54.87.109.201

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo