From 12be176eccd4819c4cbe5fd5b6134b873ee26b18 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Tue, 31 May 2022 14:40:18 +0200 Subject: [PATCH] neovim: Fix compatibility with newer plugin versions --- users/simon/modules/neovim/init.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/users/simon/modules/neovim/init.lua b/users/simon/modules/neovim/init.lua index 7831ee6..a36bdb2 100644 --- a/users/simon/modules/neovim/init.lua +++ b/users/simon/modules/neovim/init.lua @@ -147,7 +147,7 @@ cmp.setup { snippet = { expand = function(args) luasnip.lsp_expand(args.body) end, }, - mapping = { + mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), [''] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }), @@ -174,7 +174,7 @@ cmp.setup { fallback() end end, { 'i', 's' }), - }, + }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'luasnip' }, @@ -182,7 +182,7 @@ cmp.setup { }, { { name = 'buffer', - opts = { + option = { keyword_pattern = [[\k\+]], -- allow unicode multibyte characters }, } @@ -202,9 +202,8 @@ vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagn update_in_insert = true, -- update suggestions in insert mode }) -for type, icon in pairs({ Error = ' ', Warning = ' ', Hint = ' ', Information = ' ' }) do - local hl = 'LspDiagnosticsSign' .. type - fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) +for type, icon in pairs({ Error = ' ', Warn = ' ', Hint = ' ', Info = ' ' }) do + fn.sign_define("DiagnosticSign" .. type, { text = icon, texthl = "Diagnostic" .. type }) end local on_attach = function(client, bufnr)