diff options
Diffstat (limited to 'lua/plugins')
-rw-r--r-- | lua/plugins/autocompletion.lua | 37 | ||||
-rw-r--r-- | lua/plugins/lualine.lua | 6 |
2 files changed, 25 insertions, 18 deletions
diff --git a/lua/plugins/autocompletion.lua b/lua/plugins/autocompletion.lua index 1ba7ead..0da6e16 100644 --- a/lua/plugins/autocompletion.lua +++ b/lua/plugins/autocompletion.lua @@ -1,36 +1,40 @@ return { 'hrsh7th/nvim-cmp', dependencies = { + 'neovim/nvim-lspconfig', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-nvim-lua', -- Snippet Engine & its associated nvim-cmp source - { 'L3MON4D3/LuaSnip', opts = {} }, + { 'L3MON4D3/LuaSnip', + dependencies = 'rafamadriz/friendly-snippets', + }, 'saadparwaiz1/cmp_luasnip', - -- Adds LSP completion capabilities - 'hrsh7th/cmp-nvim-lsp', - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', }, config = function() local cmp = require('cmp') local luasnip = require('luasnip') require('luasnip.loaders.from_vscode').lazy_load() - -- luasnip.config.setup {} + luasnip.config.setup({}) - cmp.setup { + cmp.setup({ snippet = { expand = function(args) luasnip.lsp_expand(args.body) end, }, - mapping = cmp.mapping.preset.insert { + mapping = cmp.mapping.preset.insert({ ['<C-n>'] = cmp.mapping.select_next_item(), ['<C-p>'] = cmp.mapping.select_prev_item(), ['<C-d>'] = cmp.mapping.scroll_docs(-4), ['<C-f>'] = cmp.mapping.scroll_docs(4), - ['<C-Space>'] = cmp.mapping.complete {}, - ['<CR>'] = cmp.mapping.confirm { + ['<C-Space>'] = cmp.mapping.complete(), + ['<CR>'] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, - }, + }), ['<Tab>'] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() @@ -49,11 +53,14 @@ return { fallback() end end, { 'i', 's' }), - }, - sources = { + }), + sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'luasnip' }, - }, - } + { name = 'nvim_lua' }, + { name = 'path' }, + { name = 'buffer' }, + }), + }) end, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index a90a94c..be54a4f 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -2,10 +2,10 @@ return { 'nvim-lualine/lualine.nvim', opts = { options = { - icons_enabled = false, + icons_enabled = true, theme = 'dracula-nvim', - component_separators = '|', - section_separators = '', + -- component_separators = '|', + -- section_separators = '', }, }, } |