From 35d090aa7c1b319dbc2b622d8bc211cb2765ff33 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 22 Aug 2021 21:37:43 +0300 Subject: feat(nvim): install Lsp Saga --- nvim/.config/nvim/init.vim | 3 ++- nvim/.config/nvim/lua/filetree.lua | 13 +++++++++++++ nvim/.config/nvim/lua/lsp-config.lua | 1 - nvim/.config/nvim/lua/lsp-saga.lua | 11 +++++++++++ nvim/.config/nvim/lua/nvim-tree.lua | 13 ------------- nvim/.config/nvim/vim-plug/plugins.vim | 1 + 6 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 nvim/.config/nvim/lua/filetree.lua create mode 100644 nvim/.config/nvim/lua/lsp-saga.lua delete mode 100644 nvim/.config/nvim/lua/nvim-tree.lua diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index aad7ecd..921859c 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -72,7 +72,8 @@ nnoremap r :Telescope live_grep source ~/.config/nvim/startify.vim source ~/.config/nvim/vimwiki.vim -lua require('nvim-tree') lua require('lsp-config') +lua require('lsp-saga') lua require('completion') lua require('treesitter') +lua require('filetree') diff --git a/nvim/.config/nvim/lua/filetree.lua b/nvim/.config/nvim/lua/filetree.lua new file mode 100644 index 0000000..43f7da3 --- /dev/null +++ b/nvim/.config/nvim/lua/filetree.lua @@ -0,0 +1,13 @@ +local tree_cb = require'nvim-tree.config'.nvim_tree_callback + +vim.api.nvim_set_keymap('n', '', ':NvimTreeToggle', { noremap = true, silent = true }) + +vim.g.nvim_tree_auto_close = 1 +vim.g.nvim_tree_group_empty = 1 + +vim.g.nvim_tree_bindings = { + { key = "l", cb = tree_cb("edit") }, + { key = "h", cb = tree_cb("parent_node") and tree_cb("close_node") }, + { key = "cw", cb = tree_cb("rename") }, + { key = "o", cb = tree_cb("create") }, +} diff --git a/nvim/.config/nvim/lua/lsp-config.lua b/nvim/.config/nvim/lua/lsp-config.lua index 74f22a6..f9189d7 100644 --- a/nvim/.config/nvim/lua/lsp-config.lua +++ b/nvim/.config/nvim/lua/lsp-config.lua @@ -17,7 +17,6 @@ local on_attach = function(client, bufnr) buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.type_definition()', opts) buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) end diff --git a/nvim/.config/nvim/lua/lsp-saga.lua b/nvim/.config/nvim/lua/lsp-saga.lua new file mode 100644 index 0000000..d3c1739 --- /dev/null +++ b/nvim/.config/nvim/lua/lsp-saga.lua @@ -0,0 +1,11 @@ +local saga = require 'lspsaga' + +vim.api.nvim_set_keymap('n', 'K', ':Lspsaga hover_doc', { noremap = true, silent = true }) + +saga.init_lsp_saga { + error_sign = '', + warn_sign = '', + hint_sign = '', + infor_sign = '', + border_style = "round", +} diff --git a/nvim/.config/nvim/lua/nvim-tree.lua b/nvim/.config/nvim/lua/nvim-tree.lua deleted file mode 100644 index 57340aa..0000000 --- a/nvim/.config/nvim/lua/nvim-tree.lua +++ /dev/null @@ -1,13 +0,0 @@ -local tree_cb = require'nvim-tree.config'.nvim_tree_callback - -vim.api.nvim_set_keymap('n', '', ':NvimTreeToggle', { noremap = true, silent = true }) - -vim.g.nvim_tree_auto_close = 1 -vim.g.nvim_tree_group_empty = 1 - -vim.g.nvim_tree_bindings = { - { key = "l", cb = tree_cb("edit") }, - { key = "h", cb = tree_cb("close_node") }, - { key = "cw", cb = tree_cb("rename") }, - { key = "o", cb = tree_cb("create") }, -} diff --git a/nvim/.config/nvim/vim-plug/plugins.vim b/nvim/.config/nvim/vim-plug/plugins.vim index e90a401..a99bb14 100644 --- a/nvim/.config/nvim/vim-plug/plugins.vim +++ b/nvim/.config/nvim/vim-plug/plugins.vim @@ -6,6 +6,7 @@ call plug#begin('~/.config/nvim/autoload/plugged') " Built-in LSP Plug 'neovim/nvim-lspconfig' Plug 'hrsh7th/nvim-compe' + Plug 'glepnir/lspsaga.nvim' " Treesitter Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'nvim-treesitter/playground' -- cgit v1.2.3