Skip to content

z775729168/highlight-undo.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

highlight-undo.nvim

Highlight changed text after Undo / Redo operations. Purely lua / nvim api implementation, no external dependencies needed.

In Action

recording

install

Using Lazy:

  {
      'tzachar/highlight-undo.nvim',
      config = function()
        require('highlight-undo').setup({
            ...
          })
      end
  },

Setup

You can setup highlight-undo as follows:

require('highlight-undo').setup({
    hlgroup = 'HighlightUndo',
    duration = 300,
})

hlgroup

Specify the highlighting group to use.

By default, highlight-undo will use the HighlightUndo highlight group, which it defines upon startup. If the group is already defined elsewhere in your config then it will not be overwritten. You can also use any other group you desire.

duration

The duration (in milliseconds) highligh changes. Default is 300.

How the Plugin Works

highlight-undo will remap the u and <C-r> keys (for undo and redo) and hijack the calls. By utilizing nvim_buf_attach to get indications for changes in the buffer, we can achieve very low overhead.

About

Highlight changed text after Undo / Redo operations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%