This commit is contained in:
thek4n 2025-04-07 14:40:09 +03:00
parent 832502b1d5
commit d1b587536e
2 changed files with 16 additions and 6 deletions

View File

@ -1,20 +1,27 @@
local border_opts = {
border = "single",
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
border = "rounded",
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
max_width = 50,
min_width = 50,
max_height = math.floor(vim.o.lines * 0.4),
min_height = 3,
}
local function has_words_before()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local function setup_cmp()
local cmp = require("cmp")
cmp.setup({
preselect = cmp.PreselectMode.None,
completion = {
completeopt = 'menu,menuone,noinsert,noselect',
},
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
vim.snippet.expand(args.body)
end,
},
@ -123,5 +130,8 @@ return {
{
'neovim/nvim-lspconfig',
event = "InsertEnter",
config = function()
vim.diagnostic.config({ virtual_text = true })
end,
},
}