cutlass.vim


Ⅰ. 插件描述

Plugin that adds a 'cut' operation separate from 'delete'

Ⅱ. 基本信息

创建日期:  2013-11-14
使用用户:  20
Github星:  55
插件作者:  Steve Vermeulen

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'svermeulen/cutlass-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'svermeulen/cutlass-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'svermeulen/cutlass-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/svermeulen/vim-cutlass

Ⅳ. 文档说明

Cutlass.vim

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: c, cc, C, s, S, d, dd, D, x, 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?

See here

You might also consider installing vim-yoink which contains other clipboard related improvements mentioned in this article.

Credits

Based off of vim-easyclip and also Drew Neil's ideas (as well as the name)

添加新评论