Home

Awesome

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 clipboard

If not available and you're on Ubuntu, the fastest way to have it is through this package:

sudo apt-get install vim-gtk

GVim has it by default in all OSes

Keymaps

Default

ModeKeyAction
NormalQCCopy a whole line to system clipboard
VisualQCCopy selected text to system clipboard
NormalQXCut a whole line to system clipboard
VisualQXCut selected text to system clipboard
NormalQVPaste 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_PasteText

Pasting with smartindent automatically turned off temporarily

ModeKey
NormalUse 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