scMRU automatically creates a Telescope integrated list of recently used files per git repository.
It also creates a single list for all non-tracked files to allow you to easily access all files in your file system.
The list of files can be access according to Most Recently Used (MRU) or Most Frequently Used (MFU).
:MruRepos | MRU for untracked files |
---|---|
- neovim >= 0.6(required)
- telescope.nvim (required)
{
'ilAYAli/scMRU.nvim',
dependencies = 'kkharji/sqlite.lua',
},
sudo apt install sqlite3
brew install sqlite3
Download eg a precompiled version of sqlite3 from here: https://www.sqlite.org/download.html, and set sqlite_clib_path according to the installation path with either:
lua:
vim.g.sqlite_clib_path = path/to/sqlite.dll
or vimscript:
let g:sqlite_clib_path = path/to/sqlite3.dll
:MruRepos
Display cached repositories and bring up the associated cache
:Mru
Display most recently used files for the current repo (cwd)
:Mfu
Display most frequently used files for the current repo (cwd)
:MruAdd
Explicity add a file from the database
:MruDel
Explicity remove a filename from database
It is also possible to invoke the lua functions directly and supply optional parameters.
This will e.g display the global MFU, Most Frequently Used files:
lua require("mru").display_cache({root="__global__",algorithm="mfu"})
vim.keymap.set('n', '<F1>', function() require("mru").display_cache({}) end)
vim.keymap.set('n', '<F2>', function() require("mru").display_repose({}) end)
vim.keymap.set('n', '<F3>', function() require("mru").display_cache({algorithm="mfu"}) end)