Feat: completion and full lua config

This commit is contained in:
Bertrand Benjamin 2021-09-19 14:32:12 +02:00
parent ea98f4be74
commit e95bbfd0ad
6 changed files with 51 additions and 13 deletions

View File

@ -41,7 +41,7 @@ local lsp_symbols = {
local cmp = require'cmp'
cmp.setup{
completion = {
completeopt = "menuone,noinsert,noselect",
completeopt = 'menuone,noselect',
},
formatting = {
format = function(entry, vim_item)
@ -86,9 +86,9 @@ cmp.setup{
end
end, { "i", "s" }),
},
source = {
{ name = 'buffer' },
sources = {
{ name = 'vsnip' },
{ name = 'buffer' },
{ name = 'path' },
{ name = 'spell' },
}

View File

@ -51,7 +51,7 @@ for _, lsp in ipairs(servers) do
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
}
},
}
end

View File

@ -0,0 +1,31 @@
require('lualine').setup{
options = {
icons_enabled = true,
theme = 'gruvbox',
component_separators = {'', ''},
section_separators = {'', ''},
disabled_filetypes = {}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch'},
lualine_c = {'filename'},
lualine_x = {
{ 'diagnostics', sources = {"nvim_lsp"}, symbols = {error = '', warn = '', info = '', hint = ''} },
'encoding',
'filetype'
},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
extensions = {}
}

View File

@ -20,3 +20,4 @@ map('n', '<leader>e', '<cmd>Telescope find_files<cr>', {})
map('n', '<leader>g', '<cmd>Telescope live_grep<cr>', {})
map('n', '<leader>b', '<cmd>Telescope buffers<cr>', {})
map('n', '<leader>h', '<cmd>Telescope help_tags<cr>', {})

View File

@ -48,22 +48,28 @@ return require('packer').startup(function()
use 'tpope/vim-surround'
use 'tpope/vim-repeat'
use 'neovim/nvim-lspconfig'
use {
"hrsh7th/nvim-cmp",
'neovim/nvim-lspconfig',
requires = {
"hrsh7th/cmp-nvim-lsp"
}
}
use {
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
config = [[require('completion')]],
requires = {
-- 'hrsh7th/vim-vsnip-integ',
'hrsh7th/vim-vsnip',
'rafamadriz/friendly-snippets',
},
}
use {"hrsh7th/vim-vsnip", after = "nvim-cmp"}
use {"hrsh7th/cmp-vsnip", after = "nvim-cmp"}
use {"hrsh7th/cmp-buffer", after = "nvim-cmp"}
use {'hrsh7th/cmp-path', after = "nvim-cmp"}
use {"hrsh7th/cmp-nvim-lsp", after = "nvim-cmp"}
use {'f3fora/cmp-spell', after = "nvim-cmp"}
use {'hrsh7th/cmp-vsnip', after = 'nvim-cmp'}
use {'hrsh7th/cmp-buffer', after = 'nvim-cmp'}
use {'hrsh7th/cmp-path', after = 'nvim-cmp'}
use {'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp'}
use {'f3fora/cmp-spell', after = 'nvim-cmp'}
use 'nvim-lua/popup.nvim'
use {

View File

@ -26,7 +26,7 @@ opt.cursorline = true -- highlight current line
opt.ignorecase = true -- Ignore case on search
opt.smartcase = true -- ignore lowercse for the whoel pattern
-- opt.completeopt = 'menu,noselect,noinsert' -- completion options
opt.completeopt = 'menuone,noselect,noinsert' -- completion options
opt.spell = true
opt.spelllang = {'fr', 'en'}