commandline brokwn

This commit is contained in:
Dmitri 2025-06-13 14:06:47 +02:00
parent dbf032ad7c
commit c9b61be4fc
Signed by: kanopo
GPG Key ID: 759ADD40E3132AC7
3 changed files with 14 additions and 58 deletions

View File

@ -1,54 +1,18 @@
return { return {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
event = "InsertEnter", event = { "InsertEnter" },
dependencies = { dependencies = {
{ "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer",
event = "InsertEnter", "hrsh7th/cmp-path",
}, "saadparwaiz1/cmp_luasnip",
{
"hrsh7th/cmp-buffer",
event = "InsertEnter",
},
{
"hrsh7th/cmp-path",
event = "InsertEnter",
},
{
"saadparwaiz1/cmp_luasnip",
event = "InsertEnter",
},
{ {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
event = "InsertEnter",
dependencies = { dependencies = {
"rafamadriz/friendly-snippets", "rafamadriz/friendly-snippets",
}, },
}, },
{ "onsails/lspkind-nvim",
"onsails/lspkind-nvim",
event = "InsertEnter",
},
-- {
-- "zbirenbaum/copilot.lua",
-- cmd = "Copilot",
-- event = "InsertEnter",
-- config = function()
-- require("copilot").setup({
-- suggestion = { enabled = false },
-- panel = { enabled = false },
-- })
-- end,
-- },
-- {
-- "zbirenbaum/copilot-cmp",
-- config = function()
-- require("copilot_cmp").setup({
-- event = { "InsertEnter", "LspAttach" },
-- fix_pairs = true,
-- })
-- end
-- }
}, },
config = function() config = function()
local cmp = require("cmp") local cmp = require("cmp")
@ -61,14 +25,20 @@ return {
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
end end
-- La tua configurazione esistente per la INSERT MODE rimane invariata
cmp.setup({ cmp.setup({
performance = { performance = {
debounce = 10, debounce = 10,
throttle = 10, throttle = 10,
max_view_entries = 10,
async_budget = 500,
fetching_timeout = 1000,
confirm_resolve_timeout = 2000,
filtering_context_budget = 200,
}, },
snippet = { snippet = {
expand = function(args) expand = function(args)
luasnip.lsp_expand(args.body) -- For `luasnip` users. luasnip.lsp_expand(args.body)
end, end,
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
@ -118,11 +88,9 @@ return {
maxwidth = 50, maxwidth = 50,
ellipsis = "...", ellipsis = "...",
show_labelDetails = true, show_labelDetails = true,
symbol_map = { Copilot = "" }
}), }),
}, },
sources = { sources = {
-- { name = "copilot", group_index = 2 },
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "luasnip" }, { name = "luasnip" },
{ name = "buffer" }, { name = "buffer" },

View File

@ -1,12 +0,0 @@
return {
"VonHeikemen/fine-cmdline.nvim",
dependencies = {
{ "MunifTanjim/nui.nvim" },
},
config = function()
vim.o.cmdheight = 0
vim.api.nvim_set_keymap("n", ":", "<cmd>FineCmdline<CR>", { noremap = true })
require("fine-cmdline").setup({})
end,
}

View File

@ -28,7 +28,7 @@ local on_attach = function(_, bufnr)
map("<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", "[R]ename Symbol") map("<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", "[R]ename Symbol")
map("<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", "[C]ode [A]ction") map("<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", "[C]ode [A]ction")
map("K", "<cmd>lua vim.lsp.buf.hover()<CR>", "[K] Hover") map("K", "<cmd>lua vim.lsp.buf.hover()<CR>", "[K] Hover")
map("<leader>e", "<cmd>lua vim.diagnostic.open_float()<CR>", "[E]xplain Diagnostic") map("<leader>d", "<cmd>lua vim.diagnostic.open_float()<CR>", "[E]xplain Diagnostic")
map("gd", telescope.lsp_definitions, "[G]o [D]efinition") map("gd", telescope.lsp_definitions, "[G]o [D]efinition")
map("gr", telescope.lsp_references, "[G]o [R]eferences") map("gr", telescope.lsp_references, "[G]o [R]eferences")
map("gI", telescope.lsp_implementations, "[G]o [I]mplementations") map("gI", telescope.lsp_implementations, "[G]o [I]mplementations")