fix nvim
This commit is contained in:
parent
832502b1d5
commit
d1b587536e
@ -1,20 +1,27 @@
|
|||||||
local border_opts = {
|
local border_opts = {
|
||||||
border = "single",
|
border = "rounded",
|
||||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
|
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 function has_words_before()
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
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
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setup_cmp()
|
local function setup_cmp()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
|
preselect = cmp.PreselectMode.None,
|
||||||
|
completion = {
|
||||||
|
completeopt = 'menu,menuone,noinsert,noselect',
|
||||||
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
vim.snippet.expand(args.body)
|
vim.snippet.expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
@ -123,5 +130,8 @@ return {
|
|||||||
{
|
{
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
|
config = function()
|
||||||
|
vim.diagnostic.config({ virtual_text = true })
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user