Ⅰ. 插件描述
Vim plugin for copying to the system clipboard with text-objects and motionsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'christoomey/vim-system-copy'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'christoomey/vim-system-copy'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'christoomey/vim-system-copy'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/christoomey/vim-system-copy
Ⅳ. 文档说明
System Copy
System copy provides vim mappings for copying / pasting text to the os specific
- Most people will be happy just setting their Vim clipboard to the
- clipboard, but I find that doing so pollutes my clipboard history.
Instead, this plugin creates a unique mapping that explicitly pulls content
from Vim into the system clipboard.
Usage
System copy provides a mapping to copy to the system clipboard using a motion
or visual selection. It also provides a mapping for pasting from the system
clipboard.
The default mapping is cp for copying and cv for pasting, and can be followed by any motion or text
- For instance:
cpiw=> copy word into system clipboardcpi'=> copy inside single quotes to system clipboardcvi'=> paste inside single quotes from system clipboard
In addition, cP is mapped to copy the current line directly.
The sequence cV is mapped to paste the content of system clipboard to the
next line.
Clipboard Utilities
- OSX -
pbcopyandpbpaste - Windows -
clipandpaste - Linux -
xsel
Note: xsel can be installed with apt-get install xsel if your system doesn't have it installed
Options
system-copy uses default copy and paste command based on your OS, but
you can override either of these commands if you have more specific needs.
To declare custom copy command use following example:
let g:system_copy#copy_command='xclip -sel clipboard'And to declare custom paste command use:
let g:system_copy#paste_command='xclip -sel clipboard -o'By default system_copy prints a message each time you execute the copy- or paste-operation.
If you want to suppress it use:
let g:system_copy_silent = 1Installation
If you don't have a preferred installation method, I recommend using Vundle.
Assuming you have Vundle installed and configured, the following steps will
install the plugin:
Add the following line to your ~/.vimrc and then run :PluginInstall from
within Vim:
call vundle#begin()
" ...
Plugin 'christoomey/vim-system-copy'
" ...
call vundle#end()