A minimal Neovim plugin for resolving project files using customizable rules. Designed for developers seeking lightweight file navigation and path resolution.
- 🔍 Custom Rule System: Define project-specific file resolution logic
- 🚀 Lightweight: Minimal dependencies and overhead
- 🧩 Neovim Native: Built with Lua for seamless integration
- 🔄 Dynamic Resolution: Handle complex project structures
- 📂 Path Aliasing: Simplify imports and file references
Using Lazy.nvim
{
'yebt/file-resolver.nvim',
keys = {
'<leader>fr', ':lua require("file-resolver").resolve_current_file()<CR>'
},
config = function()
require('file-resolver').setup()
end
}
Note
Requires Neovim 0.5+
Create custom resolution rules in your init.lua:
local fr = require('fr')
fr.setup({})
fr.register_resolver('TypeScript Aliases', function(line, file_path)
local match = line:match('from%s+[\'"](@[%w_/]+)[\'"]')
if match then
return vim.fn.getcwd() .. '/src/' .. match:gsub('@', '')
end
end)
:lua require('file-resolver').resolve_current_file()
vim.keymap.set('n', '<leader>fr', require('file-resolver').resolve_current_file)
require('file-resolver').project_resolve()
Common issues:
- Rules Not Applying:
Verify Lua pattern syntax 2. Check rule ordering (first match wins)
Performance Concerns: 3. Use specific patterns before wildcards
Limit complex regex in large projects
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push branch (
git push origin feature/amazing-feature
) - Open Pull Request
MIT License - See LICENSE for details 1