use packer to load plugins

neovim_0_5
ray-x 3 years ago
parent 7aea58acdd
commit f9794ab058

@ -18,7 +18,7 @@ Easy code navigation through LSP and 🌲🏡Treesitter symbols, diagnostic erro
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 provides a visual way to manage and navigate through symobls, errors, reference etc.
This plugin provides a visual way to manage and navigate through symbols, diagnostic errors, reference etc.
It also the first plugin, IMO, that allows you to search in all treesitter symbols in the workspace.
# Similar projects / special mentions:
@ -32,9 +32,10 @@ It also the first plugin, IMO, that allows you to search in all treesitter symbo
# Install
You can remove your lspconfig setup and use this plugin.
The plugin depends on [guihua.lua](https://github.com/ray-x/guihua.lua), which provides GUI and fzy support(thanks [romgrk](romgrk/fzy-lua-native)).
The plugin depends on lspconfig and [guihua.lua](https://github.com/ray-x/guihua.lua), which provides GUI and fzy support(thanks [romgrk](romgrk/fzy-lua-native)).
```vim
Plug 'neovim/nvim-lspconfig'
Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' }
Plug 'ray-x/navigator.lua'
```

@ -31,13 +31,6 @@ M.on_attach = function(client, bufnr)
require "navigator.lspclient.lspkind".init()
if not package.loaded["illuminate"] then
vim.cmd [[silent! packadd vim-illuminate]]
local hasilm, ilm = pcall(require, "illuminate") -- package.loaded["illuminate"]
if hasilm then
ilm.on_attach(client)
end
end
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true

@ -5,11 +5,13 @@ local verbose = require "navigator.util".verbose
_Loading = false
if packer_plugins ~= nil then
-- packer installed
local loader = require "packer".loader
if not packer_plugins["neovim/nvim-lspconfig"] or not packer_plugins["neovim/nvim-lspconfig"].loaded then
vim.cmd [[packadd nvim-lspconfig]]
loader("nvim-lspconfig")
end
if not packer_plugins["ray-x/guihua.lua"] or not packer_plugins["guihua.lua"].loaded then
vim.cmd [[packadd guihua.lua]]
loader("guihua.lua")
-- if lazyloading
end
end

@ -95,7 +95,7 @@ local default_config = {
plugin = "navigator",
use_console = false,
use_file = true,
level = "error"
level = "info"
}
M._log = require("guihua.log").new({level = default_config.level}, true)

Loading…
Cancel
Save