# HG changeset patch # User zegervdv # Date 1612459659 -3600 # Node ID d717168f424f827a5600253512118681fbf3961c # Parent 9360c61c57321cbf8f4f0b9691d7069eff5d9ef4 Switch to nvim-compe for completion diff -r 9360c61c5732 -r d717168f424f dot_config/nvim/config.lua --- a/dot_config/nvim/config.lua Thu Feb 04 18:14:28 2021 +0100 +++ b/dot_config/nvim/config.lua Thu Feb 04 18:27:39 2021 +0100 @@ -85,8 +85,39 @@ -- Completion/snippets/LSP use {'neovim/nvim-lspconfig'} use { - 'nvim-lua/completion-nvim', - 'steelsojka/completion-buffers' + 'hrsh7th/nvim-compe', + config = function () + require'compe'.setup { + enabled = true; + autocomplete = true; + debug = false; + min_length = 1; + preselect = 'enable'; + throttle_time = 80; + source_timeout = 200; + incomplete_delay = 400; + max_abbr_width = 100; + max_kind_width = 100; + max_menu_width = 100; + + source = { + path = true; + buffer = true; + calc = true; + -- vsnip = true; + nvim_lsp = true; + -- nvim_lua = true; + spell = true; + ultisnips = true; + -- tags = true; + -- snippets_nvim = true; + }; + } + + vim.cmd [[ inoremap compe#complete() ]] + vim.cmd [[ inoremap compe#confirm({ 'keys': "\delimitMateCR", 'mode': '' }) ]] + vim.cmd [[ inoremap compe#close('') ]] + end } use { 'nvim-treesitter/nvim-treesitter', @@ -268,12 +299,6 @@ end local on_attach = function(client) - require'completion'.on_attach({ - sorting = 'alphabet', - matching_strategy_list = {'exact', 'fuzzy'}, - chain_complete_list = chain_complete_list, - }) - mapper('n', '', 'lua vim.lsp.diagnostic.show_line_diagnostics({show_header=false})') mapper('n', 'gd', 'lua vim.lsp.buf.declaration()') mapper('n', '', 'lua vim.lsp.buf.definition()') @@ -286,9 +311,6 @@ mapper('i', '', 'lua vim.lsp.buf.signature_help()') mapper('n', 'f', 'lua vim.lsp.buf.code_action()') mapper('n', '', 'lua vim.lsp.buf.formatting()') - mapper("i", "", "(completion_trigger)", false) - mapper("i", "", "(completion_next_source)", false) - mapper("i", "", "(completion_prev_source)", false) mapper("n", "gp", "lua peek_definition()") -- mapper("n", "gp", "lua require'lspsaga.provider'.preview_definition()") end