Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bloznelis/before.nvim
Jump to the last edit in Neovim
https://github.com/bloznelis/before.nvim
lua neovim neovim-plugin
Last synced: 11 days ago
JSON representation
Jump to the last edit in Neovim
- Host: GitHub
- URL: https://github.com/bloznelis/before.nvim
- Owner: bloznelis
- License: mit
- Created: 2024-03-02T17:38:15.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-10-29T11:37:35.000Z (18 days ago)
- Last Synced: 2024-10-29T13:26:05.457Z (18 days ago)
- Topics: lua, neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 27.3 KB
- Stars: 118
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# before.nvim
## Purpose
Track edit locations and jump back to them, like [changelist](https://neovim.io/doc/user/motion.html#changelist), but across buffers.![peeked](https://github.com/bloznelis/before.nvim/assets/33397865/1130572d-dd75-4a07-9c79-9afc91b5d67a)
## Installation
### lazy.nvim
```lua
{
'bloznelis/before.nvim',
config = function()
local before = require('before')
before.setup()-- Jump to previous entry in the edit history
vim.keymap.set('n', '', before.jump_to_last_edit, {})-- Jump to next entry in the edit history
vim.keymap.set('n', '', before.jump_to_next_edit, {})-- Look for previous edits in quickfix list
vim.keymap.set('n', 'oq', before.show_edits_in_quickfix, {})-- Look for previous edits in telescope (needs telescope, obviously)
vim.keymap.set('n', 'oe', before.show_edits_in_telescope, {})
end
}
```### Configuration
#### Settings
```lua
require('before').setup({
-- How many edit locations to store in memory (default: 10)
history_size = 42
-- Wrap around the ends of the edit history (default: false)
history_wrap_enabled = true
})
```
#### Telescope picker
```lua
-- You can provide telescope opts to the picker as show_edits_in_telescope argument:
vim.keymap.set('n', 'oe', function()
before.show_edits_in_telescope(require('telescope.themes').get_dropdown())
end, {})
```#### Register Telescope extension
You may also register the extension via telescope:
```lua
require 'telescope'.setup({ '$YOUR_TELESCOPE_OPTS' })
require 'telescope'.load_extension('before')
```Then call via vimscript:
```vim
:Telescope before
```or lua:
```lua
require 'telescope'.extensions.before.before
```