Skip to content

Latest commit

 

History

History
73 lines (50 loc) · 2.3 KB

README.md

File metadata and controls

73 lines (50 loc) · 2.3 KB

Undotree

A neovim undotree plugin written in lua.

Screenshot

undotree

Requirements

  • nvim 0.7.0(nightly)

Download and Install

Using Vim's built-in package manager:

mkdir -p ~/.config/nvim/pack/github/start/
cd ~/.config/nvim/pack/github/start/
git clone https://github.com/jiaoshijie/undotree.git

Using vim-plug

Plug 'jiaoshijie/undotree'

Using packer.nvim

use { "jiaoshijie/undotree" }

Usage

  1. Use UndotreeToggle to toggle the undo-tree panel. You may want to map this command to whatever hotkey by adding the following line to your vimrc, take <leader>u for example.
" vimscript
nnoremap <leader>u :UndotreeToggle<cr>

-- lua
vim.api.nvim_set_keymap('n', '<leader>u', ':UndotreeToggle', {noremap = true})
  1. Some Mappings
Mappings Action
j jump to next undo node
k jump to prev undo node
Q quit undotree
q close undotree diff window
J jump to next undo node and undo to this state
K jump to prev undo node and undo to this state
p show the undotree diff window if it has been shown then jump into it
<cr> undo to this state

License

MIT

Reference