ilAYAli / scMRU.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scMRU - source control: Most Recently Used files

Telescope integrated per repo MRU/MFU



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).

Demo video

https://youtu.be/Q6VgtRD93pQ

Demo images

:MruRepos MRU for untracked files

Requirements

Installation

  {
    'ilAYAli/scMRU.nvim',
    dependencies = 'kkharji/sqlite.lua',
  },

Linux:

sudo apt install sqlite3

MacOS:

brew install sqlite3

Windows:

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

Usage

: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"})

Keymap example

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)

About

License:MIT License


Languages

Language:Lua 93.5%Language:Vim Script 6.5%