From ef6dff4cce15186a66ba34cdd7bd39958ebf7f58 Mon Sep 17 00:00:00 2001 From: awy Date: Tue, 29 Jul 2025 03:42:18 +0300 Subject: first commit --- .config/nvim/lua/plugins/completions.lua | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .config/nvim/lua/plugins/completions.lua (limited to '.config/nvim/lua/plugins/completions.lua') diff --git a/.config/nvim/lua/plugins/completions.lua b/.config/nvim/lua/plugins/completions.lua new file mode 100644 index 0000000..ff8fd40 --- /dev/null +++ b/.config/nvim/lua/plugins/completions.lua @@ -0,0 +1,42 @@ +return { + { + "hrsh7th/cmp-nvim-lsp" + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets" + } + }, + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require'cmp' + cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + 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 }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, { + { name = 'buffer' }, + }) + }) + end + } +} -- cgit v1.2.3