From cc241067a232abf432883120b7ed5bef800cf658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Fri, 18 Mar 2022 19:43:21 +0300 Subject: 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? --- dotfiles/.config/nvim/init.vim | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'dotfiles/.config/nvim') 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 g :Goyo " 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 gd lua vim.lsp.buf.definition() -- cgit v1.2.3