gbprod/cutlass.nvim

github github
editing-support
star 35
stars
alert-circle 0
open issues
users 1
subscribers
git-branch 0
forks
CREATED

2021-12-08

UPDATED

14 days ago


cutlass.nvim

Integration

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.

Why would you want to do this?

See here. This plugin already exists in vimscript. I hope this version in lua will be more efficient :)

Usage

Requires neovim > 0.5.0.

Using https://github.com/wbthomason/packer.nvim:

use({
  "gbprod/cutlass.nvim",
  config = function()
    require("cutlass").setup({
        cut_key = "m"
    })
  end
})

Configuration

cut_key

Default : nil

After setting up 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 setting the cut_key value when setting up the plugin. (m or x are recommended)

This will create those bindings :

nnoremap m d
xnoremap m d
nnoremap mm dd
nnoremap M D

override_del

Default : nil

By default, this plugin doesn't remap the <Del> key to use the blackhole register (and it will work as the old x key). By setting override_del to true, <Del> key will not cut any more and not afect your current yank.

Integration

If you have svermeulen/vim-yoink installed, it will work seemlessly as original svermeulen/vim-cutlass. Just follow the integration instructions.

Credits

This plugin is a lua version of svermeulen/vim-cutlass (based off of vim-easyclip and also Drew Neil's ideas)

Credit to m00qek lua plugin template