Skip to content

A Neovim plugin for viewing and accessing recently opened files

License

Notifications You must be signed in to change notification settings

amartincodes/storia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Storia

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.

Features

  • 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

Installation

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,
}

Alternative minimal setup

{
  "amartincodes/storia",
  config = true, -- Uses default configuration
  keys = {
    { "<leader>sr", function() require("storia").toggle() end, desc = "Storia recent files" },
  },
}

Using other plugin managers

packer.nvim

use {
  "amartincodes/storia",
  config = function()
    require("storia").setup()
  end
}

vim-plug

Plug 'amartincodes/storia'

lua << EOF
require("storia").setup()
EOF

Usage

Commands

  • :Storia - Toggle the floating window showing recent files
  • :StoriaClear - Clear the file history

Keybindings inside the floating window

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

Configuration

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/" },
  },
})

API

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 }, ... }

How it works

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.

Why Storia?

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

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

MIT License - see LICENSE file for details

Inspiration

Inspired by various Neovim file navigation plugins and the need for a simple, session-based recent files tracker.

Disclaimer

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.

About

A Neovim plugin for viewing and accessing recently opened files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages