From f9794ab0585dea44103587dfde1c2accf9bee66b Mon Sep 17 00:00:00 2001 From: ray-x Date: Mon, 10 May 2021 09:58:13 +1000 Subject: [PATCH] use packer to load plugins --- README.md | 5 +++-- lua/navigator/lspclient/attach.lua | 7 ------- lua/navigator/lspclient/clients.lua | 6 ++++-- lua/navigator/util.lua | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6534d48..edbab21 100644 --- a/README.md +++ b/README.md @@ -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' ``` diff --git a/lua/navigator/lspclient/attach.lua b/lua/navigator/lspclient/attach.lua index 90c1669..baa62ba 100644 --- a/lua/navigator/lspclient/attach.lua +++ b/lua/navigator/lspclient/attach.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 diff --git a/lua/navigator/lspclient/clients.lua b/lua/navigator/lspclient/clients.lua index 1376df1..dd119c6 100644 --- a/lua/navigator/lspclient/clients.lua +++ b/lua/navigator/lspclient/clients.lua @@ -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 diff --git a/lua/navigator/util.lua b/lua/navigator/util.lua index e02090d..0325da6 100644 --- a/lua/navigator/util.lua +++ b/lua/navigator/util.lua @@ -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)