christoomey/vim-system-copy
关于
Vim plugin for copying to the system clipboard with text-objects and motions
开发工具实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文System Copy
System copy provides vim mappings for copying / pasting text to the os specific clipboard. Most people will be happy just setting their Vim clipboard to the system 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
object. 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 -
xselon X11, andwl-copyandwl-pasteon Wayland
Note: xsel can be installed with apt-get install xsel if your system doesn't have it installed.
- OS-independent copy - provided by
ojroques/vim-oscyankbased onANSI OSC52 sequence
Note: This feature requires an external plugin ojroques/vim-oscyank and needs to be manually enabled. The terminal emulators that support this feature are listed here.
Options
Customizing copy & paste command
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'
Supressing message output
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 = 1
Using OSC52 copy as fallback
OSC52 is an ANSI escape sequence that allows you to copy text into your system clipboard from the supported terminal emulators.
It is useful for running Vim via remote SSH, especially when the default copy command or X11 forwarding is unavaliable on the remote host. Once this feature is enabled, OSC52 copy sequence is used as a fallback if the default copy command failed. You can enable this feature on your local machine with ojroques/vim-oscyank plugin and the supported terminal emulator installed:
let g:system_copy_enable_osc52 = 1
Note: By default, no extra settings for ojroques/vim-oscyank are
required. Only works when copying to the system clipboard; does not
support pasting from the system clipboard.
Installation
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()
探索相关项目
加载中…