Chris 4 years ago
parent
commit
d2bf2ed847
4 changed files with 43 additions and 34 deletions
  1. 21 19
      init.vim
  2. 18 13
      lua/lsp/lua-ls.lua
  3. 2 2
      plug-config/nvimtree-config.vim
  4. 2 0
      vim-plug/plugins.vim

+ 21 - 19
init.vim

@@ -68,6 +68,27 @@ else
   luafile ~/.config/nvim/lua/lsp/vim-ls.lua
   luafile ~/.config/nvim/lua/lsp/vim-ls.lua
   luafile ~/.config/nvim/lua/lsp/yaml-ls.lua
   luafile ~/.config/nvim/lua/lsp/yaml-ls.lua
   " https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md
   " https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md
+
+  " TODO highlight groups for native LSP diagnostics
+  " add back other docs for compe
+  nnoremap <silent> K <cmd>lua require('lspsaga.hover').render_hover_doc()<CR>
+
+  " -- scroll down hover doc or scroll in definition preview
+  nnoremap <silent> <C-f> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>
+  " -- scroll up hover doc
+  nnoremap <silent> <C-b> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>
+  " signature
+  nnoremap <silent> gs <cmd>lua require('lspsaga.signaturehelp').signature_help()<CR>
+
+
+  " 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
 endif
 source $HOME/.config/nvim/plug-config/quickscope.vim
 source $HOME/.config/nvim/plug-config/quickscope.vim
 
 
@@ -80,22 +101,3 @@ endif
 inoremap <expr> <c-j> ("\<C-n>")
 inoremap <expr> <c-j> ("\<C-n>")
 inoremap <expr> <c-k> ("\<C-p>")
 inoremap <expr> <c-k> ("\<C-p>")
 
 
-" TODO highlight groups for native LSP diagnostics
-" add back other docs for compe
-nnoremap <silent> K <cmd>lua require('lspsaga.hover').render_hover_doc()<CR>
-
-" -- scroll down hover doc or scroll in definition preview
-nnoremap <silent> <C-f> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>
-" -- scroll up hover doc
-nnoremap <silent> <C-b> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>
-" signature
-nnoremap <silent> gs <cmd>lua require('lspsaga.signaturehelp').signature_help()<CR>
-
-
-" Lightbulb
-autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()
-        
-"TODO
-" fix space and tab triggering completion all the time
-" autoimport jsx
-" snippets

+ 18 - 13
lua/lsp/lua-ls.lua

@@ -1,20 +1,25 @@
 -- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)
 -- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)
 -- TODO fix for different systems and put variable for user
 -- 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 {
 require'lspconfig'.sumneko_lua.setup {
   cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
   cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};

+ 2 - 2
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_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_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_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 = {
 let g:nvim_tree_show_icons = {
     \ 'git': 1,
     \ 'git': 1,
     \ 'folders': 1,
     \ 'folders': 1,

+ 2 - 0
vim-plug/plugins.vim

@@ -74,6 +74,8 @@ call plug#begin('~/.config/nvim/autoload/plugged')
     Plug 'glepnir/lspsaga.nvim'
     Plug 'glepnir/lspsaga.nvim'
     Plug 'onsails/lspkind-nvim'
     Plug 'onsails/lspkind-nvim'
     Plug 'kosayoda/nvim-lightbulb'
     Plug 'kosayoda/nvim-lightbulb'
+    Plug 'mfussenegger/nvim-jdtls'
+    Plug 'mfussenegger/nvim-dap'
     " File Explorer
     " File Explorer
     Plug 'kyazdani42/nvim-tree.lua'
     Plug 'kyazdani42/nvim-tree.lua'