dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

commit 062851f08a5be30c0ecb797992a7d1fd000fbd1c
parent 61af0cb095e349cd567d995e912341656f5d5d4b
Author: Chris Bracken <chris@bracken.jp>
Date:   Mon, 26 Aug 2024 21:01:13 -0700

vim: use cmp for completion in general

Initially, I'd configured this to use <C-Space> and do regular
OmniComplete for <C-n> and <C-p> but if I'm going to use cmp, I may as
well use it all the time.

Diffstat:
M.config/nvim/lua/plugins/languages.lua | 16----------------
1 file changed, 0 insertions(+), 16 deletions(-)

diff --git a/.config/nvim/lua/plugins/languages.lua b/.config/nvim/lua/plugins/languages.lua @@ -13,18 +13,6 @@ return { config = function() local lspkind = require("lspkind") local cmp = require("cmp") - - -- Only override <C-n>, <C-p> if the cmp menu is visible. - local function custom_select(select_fn) - return cmp.mapping(function(fallback) - if cmp.visible() then - select_fn() - else - fallback() - end - end, { 'i', 'c' }) - end - cmp.setup({ completion = { autocomplete = false, @@ -39,11 +27,7 @@ return { ['<C-j>'] = cmp.mapping.select_next_item(), ['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-f>'] = cmp.mapping.scroll_docs(4), - ['<C-Space>'] = cmp.mapping.complete(), - ['<C-e>'] = cmp.mapping.abort(), ['<CR>'] = cmp.mapping.confirm({ select = true }), - ['<C-n>'] = custom_select(cmp.select_next_item), - ['<C-p>'] = custom_select(cmp.select_prev_item), }), sources = cmp.config.sources({ { name = "nvim_lsp" },