Ⅰ. 插件描述Plugin that adds a 'cut' operation separate from 'delete'
:source % :PluginInstall
对于Vundle版本 < 0.10.2，请用上面的Bundle替换Plugin。
:source % :NeoBundleInstall
:source % :PlugInstall
cd ~/.vim/bundle git clone https://github.com/svermeulen/vim-cutlass
Cutlass overrides the delete operations to actually just delete and not affect the current yank.
It achieves this by overriding the following keys to always use the black hole register:
X. Note that if you have already mapped these keys to something else (like we do below with
x) then it will not change it again.
After including this plugin, all of these operations will simply delete and not cut. However, you will still want to have a key for 'cut', which you can add by including the following to your .vimrc:
nnoremap m d xnoremap m d nnoremap mm dd nnoremap M D
m here can be thought of as 'move'. Note that you will be shadowing the 'add mark' key if you go with this binding. Or you might want to use the
x key instead:
nnoremap x d xnoremap x d nnoremap xx dd nnoremap X D
And then use
dl instead of
x every time you want to delete a single character. You might also consider using
s with vim-subversive and then using
cl as a replacement in the same way.
Why would you want to do this?
You might also consider installing vim-yoink which contains other clipboard related improvements mentioned in this article.