Skip to content

Highlight changed text after an operation. Purely lua / Nvim API implementation, no external dependencies needed.

License

Notifications You must be signed in to change notification settings

iguanacucumber/highlight-actions.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

highlight-actions.nvim

Highlight changed text after an operation. Purely lua / nvim api implementation, no external dependencies needed.

recording.mp4

✨ Installation

Using Lazy:

{
  'iguanacucumber/highlight-actions.nvim',
  keys = { "u", "p", "<C-r>" }, -- Lazy load on keymap
-- opts = {}, -- for a default config
  opts = {
    highlight_for_count = true, -- Should '3p' or '5u' be highlighted
    duration = 300, -- Time in ms for the highlight
    after_keymaps = function() end, -- Any keymaps you might wanna add after the keymaps set by this plugin
    actions = {
      Undo = {
        disabled = false, -- Useful when debugging
        fg = "#dcd7ba", -- colors
        bg = "#2d4f67",
        mode = "n", -- The mode(s)
        keymap = "u", -- mapping
        cmd = "undo", -- Vim command
        opts = {}, -- silent = true, desc = "", ...
      },
      Redo = { keymap = "<C-r>", cmd = "redo" }, -- Actions can be made as easely as this
      Pasted = {
        keymap = "p",
        cmd = "put",
        cmd_args = function() -- This function needs to return a string as a parameter to cmd
          return vim.v.register -- Return the register
        end,
      },
    -- Any other actions you might wanna add
    },
  },
},

Note

This plugin is a fork of highlight-undo.nvim

About

Highlight changed text after an operation. Purely lua / Nvim API implementation, no external dependencies needed.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages