From c35067aa197500f78693091873acd15994355685 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Tue, 9 Apr 2024 01:00:18 +0200 Subject: nvim plugins --- nvim/lua/plugins/completion.lua | 25 +++++++++++++++++++++---- nvim/lua/plugins/hardline.lua | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 4d46317..1a4ef7a 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -2,30 +2,47 @@ return { { "hrsh7th/nvim-cmp", dependencies = { - 'neovim/nvim-lspconfig', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline' + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-vsnip', + 'hrsh7th/vim-vsnip' }, config = function() local cmp = require'cmp' cmp.setup { snippet = { - expand = function() - vim.snippet.expand(args.body) + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, + { name = 'vsnip' }, },{ { name = 'buffer' }, }) } end, + },{ + 'neovim/nvim-lspconfig', + config = function() + local lspconfig = require('lspconfig') + + lspconfig.rust_analyzer.setup {} + lspconfig.pyright.setup {} + lspconfig.clangd.setup {} + end, + }, } diff --git a/nvim/lua/plugins/hardline.lua b/nvim/lua/plugins/hardline.lua index d756f79..53d0ee8 100644 --- a/nvim/lua/plugins/hardline.lua +++ b/nvim/lua/plugins/hardline.lua @@ -3,6 +3,7 @@ return { "ojroques/nvim-hardline", config = function() require("hardline").setup { + bufferline = true, } end, } -- cgit v1.2.3