https://github.com/user-attachments/assets/4f16a8b9-7e39-4053-bde7-37646b8954cd
seeker.nvim is a Neovim plugin that enables progressive file investigation by seamlessly switching between file filtering and content searching (grep), with each switch refining your results.
Built on top of snacks.nvim picker, seeker provides a powerful workflow for narrowing down files by name, then searching within those files, then further refining the file list based on grep results - all without losing context.
neovim (0.9.0+)-- Lazy.nvim
{
'2kabhishek/seeker.nvim',
dependencies = { 'folke/snacks.nvim' },
cmd = { 'Seeker' },
keys = {
{ '<leader>fa', ':Seeker files<CR>', desc = 'Seek Files' },
{ '<leader>ff', ':Seeker git_files<CR>', desc = 'Seek Git Files' },
{ '<leader>fg', ':Seeker grep<CR>', desc = 'Seek Grep' },
},
opts = { }, -- Required unless you call seeker.setup() manually, add your configs here
}
:Seeker or press <leader>ff<C-e> to search within the filtered files<C-e> again to see only files with matches<Tab> to select specific files to search before switching modesseeker.nvim can be configured using the following options:
require('seeker').setup({
toggle_key = '<C-e>', -- Key to toggle between modes (default)
picker_opts = {}, -- Options passed to snacks.picker (optional)
})
The :Seeker command accepts an optional mode argument with tab completion:
:Seeker - Auto-detect (uses git_files in git repos, files otherwise):Seeker files - Force files picker (all files):Seeker git_files - Force git_files picker (git tracked files only):Seeker grep - Start with grep picker directly| Keybinding | Mode | Description |
|---|---|---|
<leader>fa |
Normal | Seek Files |
<leader>ff |
Normal | Seek Git Files |
<leader>fg |
Normal | Seek Grep |
<C-e> |
File Picker (n/i) | Toggle Grep / File mode |
<Tab> |
Picker (n/i) | Multi Selection |
You can customize the toggle key via config, and others using lazy's key definitions.
If you use pickme.nvim, you need to add Seeker keybindgings manually / via which key.
-- Start seeker programmatically
require('seeker').seek()
-- Start with custom options (merged with setup config)
require('seeker').seek({
picker_opts = {
layout = { preset = 'vertical' }
}
})
Seeker uses a stateful approach to maintain context across mode switches:
state.file_list: Files to search in grep modestate.grep_files: Files with matches (shown in file mode)state.mode: Current mode ('file' | 'grep')# Run all tests
nvim --headless -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua'}"
# or
make
# Run specific test file
nvim --headless -c "PlenaryBustedFile tests/seeker/state_spec.lua {minimal_init = 'tests/init.lua'}"
I frequently needed to investigate codebases by filtering files, then searching within those files, then further refining based on content - but existing tools required starting over each time. Seeker solves this by maintaining context across mode switches.
โญ hit the star button if you found this useful โญ
Source | Blog | Twitter | LinkedIn | More Links | Other Projects