diff options
| author | Jean-Pierre Appel <jeanpierre.appel01@gmail.com> | 2023-10-03 12:29:38 -0400 |
|---|---|---|
| committer | Jean-Pierre Appel <jeanpierre.appel01@gmail.com> | 2023-10-03 12:29:38 -0400 |
| commit | aac2ce8f3070711768295ecc7876bb86ca55877a (patch) | |
| tree | 4e9de07c91c6273bfde7d074622eb6c115543e13 /nvim/lua/plugins | |
| parent | 2ca0bea095e4f29a7a4673a09fec23c65041877a (diff) | |
changed completion menu apperance, added dynamic find reference bind
Diffstat (limited to 'nvim/lua/plugins')
| -rw-r--r-- | nvim/lua/plugins/nvim-cmp.lua | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/nvim/lua/plugins/nvim-cmp.lua b/nvim/lua/plugins/nvim-cmp.lua index 907ba2e..32285bf 100644 --- a/nvim/lua/plugins/nvim-cmp.lua +++ b/nvim/lua/plugins/nvim-cmp.lua @@ -2,6 +2,8 @@ local Plugins = {} +-- FIXME: plugin not loading correctly + -- Autocompletion local cmp_plugin = { 'hrsh7th/nvim-cmp', @@ -25,8 +27,8 @@ table.insert(Plugins, cmp_plugin) table.insert(Plugins, { 'aspeddro/cmp-pandoc.nvim', - enabled = false, - event = 'InsertEnter', + enabled = true, + -- event = 'InsertEnter', ft = {'markdown', 'pandoc', 'rmd'}, dependencies = { 'nvim-lua/plenary.nvim', @@ -39,7 +41,7 @@ table.insert(Plugins, { } }) -function cmp_plugin.config() +cmp_plugin.config = function() user.augroup = vim.api.nvim_create_augroup('compe_cmds', {clear = true}) vim.api.nvim_create_user_command('UserCmpEnable', user.enable_cmd, {}) @@ -80,21 +82,22 @@ function cmp_plugin.config() zindex = 50, } }, - -- formatting = { - -- fields = {'menu', 'abbr', 'kind'}, - -- format = function(entry, item) - -- local menu_icon = { - -- nvim_lsp = 'λ', - -- luasnip = '⋗', - -- buffer = 'Ω', - -- path = '🖫', - -- nvim_lua = 'Π', - -- } - -- - -- item.menu = menu_icon[entry.source.name] - -- return item - -- end, - -- }, + formatting = { + fields = {'menu', 'abbr', 'kind'}, + format = function(entry, item) + local menu = { + nvim_lsp = '[LSP]', + luasnip = '[Snip]', + buffer = '[Buffer]', + path = '[Path]', + nvim_lua = '[Lua]', + cmp_pandoc = '[Pandoc]' + } + + item.menu = menu[entry.source.name] + return item + end, + }, mapping = { ['<C-k>'] = cmp.mapping.scroll_docs(-5), ['<C-j>'] = cmp.mapping.scroll_docs(5), |
