From b7b49d1bbe87af893c0a1e84143b1a3277fb9bd4 Mon Sep 17 00:00:00 2001 From: venomade Date: Fri, 28 Feb 2025 16:55:04 +0000 Subject: Add neovim-colemak --- neovim-colemak/lua/config/cmp.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 neovim-colemak/lua/config/cmp.lua (limited to 'neovim-colemak/lua/config/cmp.lua') diff --git a/neovim-colemak/lua/config/cmp.lua b/neovim-colemak/lua/config/cmp.lua new file mode 100644 index 0000000..13ca020 --- /dev/null +++ b/neovim-colemak/lua/config/cmp.lua @@ -0,0 +1,30 @@ +vim.opt.completeopt={"menu", "menuone", "noselect"} + +local cmp = require'cmp' + +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'path' }, + { name = 'luasnip' }, -- For luasnip users. + }, { + { name = 'buffer' }, + }) +}) -- cgit 1.4.1-2-gfad0