lua | ||
plugin | ||
LICENSE | ||
README.md |
Navigator
Easy code navigation through LSP and 🌲Treesitter symbols, diagnostic errors.
Features:
- LSP easy setup. Support some of the most commonly used lsp client setup
- Unorthodox UI with floating windows
- fzy search with Lua-JIT
- Better navigation for diagnostic errors, Navigate through files that contain errors/warnings
- Group references/implementation/incomming/outgoing based on file names.
- Nerdfont, emoji for LSP and Treesitter kind
Why a new plugin
After installed a handful of lsp plugins, I still got ~800 loc for lsp and treesitter and still increasing because I need to tune the lsp plugins to fit my requirements. Navigator.lua help user setup lspconfig with only a few lines of codes. This plugin provide a visual way to manage and navigate through symobls, errors etc. It also the first plugin, IMO, that allows you to search in all treesitter symbols in the workspace.
Similar projects / special mentions:
Install
You can remove your lspconfig setup and use this plugin. The plugin depends on guihua.lua, which provides GUI and fzy support.
Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' }
Plug 'ray-x/navigator.lua'
Packer
use {'ray-x/navigator.lua', requires = {'ray-x/guihua.lua', run = 'cd lua/fzy && make'}}
Setup
lua require'navigator'.setup()
Sample vimrc
call plug#begin('~/.vim/plugged')
Plug 'neovim/nvim-lspconfig'
Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' }
Plug 'ray-x/navigator.lua'
call plug#end()
lua <<EOF
local nvim_lsp = require('lspconfig')
require'navigator'.setup()
EOF
Generally speaking, you could remove most part of your lspconfig.lua and use the hooks in navigator.lua
Usage
Please refer to lua/navigator/lspclient/mapping.lua on key mappings. Should be able to work out-of-box.
- Use <c-e> or
:q!
to kill the floating window - <up/down> to move
- <c-o> to open location or apply code actions
Screenshots
colorschema: aurora
Reference
Document Symbol
Workspace Symbol
Diagnostic
Implementation
Fzy search in reference
Code actions
Code preview with highlight
Treesitter symbol
Treetsitter symbols in all buffers
Call hierarchy (incomming/outgoing)
Light bulb when codeAction avalible
Predefined LSP symbol nerdfont/emoji
Todo
- Early phase, bugs expected
- Async (some of the requests is slow on large codebase and might be good to use co-rountine)
- More clients. I use go, python, js/ts, java, c/cpp, lua most of the time. Do not test other languages (e.g dart, swift etc)