A simple and elegant Neovim plugin to track and quickly access recently opened files in the current session. The name "storia" means "history" in Italian.
- Track files opened during the current Neovim session
- Display recent files in a beautiful floating window
- Navigate and open files with intuitive keybindings
- Filter out special buffers (terminals, help files, etc.)
- No persistence across sessions - keeps things simple and fast
- Minimal configuration with sensible defaults
- Fully customizable
Using lazy.nvim
{
"amartincodes/storia",
config = function()
require("storia").setup({
max_files = 10,
})
-- Optional: Set up a keybinding
vim.keymap.set("n", "<leader>sr", function()
require("storia").toggle()
end, { desc = "Storia: Toggle recent files" })
end,
}{
"amartincodes/storia",
config = true, -- Uses default configuration
keys = {
{ "<leader>sr", function() require("storia").toggle() end, desc = "Storia recent files" },
},
}use {
"amartincodes/storia",
config = function()
require("storia").setup()
end
}Plug 'amartincodes/storia'
lua << EOF
require("storia").setup()
EOF:Storia- Toggle the floating window showing recent files:StoriaClear- Clear the file history
| Key | Action |
|---|---|
<CR> or Enter |
Open the selected file |
q or <Esc> |
Close the floating window |
d |
Remove the selected file from history |
s |
Open the selected file in a horizontal split |
v |
Open the selected file in a vertical split |
Here's the default configuration with all available options:
require("storia").setup({
-- Maximum number of files to track
max_files = 10,
-- Window options
window = {
width = 60,
height = 10,
border = "rounded", -- "single", "double", "rounded", "solid", "shadow", "none"
title = " Storia ",
title_pos = "center", -- "left", "center", "right"
},
-- Key mappings inside the floating window
mappings = {
close = { "q", "<Esc>" },
select = "<CR>",
delete = "d",
vsplit = "v",
split = "s",
},
-- Buffer filtering
exclude = {
-- Buffer types to exclude
buftypes = { "terminal", "nofile", "help", "quickfix", "prompt" },
-- File types to exclude
filetypes = { "netrw", "fugitive", "gitcommit", "NvimTree", "neo-tree", "TelescopePrompt" },
-- Lua patterns to exclude from paths
patterns = { "^fugitive://", "^/tmp/" },
},
})Storia exposes a simple API for integration with other plugins:
local storia = require("storia")
-- Toggle the floating window
storia.toggle()
-- Clear the file history
storia.clear()
-- Get the list of recent files (for custom integrations)
local files = storia.get_recent_files()
-- Returns: { { path = "/path/to/file", timestamp = 1234567890, bufnr = 1 }, ... }Storia automatically tracks files as you open them by listening to the BufEnter autocommand. It intelligently filters out:
- Special buffers (terminals, quickfix, help files)
- Plugin-specific buffers (file explorers, git tools, etc.)
- Non-file buffers
- Files matching custom exclusion patterns
Only real files that exist on disk are tracked, ensuring a clean and useful history.
There are other recent file plugins available, but Storia focuses on:
- Simplicity: No complex configuration or features you don't need
- Session-based: Your history is per-session, not global - perfect for project-focused workflows
- Performance: Minimal overhead, no file I/O for persistence
- User Experience: Beautiful floating window with intuitive navigation
Contributions are welcome! Feel free to open issues or submit pull requests.
MIT License - see LICENSE file for details
Inspired by various Neovim file navigation plugins and the need for a simple, session-based recent files tracker.
This plugin was made quickly with AI to solve a personal need. It may not be perfect, but it works well for my workflow. Use at your own discretion! Feel free to suggest improvements or report any issues you encounter.