From 7e86db99b40aa92b290b106a4875b5cc25c2a8e3 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Sat, 9 Dec 2023 23:26:16 +0300 Subject: Fixed typoo in common.luad (mappings -> mapping) --- .config/nvim/lua/user/lsp/common.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '.config/nvim/lua/user/lsp/common.lua') diff --git a/.config/nvim/lua/user/lsp/common.lua b/.config/nvim/lua/user/lsp/common.lua index 032cb7f..acc3a64 100644 --- a/.config/nvim/lua/user/lsp/common.lua +++ b/.config/nvim/lua/user/lsp/common.lua @@ -11,6 +11,7 @@ luasnip.setup() local expnoresilent = {expr = true, noremap = true, silent = true} local noresilent = {noremap = true, silent = true} +local map = cmp.mapping -- stolen from https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance local kind_icons = { @@ -36,14 +37,18 @@ local stolen_function = function() -- to check whether there are words before cu return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil end --- TODO: Finish cmp.setup { snippet = { expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- for vsnip (i left it) + -- vim.fn["vsnip#anonymous"](args.body) -- for vsnip (i left it) luasnip.lsp_expand(args.body) -- for luasnip cause i like it more end, }, + mapping = { + [""] = map.select_next_item(), + [""] = map(map.select_prev_item({ behavior = cmp.SelectBehavior.Insert })), + [""] = map.complete(), + }, -- NOTE: ordering or this table affects completions ordering sources = { -- TODO: Add keyword_length to some of them ?????? { name = 'nvim_lsp' }, -- cgit v1.2.3-70-g09d2