chore: format everything with stylua and update
This commit is contained in:
parent
473d78494e
commit
e90763e223
22 changed files with 273 additions and 222 deletions
|
@ -8,62 +8,64 @@ return {
|
|||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
-- 'hrsh7th/cmp-vsnip',
|
||||
-- 'hrsh7th/vim-vsnip',
|
||||
-- 'hrsh7th/vim-vsnip-integ',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'onsails/lspkind.nvim',
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"onsails/lspkind.nvim",
|
||||
{
|
||||
'zbirenbaum/copilot-cmp',
|
||||
dependencies = { "hrsh7th/nvim-cmp",
|
||||
"zbirenbaum/copilot-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
{
|
||||
'zbirenbaum/copilot.lua',
|
||||
"zbirenbaum/copilot.lua",
|
||||
opts = {
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
filetypes = {
|
||||
mail = false,
|
||||
text = false,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("copilot_cmp").setup()
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local lspkind = require('lspkind')
|
||||
local luasnip = require('luasnip')
|
||||
local cmp = require("cmp")
|
||||
local lspkind = require("lspkind")
|
||||
local luasnip = require("luasnip")
|
||||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
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
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
--vim.fn["vsnip#anonymous"](args.body)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<C-CR>'] = cmp.mapping.confirm({
|
||||
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
["<CR>"] = cmp.mapping({
|
||||
["<C-CR>"] = cmp.mapping({
|
||||
i = function(fallback)
|
||||
if cmp.visible() and cmp.get_active_entry() then
|
||||
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
|
||||
|
@ -98,20 +100,20 @@ return {
|
|||
end, { "i", "s" }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "copilot" },
|
||||
}, {
|
||||
{ name = 'buffer', option = { keyword_pattern = [[\k\+]] } },
|
||||
{ name = "buffer", option = { keyword_pattern = [[\k\+]] } },
|
||||
--{ name = 'path' },
|
||||
}),
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol_text', -- show only symbol annotations
|
||||
mode = "symbol_text", -- show only symbol annotations
|
||||
maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
ellipsis_char = "…", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
symbol_map = { Copilot = "" },
|
||||
})
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue