From d2bf2ed847e4d43032c2f65ed53302deeefc4399 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 10 Mar 2021 02:59:59 -0500 Subject: updates --- init.vim | 40 +++++++++++++++++++++------------------- lua/lsp/lua-ls.lua | 31 ++++++++++++++++++------------- plug-config/nvimtree-config.vim | 4 ++-- vim-plug/plugins.vim | 2 ++ 4 files changed, 43 insertions(+), 34 deletions(-) diff --git a/init.vim b/init.vim index 3cf40d62..df2ca5b2 100644 --- a/init.vim +++ b/init.vim @@ -68,6 +68,27 @@ else luafile ~/.config/nvim/lua/lsp/vim-ls.lua luafile ~/.config/nvim/lua/lsp/yaml-ls.lua " https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md + + " TODO highlight groups for native LSP diagnostics + " add back other docs for compe + nnoremap K lua require('lspsaga.hover').render_hover_doc() + + " -- scroll down hover doc or scroll in definition preview + nnoremap lua require('lspsaga.action').smart_scroll_with_saga(1) + " -- scroll up hover doc + nnoremap lua require('lspsaga.action').smart_scroll_with_saga(-1) + " signature + nnoremap gs lua require('lspsaga.signaturehelp').signature_help() + + + " Lightbulb + autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb() + + "TODO + " fix space and tab triggering completion all the time + " autoimport jsx + " snippets + " https://github.com/mfussenegger/nvim-jdtls endif source $HOME/.config/nvim/plug-config/quickscope.vim @@ -80,22 +101,3 @@ endif inoremap ("\") inoremap ("\") -" TODO highlight groups for native LSP diagnostics -" add back other docs for compe -nnoremap K lua require('lspsaga.hover').render_hover_doc() - -" -- scroll down hover doc or scroll in definition preview -nnoremap lua require('lspsaga.action').smart_scroll_with_saga(1) -" -- scroll up hover doc -nnoremap lua require('lspsaga.action').smart_scroll_with_saga(-1) -" signature -nnoremap gs lua require('lspsaga.signaturehelp').signature_help() - - -" Lightbulb -autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb() - -"TODO -" fix space and tab triggering completion all the time -" autoimport jsx -" snippets diff --git a/lua/lsp/lua-ls.lua b/lua/lsp/lua-ls.lua index 95e72216..22ffb529 100644 --- a/lua/lsp/lua-ls.lua +++ b/lua/lsp/lua-ls.lua @@ -1,20 +1,25 @@ -- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone) -- TODO fix for different systems and put variable for user --- local system_name --- if vim.fn.has("mac") == 1 then --- system_name = "macOS" --- elseif vim.fn.has("unix") == 1 then --- system_name = "Linux" --- elseif vim.fn.has('win32') == 1 then --- system_name = "Windows" --- else --- print("Unsupported system for sumneko") --- end +user="chris" --- set the path to the sumneko installation; if you previously installed via the now deprecated :LspInstall, use -local sumneko_root_path = "/Users/chris/.config/nvim/lua-language-server" -local sumneko_binary = "/Users/chris/.config/nvim/lua-language-server/bin/macOS/lua-language-server" +local sumneko_root_path = "" +local sumneko_binary = "" + +local system_name +if vim.fn.has("mac") == 1 then + sumneko_root_path = "/Users/"..user.."/.config/nvim/lua-language-server" + sumneko_binary = "/Users/"..user.."/.config/nvim/lua-language-server/bin/macOS/lua-language-server" +elseif vim.fn.has("unix") == 1 then + sumneko_root_path = "/home/"..user.."/.config/nvim/lua-language-server" + sumneko_binary = "/home/"..user.."/.config/nvim/lua-language-server/bin/Linux/lua-language-server" +elseif vim.fn.has('win32') == 1 then + -- sumneko_root_path = "/Users/chris/.config/nvim/lua-language-server" + -- sumneko_binary = "/Users/chris/.config/nvim/lua-language-server/bin/macOS/lua-language-server" + print("Unsupported system for me") +else + print("Unsupported system for sumneko") +end require'lspconfig'.sumneko_lua.setup { cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}; diff --git a/plug-config/nvimtree-config.vim b/plug-config/nvimtree-config.vim index 34e98991..3371d284 100644 --- a/plug-config/nvimtree-config.vim +++ b/plug-config/nvimtree-config.vim @@ -12,8 +12,8 @@ let g:nvim_tree_git_hl = 1 "0 by default, will enable file highlight for git att " let g:nvim_tree_root_folder_modifier = ':~' "This is the default. See :help filename-modifiers for more options " let g:nvim_tree_tab_open = 1 "0 by default, will open the tree when entering a new tab and the tree was previously open " let g:nvim_tree_width_allow_resize = 1 "0 by default, will not resize the tree when opening a file -let g:nvim_tree_disable_netrw = 1 "1 by default, disables netrw -let g:nvim_tree_hijack_netrw = 1 "1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities) +let g:nvim_tree_disable_netrw = 0 "1 by default, disables netrw +let g:nvim_tree_hijack_netrw = 0 "1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities) let g:nvim_tree_show_icons = { \ 'git': 1, \ 'folders': 1, diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index 4ca5f710..cba8d2f3 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -74,6 +74,8 @@ call plug#begin('~/.config/nvim/autoload/plugged') Plug 'glepnir/lspsaga.nvim' Plug 'onsails/lspkind-nvim' Plug 'kosayoda/nvim-lightbulb' + Plug 'mfussenegger/nvim-jdtls' + Plug 'mfussenegger/nvim-dap' " File Explorer Plug 'kyazdani42/nvim-tree.lua' -- cgit v1.2.3