@@ -9,7 +9,6 @@ call plug#begin()
99Plug ' SirVer/ultisnips' " snippet engine
1010Plug ' Valloric/MatchTagAlways' , { ' for' : [' html' , ' xhtml' , ' xml' , ' jinja' ] } " highlights surrounding html tag
1111Plug ' airblade/vim-gitgutter' " add support for viewing and editing git hunks
12- Plug ' autozimu/LanguageClient-neovim' , { ' branch' : ' next' , ' do' : ' npm install -g typescript-language-server && bash install.sh' }
1312Plug ' ctrlpvim/ctrlp.vim'
1413Plug ' edkolev/tmuxline.vim'
1514Plug ' ekalinin/Dockerfile.vim' " syntax + snippets for Dockerfile
@@ -40,6 +39,8 @@ Plug 'suy/vim-context-commentstring'
4039
4140" " Neovim plugins
4241Plug ' Shougo/deoplete.nvim' , Cond (has (' nvim' ), { ' do' : ' :UpdateRemotePlugins' })
42+ Plug ' deoplete-plugins/deoplete-lsp' , Cond (has (' nvim' ))
43+ Plug ' neovim/nvim-lspconfig' , Cond (has (' nvim-0.10' ))
4344Plug ' carlitux/deoplete-ternjs' , Cond (has (' nvim' ), {' do' : ' npm install -g tern@latest' , ' for' : [' javascript' , ' typescript' ]})
4445Plug ' w0rp/ale' , Cond (has (' nvim' ))
4546call plug#end ()
@@ -109,6 +110,12 @@ nnoremap <leader>z :tabnew %<CR>
109110nnoremap <leader> c ^lf(li<CR><ESC> $hf)i<CR><ESC>
110111imap jk <Esc>
111112iabbrev <expr> uuidgen system (' uuidgen' )[:-2 ]
113+ if has (' nvim' )
114+ nnoremap [d <cmd> lua vim.diagnostic.goto_prev()<CR>
115+ nnoremap ]d <cmd> lua vim.diagnostic.goto_next()<CR>
116+ autocmd CursorHold * lua vim .diagnostic.open_float (nil, { focusable = false })
117+ endif
118+
112119
113120" " Copy & Paste into sytem buffer
114121map <leader> y "+y
@@ -181,7 +188,6 @@ if has('nvim')
181188 call deoplete#custom#option (' num_processes' , 4 )
182189 call deoplete#custom#var (' file' , ' enable_buffer_path' , 1 )
183190 call deoplete#custom#source (' ultisnips' , ' rank' , 1000 )
184- call deoplete#custom#source (' tern' , ' rank' , 1100 ) " LanguageClient has rank of 1000
185191endif
186192
187193" " Airline Settings
@@ -210,20 +216,6 @@ set runtimepath+=~/dotfiles/vim " required b/c https
210216let g: UltiSnipsSnippetsDir= ' ~/dotfiles/vim/UltiSnips'
211217let g: UltiSnipsSnippetDirectories= [' ~/dotfiles/vim/UltiSnips' , ' UltiSnips' ]
212218
213- " " LanguageClient Settings
214- set hidden
215- let g: LanguageClient_autoStart = 1
216- let g: LanguageClient_diagnosticsList = " Location" " use Location list instead of window list as errors are scoped to one file
217-
218- " Minimal LSP configuration for JavaScript
219- let g: LanguageClient_serverCommands = {
220- \ ' javascript' : [' typescript-language-server --stdio' ],
221- \ ' javascript.jsx' : [' typescript-language-server --stdio' ],
222- \ ' typescript' : [' typescript-language-server --stdio' ],
223- \ }
224- autocmd FileType javascript.jsx setlocal omnifunc = LanguageClient#complete
225- nnoremap <F5> :call LanguageClient_contextMenu()<CR>
226-
227219" " ALE Settings
228220
229221" "" Lint Settings
@@ -339,3 +331,16 @@ fun! SetupCommandAlias(from, to)
339331 \ .' ? ("' .a: to .' ") : ("' .a: from .' "))'
340332endfun
341333call SetupCommandAlias (" W" ," w" )
334+
335+ if has (' nvim-0.10' )
336+ lua << EOF
337+ require' lspconfig' .svelte.setup{}
338+ require' lspconfig' .ts_ls.setup{}
339+ EOF
340+ endif
341+
342+ " LSP Keybindings
343+ " nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
344+ " nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
345+ " nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
346+ " nnoremap <silent> <leader>rn <cmd>lua vim.lsp.buf.rename()<CR>
0 commit comments