An open API service indexing awesome lists of open source software.

https://github.com/jkeresman01/active-files.nvim

A Neovim plugin that brings JetBrains-style Switcher or Visual Studio’s Active Files navigation to your workflow
https://github.com/jkeresman01/active-files.nvim

active-files jetbrains lua neovim nvim nvim-plugin nvim-plugins open-file open-files plugin switcher switcher-plugin vim vim-plugin visual-studio

Last synced: 9 months ago
JSON representation

A Neovim plugin that brings JetBrains-style Switcher or Visual Studio’s Active Files navigation to your workflow

Awesome Lists containing this project

README

          

active-files.nvim


Neovim plugin that allows switching between recently used files — similar to Switcher in JetBrains or Active Files in Visual Studio.

[![Lua](https://img.shields.io/badge/Lua-blue.svg?style=for-the-badge&logo=lua)](http://www.lua.org)
[![Neovim 0.9+](https://img.shields.io/badge/Neovim%200.9+-green.svg?style=for-the-badge&logo=neovim)](https://neovim.io)
![Work In Progress](https://img.shields.io/badge/Work%20In%20Progress-orange?style=for-the-badge)

## Table of Contents

- [The problem](#problem)
- [The solution](#solution)
- [Repository structure](#repo)
- [Functionalities](#functionalities)
- [Installation](#installation)
- [Vim-Plug](#vimplug)
- [Packer](#packer)
- [Commands](#commands)
- [Setup](#setup)

---

## The problem :warning:

In modern IDEs like Visual Studio and JetBrains products, there's always a fast way to jump between recently opened files. In Neovim, this often requires fuzzy finders or full buffer lists, which don’t reflect recency in a consistent way and may include irrelevant or closed buffers.

---

## The solution :trophy:

**active-files.nvim** provides a clean, dedicated UI to quickly access the last N files you've worked on — sorted by recency of usage. With a popup window, non-intrusive indexing, and direct file switching, this gives you a workflow familiar to JetBrains and VS users — but native to Neovim.

[![asciicast](https://asciinema.org/a/1Gnp274hSDNpdkfnWerxj2sF0.svg)](https://asciinema.org/a/1Gnp274hSDNpdkfnWerxj2sF0)

---

## Repository structure :open_file_folder:

```bash
active-files.nvim/
├── LICENSE
├── lua
│ └── active-files
│ ├── commands.lua # Exposed commands
│ ├── init.lua # Plugin entry point
│ ├── ui.lua # UI and switching logic
│ └── util.lua # Utility helpers
└── README.md
```

---

## Functionalities :pick:

- [x] Automatically tracks most recently opened files
- [x] Floating window UI inspired by JetBrains and Visual Studio
- [x] Jump to file by number key (1–9)
- [x] Displays filenames with relative paths
- [ ] Configurable number of active files --planned
- [ ] Configurable active files sorting criteria -- planned

---

## Installation :star:

Requires **Neovim v0.9+**. No external dependencies required.

### Vim-Plug

```lua
Plug 'jkeresman01/active-files.nvim'
```

### Packer

```lua
use 'jkeresman01/active-files.nvim'
```

---

## Commands :wrench:

These are the available user commands:

| Command | Description |
|------------------------|--------------------------------------------------|
| `:ShowActiveFiles` | Show floating popup with active files |
| `:SelectActiveFile` | Select a file from the floating window (internal)|
| `:SwitchToActiveFile n`| Immediately switch to file at index `n` |

---

## Setup :hammer_and_wrench:

Set the keybindings to match your workflow here is one example:

```lua
require("active-files").setup()

vim.keymap.set("n", "", "ShowActiveFiles", { desc = "Show active files" })

-- Optional
for i = 1, 9 do
vim.keymap.set("n", "" .. i, function()
vim.cmd("SwitchToActiveFile " .. i)
end, { noremap = true, silent = true, desc = "Switch to active file " .. i })
end

vim.api.nvim_create_autocmd("FileType", {
pattern = "active-files",
callback = function(args)
vim.keymap.set("n", "", "SelectActiveFile", { buffer = args.buf, silent = true })
end,
})

```
---

| Keybinding | Mode | Description |
|------------------|------|----------------------------------------------|
| `` | `n` | Show the active files floating popup |
| `1`–`9` | `n` | Jump directly to the N-th most recent file |
| `` | `n` | Inside popup: open the selected file |