Go to file
2021-04-24 14:44:57 +10:00
lua treesitter checker 2021-04-24 14:20:42 +10:00
plugin init commit 2021-04-19 12:56:32 +10:00
LICENSE Initial commit 2021-04-19 12:54:06 +10:00
README.md lighbulb update 2021-04-24 14:44:57 +10:00

Navigator

Easy code navigation through LSP symbols and 🌲Treesitter symbols.

Features:

  • LSP easy setup. Support some of the most commonly used lsp client setup
  • GUI 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 ~500 loc for lsp and still increasing. Reason is that I need to tune the plugins to fit my requirements. The plugin help user setup lspconfig with only a few lines of codes. Seconde reason is that lots of plugins serve as an enhance version of quickfix, lots of improvement was made by lspsaga, from which, the plugin was inspired. 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()

Usage

Please refer to lua/navigator/lspclient/mapping.lua on key mappings. Should be able to work out-of-box Use or :q! to kill the floating window, <up/down> to move and to open location or apply changes

Screenshots

Reference

reference

Document Symbol

document symbol

Workspace Symbol

workspace symbol

Diagnostic

diagnostic

Implementation

implementation

Fzy search in reference

fzy_reference

Code actions

code actions

Code preview with highlight

code preview

Treesitter symbol

Treetsitter symbols in all buffers treesitter

Call hierarchy (incomming/outgoing)

incomming

Light bulb when codeAction avalible

lightbulb

Predefined LSP symbol nerdfont/emoji

nerdfont

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 rust, swift etc)