A neovim undotree plugin written in lua.
Screenshot
- nvim 0.7.0(nightly)
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" }
- 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})
- 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 |
MIT