Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gaborvecsei/memento.nvim
A NeoVim plugin which remembers where you've been
https://github.com/gaborvecsei/memento.nvim
lua memento neovim neovim-plugin nvim vim
Last synced: about 1 month ago
JSON representation
A NeoVim plugin which remembers where you've been
- Host: GitHub
- URL: https://github.com/gaborvecsei/memento.nvim
- Owner: gaborvecsei
- Created: 2021-11-13T18:02:00.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-03-18T12:05:37.000Z (about 2 years ago)
- Last Synced: 2024-01-24T09:31:35.026Z (4 months ago)
- Topics: lua, memento, neovim, neovim-plugin, nvim, vim
- Language: Lua
- Homepage:
- Size: 120 KB
- Stars: 58
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome-neovim - gaborvecsei/memento.nvim - Keeps track of your visited file history after a buffer is closed. Reopen files more easily. (Search / PHP)
- awesome-stars - gaborvecsei/memento.nvim - A NeoVim plugin which remembers where you've been (Lua)
- awesome-neovim - gaborvecsei/memento.nvim - Keeps track of your visited file history after a buffer is closed. Reopen files more easily. (Search / Markdown and LaTeX)
- awesome-neovim - gaborvecsei/memento.nvim - Keeps track of your visited file history after a buffer is closed. Reopen files more easily. (Search / Markdown and LaTeX)
README
# Memento.nvim
A NeoVim plugin which remembers where you've been
![Memento](art/memento.png)
When a buffer is deleted (e.g.: `:q`, `:bd`) `memento.nvim` stores the filepath, and current line number so
you can check your history and easily go back to a file. The history is persistent across sessions.> Imagine, you are editing 3 files and in the heat of development you close `nvim` to open it up
> in another directory (happened with me to many times).
> Still, you'd like to use those files, so you'd need to open them up one-by-one knowing the path of the file.
> With this plugin you just hit the right keys (or call `:lua require("memento").toggle()`)
> and you can check your history and open them up again easily from a popup menu.*(The plugin is mostly for my personal use, but PRs are welcome)*
# Install
```lua
Plug 'nvim-lua/plenary.nvim' -- if you already have this you don't need to include it again
Plug 'gaborvecsei/memento.nvim'
```# Usage
```lua
-- Open up history popup menu
:lua require("memento").toggle()-- Clear history
:lua require("memento").clear_history()
```When the popup is visible, you can **close it with `q`** and **open up any file at any line by hitting ``**
## Keybinding
```lua
nnoremap mh lua require('memento').toggle()
```# Configuration
| Variable | Description | Type | Default |
|-------------------------|------------------------------------------------------------------------------------------------------------|--------|---------|
| `memento_history` | Length of the history | `int` | `20` |
| `memento_shorten_path` | Compact representation of the filepath. (e.g.: `/t/i/a/t/script.py` instead of `/this/is/a/test/script.py` | `bool` | `true` |
| `memento_window_width` | Popup window's width | `int` | `80` |
| `memento_window_height` | Popup window's height | `int` | `14` |```lua
vim.g.memento_history = 20
vim.g.memento_shorten_path = true
vim.g.memento_window_width = 80
vim.g.memento_window_height = 14
```