Ⅰ. 插件描述
Vim plugin for naturally copy, cut, and paste between buffer and system clipboardⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'nlknguyen/copy-cut-paste-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'nlknguyen/copy-cut-paste-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'nlknguyen/copy-cut-paste-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/nlknguyen/copy-cut-paste.vim
Ⅳ. 文档说明
# copy-cut-paste.vim
Keymaps for easy copying, cutting, and pasting between Vim terminal buffer and system clipboard
Require +clipboard
To check:
vim --version | grep clipboardIf not available and you're on Ubuntu, the fastest way to have it is through this package:
sudo apt-get install vim-gtkGVim has it by default in all OSes
Keymaps
Default
| Mode | Key | Action |
|---|---|---|
| Normal | QC | Copy a whole line to system clipboard |
| Visual | QC | Copy selected text to system clipboard |
| Normal | QX | Cut a whole line to system clipboard |
| Visual | QX | Cut selected text to system clipboard |
| Normal | QV | Paste from system clipboard |
To turn off default keymapping and use your own:
let g:copy_cut_paste_no_mappings = 1
" Use your keymap
nmap QC <Plug>CCP_CopyLine
vmap QC <Plug>CCP_CopyText
nmap QX <Plug>CCP_CutLine
vmap QX <Plug>CCP_CutText
nmap QV <Plug>CCP_PasteTextPasting with smartindent automatically turned off temporarily
| Mode | Key |
|---|---|
| Normal | Use your terminal key for pasting, ex: Ctrl+Shift+V in Ubuntu and Shift+Insert in Windows |
Install
Using Vundle plugin manager:
Plugin 'NLKNguyen/copy-cut-paste.vim'Or manually: copy copy-cut-paste.vim file to your ~/.vim/plugin/ directory
License
Same as Vim