Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinhwang91/nvim-fundo
Forever undo in Neovim
https://github.com/kevinhwang91/nvim-fundo
lua neovim neovim-lua neovim-plug neovim-plugin nvim undo
Last synced: 16 days ago
JSON representation
Forever undo in Neovim
- Host: GitHub
- URL: https://github.com/kevinhwang91/nvim-fundo
- Owner: kevinhwang91
- License: bsd-3-clause
- Created: 2022-11-14T14:53:02.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T17:21:56.000Z (6 months ago)
- Last Synced: 2024-08-01T16:44:58.362Z (4 months ago)
- Topics: lua, neovim, neovim-lua, neovim-plug, neovim-plugin, nvim, undo
- Language: Lua
- Homepage:
- Size: 41 KB
- Stars: 213
- Watchers: 10
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nvim-fundo
The goal of nvim-fundo is to make Neovim's undo file become stable and useful.
> WIP. If you like this plugin, star it to let me speed up to end WIP state.
## Features
- Restore undo history even if the file's content has been changed outside Neovim
- Limit size for archives### TODO Features
- Restore undo history even if the file has been moved
- Support useful use cases for undo file## Quickstart
### Requirements
- [Neovim](https://github.com/neovim/neovim) 0.7.2 or later
### Installation
Install with [Packer.nvim](https://github.com/wbthomason/packer.nvim):
```lua
use {
'kevinhwang91/nvim-fundo', requires = 'kevinhwang91/promise-async',
run = function() require('fundo').install() end
}
```### Minimal configuration
```lua
use {
'kevinhwang91/nvim-fundo', requires = 'kevinhwang91/promise-async',
run = function() require('fundo').install() end
}vim.o.undofile = true
require('fundo').setup()
```### Usage
Use undo file as usual.
## Documentation
### How does nvim-undo keep the undo history?
Fundo will keep the latest files as archives, in other words, it takes additional space in your
disk. If the `BufReadPost` event is fired, it will validate the undo file and restore it if
necessary.### Setup and description
```lua
{
archives_dir = {
description = [[The directory to store the archives]],
default = vim.fn.stdpath('cache') .. path.separator .. 'fundo'
},
limit_archives_size = {
description = [[Limit the archives directory size, unit is MB(megabyte), elder files will be
removed based on their modified time]],
default = 512
}
}
````:h fundo` may help you to get the all default configuration.
### API
[fundo.lua](./lua/fundo.lua)
## Run tests
`make test`
## Feedback
- If you get an issue or come up with an awesome idea, don't hesitate to open an issue in github.
- If you think this plugin is useful or cool, consider rewarding it a star.## License
The project is licensed under a BSD-3-clause license. See [LICENSE](./LICENSE) file for details.