diff options
Diffstat (limited to '.config/nvim/lua')
| -rw-r--r-- | .config/nvim/lua/plugins/completions.lua | 60 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/marks.lua | 3 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/rustaceanvim.lua | 2 |
3 files changed, 63 insertions, 2 deletions
diff --git a/.config/nvim/lua/plugins/completions.lua b/.config/nvim/lua/plugins/completions.lua new file mode 100644 index 0000000..d994357 --- /dev/null +++ b/.config/nvim/lua/plugins/completions.lua @@ -0,0 +1,60 @@ +-- Autocompletions +-- https://github.com/hrsh7th/nvim-cmp +-- https://github.com/L3MON4D3/LuaSnip +-- https://github.com/saadparwaiz1/cmp_luasnip +-- https://github.com/rafamadriz/friendly-snippets +-- https://github.com/hrsh7th/cmp-nvim-lsp + +vim.pack.add({ + { + src = "https://github.com/hrsh7th/cmp-nvim-lsp", + version = "main", + }, + { + src = "https://github.com/L3MON4D3/LuaSnip", + version = "master", + }, + { + src = "https://github.com/saadparwaiz1/cmp_luasnip", + version = "master", + }, + { + src = "https://github.com/rafamadriz/friendly-snippets", + version = "main", + }, + { + src = "https://github.com/hrsh7th/nvim-cmp", + version = "main", + lazy = "false", + }, +}) + +local cmp = require'cmp' +require("luasnip.loaders.from_vscode").lazy_load() + +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({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-Space>'] = cmp.mapping.complete(), + ['<C-e>'] = cmp.mapping.abort(), + ['<CR>'] = cmp.mapping.confirm({ select = true }), + ['<C-j>'] = cmp.mapping.select_next_item(), + ['<C-k>'] = cmp.mapping.select_prev_item(), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, { + { name = 'buffer' }, + }) +}) diff --git a/.config/nvim/lua/plugins/marks.lua b/.config/nvim/lua/plugins/marks.lua index 841d390..e9a273d 100644 --- a/.config/nvim/lua/plugins/marks.lua +++ b/.config/nvim/lua/plugins/marks.lua @@ -1,7 +1,8 @@ vim.pack.add({ { src = 'https://github.com/chentoast/marks.nvim.git', - version = 'main', + version = 'master', + lazy = false, }, }) diff --git a/.config/nvim/lua/plugins/rustaceanvim.lua b/.config/nvim/lua/plugins/rustaceanvim.lua index dee1dc1..72e18d2 100644 --- a/.config/nvim/lua/plugins/rustaceanvim.lua +++ b/.config/nvim/lua/plugins/rustaceanvim.lua @@ -1,7 +1,7 @@ vim.pack.add({ { src = 'https://github.com/mrcjkb/rustaceanvim.git', - version = 'master', + version = 'main', lazy = false, -- This plugin is already lazy }, }) |
