diff --git a/.config/nvim/lua/init/plug_cmp.lua b/.config/nvim/lua/init/plug_cmp.lua index e0ea71f..8f5b25f 100644 --- a/.config/nvim/lua/init/plug_cmp.lua +++ b/.config/nvim/lua/init/plug_cmp.lua @@ -86,14 +86,6 @@ local function cmp_complete_snippet() } end -local function map(modes, func) - local res = {} - for _, mode in ipairs(modes) do - res[mode] = func - end - return res -end - cmp.setup { completion = { autocomplete = false, @@ -174,41 +166,6 @@ cmp.setup { }, } -cmp.setup.cmdline(':', { - mapping = vim.tbl_map(function(f) return map({'c'}, f) end, { - [''] = function(_fallback) - if cmp.visible() then - if #cmp.get_entries() == 1 then - cmp.confirm() - else - cmp_select_next() - end - else - cmp.complete() - end - end, - [''] = cmp_or(cmp_select_prev), - [''] = cmp_or(cmp_select_next), - [''] = cmp_or(cmp_select_prev), - [''] = cmp_or(cmp_select_next_page), - [''] = cmp_or(cmp_select_prev_page), - [''] = cmp_or(cmp.confirm), - [''] = cmp_or(cmp.abort), - [''] = cmp_or(cmp.confirm), - [''] = cmp_or(cmp_select_next), - [''] = cmp_or(cmp_select_prev), - }), - sources = cmp.config.sources({{ name = 'cmdline' }}), - ---@diagnostic disable-next-line: missing-fields - matching = { - disallow_symbol_nonprefix_matching = false, - }, - ---@diagnostic disable-next-line: missing-fields - formatting = { - fields = { 'abbr', 'menu' }, - }, -}) - cmp.event:on('menu_opened', function(data) -- start with an active entry -- work around https://github.com/hrsh7th/nvim-cmp/issues/835 diff --git a/.gitmodules b/.gitmodules index a3986cf..2359d14 100644 --- a/.gitmodules +++ b/.gitmodules @@ -132,9 +132,6 @@ path = .local/share/nvim/site/bundle/nvim-cmp # url = https://github.com/hrsh7th/nvim-cmp url = https://github.com/liskin/nvim-cmp -[submodule ".local/share/nvim/site/bundle/cmp-cmdline"] - path = .local/share/nvim/site/bundle/cmp-cmdline - url = https://github.com/hrsh7th/cmp-cmdline [submodule ".local/share/nvim/site/bundle/cmp-nvim-lsp"] path = .local/share/nvim/site/bundle/cmp-nvim-lsp url = https://github.com/hrsh7th/cmp-nvim-lsp diff --git a/.local/share/nvim/site/bundle/cmp-cmdline b/.local/share/nvim/site/bundle/cmp-cmdline deleted file mode 160000 index d250c63..0000000 --- a/.local/share/nvim/site/bundle/cmp-cmdline +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d250c63aa13ead745e3a40f61fdd3470efde3923 diff --git a/.vimrc b/.vimrc index dca4b2c..fb3087a 100644 --- a/.vimrc +++ b/.vimrc @@ -610,6 +610,19 @@ if !has('nvim') inoremap =LiskinShiftTabComplete() endif +" emulate vim's wildoptions=pum bindings in neovim {{{2 +if has('nvim') + cnoremap wildmenumode() ? "\" : "\" + cnoremap wildmenumode() ? "\" : "\" + cnoremap wildmenumode() ? "\" : "\" + cnoremap wildmenumode() ? "\" : "\" + + " also make it behave slightly more like ins-completion + set wildcharm= + cnoremap wildmenumode() ? "\" : "\" + cnoremap wildmenumode() ? "\" : "\" +endif + " cloning/closing tabs {{{2 nnoremap S :CloneBufTmp nnoremap C :tabclose