aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-01-25 04:22:19 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-01-25 04:22:19 +0300
commit78ac9ac39134e59a337085c6c8477643c6c9ef12 (patch)
tree685ae58056e5092c70436953eed7478004bc2d33
parent2c3e521d6f56abf4cc0a50608f86a32ac3e34676 (diff)
downloadvimrice-78ac9ac39134e59a337085c6c8477643c6c9ef12.tar.gz
vimrice-78ac9ac39134e59a337085c6c8477643c6c9ef12.zip
Use neovim's own lsp server
-rw-r--r--dotfiles/.config/nvim/init.vim35
1 files changed, 16 insertions, 19 deletions
diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim
index a58a0e1..616df31 100644
--- a/dotfiles/.config/nvim/init.vim
+++ b/dotfiles/.config/nvim/init.vim
@@ -24,10 +24,7 @@ call plug#begin('~/.local/share/nvim/site/plugged')
Plug 'xavierd/clang_complete'
Plug 'pangloss/vim-javascript'
Plug 'https://gitlab.com/HiPhish/info.vim'
- Plug 'autozimu/LanguageClient-neovim', {
- \ 'branch': 'next',
- \ 'do': 'bash install.sh',
- \ }
+ Plug 'neovim/nvim-lspconfig'
call plug#end()
" Some basics:
@@ -36,6 +33,7 @@ call plug#end()
syntax on
set foldmethod=syntax
set omnifunc=syntaxcomplete#Complete
+ set omnifunc=v:lua.vim.lsp.omnifunc
set guicursor=n-v-sm:block,i-ci-c-ve:ver25,r-cr-o:block
set cursorline
set redrawtime=1000
@@ -217,25 +215,24 @@ call plug#end()
" Tagbar
map <F3> :TagbarToggle<CR>
-" LSP
- let g:LanguageClient_serverCommands = {
- \ 'c': ['/usr/bin/clangd', '--cross-file-rename'],
- \ 'ch': ['/usr/bin/clangd', '--cross-file-rename'],
- \ 'go': ['/usr/bin/gopls'],
- \ 'cpp': ['/usr/bin/clangd', '--cross-file-rename'],
- \ 'python': ['/usr/bin/pyls'],
- \ 'rust': ['/usr/bin/rustup', 'run', 'stable', 'rls'],
- \ 'javascript': ['/usr/bin/typescript-language-server', '--stdio'],
- \ }
-
-" LanguageClient-neovim
- nmap <leader>m <Plug>(lcn-menu)
- nmap <silent> gd <Plug>(lcn-definition)
-
" Goyo
let g:goyo_width = 100
map <leader>g :Goyo<CR>
+" LSP
+ lua require('lspconfig').clangd.setup{filetypes = { "c", "cpp", "objc", "objcpp", "ch" }}
+ lua require('lspconfig').gopls.setup{}
+ lua require('lspconfig').pylsp.setup{}
+ lua require('lspconfig').rls.setup{}
+ lua require('lspconfig').tsserver.setup{}
+
+" LSP keybinds
+ nmap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
+ nmap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>
+ nmap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
+ nmap <silent> <leader>n <cmd>lua vim.lsp.buf.rename()<CR>
+ nmap <silent> <leader>b <cmd>lua vim.lsp.buf.formatting()<CR>
+
" File format preferences
autocmd FileType rust setlocal noet ci pi sts=0 ts=4 sw=4 tw=80
autocmd FileType meson setlocal noet ci pi sts=0 ts=4 sw=4 tw=80