diff --git a/README.md b/README.md index c816669..3e90a5e 100644 --- a/README.md +++ b/README.md @@ -592,6 +592,33 @@ You can delegate the lsp server setup to lsp_installer with `server:setup{opts}` Here is an example [init_lsp_installer.lua](https://github.com/ray-x/navigator.lua/blob/master/playground/init_lsp_installer.lua) +### Integration with other lsp plugins (e.g. rust-tools, go.nvim) +There are lots of plugins provides lsp support +go.nvim allow you either hook gopls from go.nvim or from navigator and it can export the lsp setup from go.nvim. + +rust-tools allow you to setup on_attach from config server +Here is an example to setup rust with rust-tools + +```lua +require'navigator'.setup({ + lsp = { + disable_lsp = { "rust_analyzer" }, -- will not run rust_analyzer setup from navigator + } +}) + +require('rust-tools').setup({ + server = { + on_attach = function(_, _) + require('navigator.mappings').setup() -- setup navigator keymaps here, + -- otherwise, you can define your own commands to call navigator functions + end, + } +}) + +``` + + + ## Usage Please refer to lua/navigator/lspclient/mapping.lua on key mappings. Should be able to work out-of-box.