aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-03-18 19:43:21 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-03-18 19:43:21 +0300
commitcc241067a232abf432883120b7ed5bef800cf658 (patch)
tree82b9c5721f14ed7ab0ed6b36ef31b5fa6be28287
parent4278796a586e6908ffdb7d09701098a37aef4e10 (diff)
downloadvimrice-cc241067a232abf432883120b7ed5bef800cf658.tar.gz
vimrice-cc241067a232abf432883120b7ed5bef800cf658.zip
Check neovim version before loading LSP
Because I have Debian machines that use a really old version of neovim. Why do I keep using Debian on some machines?
-rw-r--r--dotfiles/.config/nvim/init.vim18
1 files changed, 11 insertions, 7 deletions
diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim
index b87ca26..68f376e 100644
--- a/dotfiles/.config/nvim/init.vim
+++ b/dotfiles/.config/nvim/init.vim
@@ -23,7 +23,9 @@ call plug#begin('~/.local/share/nvim/site/plugged')
Plug 'cespare/vim-toml'
Plug 'pangloss/vim-javascript'
Plug 'https://gitlab.com/HiPhish/info.vim'
- Plug 'neovim/nvim-lspconfig'
+ if has('nvim-0.6')
+ Plug 'neovim/nvim-lspconfig'
+ endif
call plug#end()
" Some basics:
@@ -218,12 +220,14 @@ call plug#end()
map <leader>g :Goyo<CR>
" LSP
- set omnifunc=v:lua.vim.lsp.omnifunc
- 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{}
+ if has('nvim-0.6')
+ set omnifunc=v:lua.vim.lsp.omnifunc
+ 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{}
+ endif
" LSP keybinds
nmap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>