Skip to content

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

License

Notifications You must be signed in to change notification settings

svermeulen/vim-cutlass

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vim Script 100.0%