Skip to content

Commit

Permalink
fix: cmdline
Browse files Browse the repository at this point in the history
  • Loading branch information
ADGEfficiency committed Jan 29, 2025
1 parent 02976d4 commit 1fc7fbe
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 34 deletions.
2 changes: 1 addition & 1 deletion nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"barbar.nvim": { "branch": "master", "commit": "c20691d686addb0d6ea87896d186c082324b01f8" },
"blink-emoji.nvim": { "branch": "master", "commit": "699493775b61b94ead76841c981a51d3df350ea0" },
"blink-ripgrep.nvim": { "branch": "main", "commit": "8a47d404a359c70c796cb0979ddde4c788fd44e5" },
"blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" },
"blink.cmp": { "branch": "main", "commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3" },
"blink.compat": { "branch": "main", "commit": "78f3f7187ff4a1444e952548c556d936da8f72fc" },
"bullets.vim": { "branch": "master", "commit": "2253f970e54320dbd76fd6bb4f5a0bf2436ce232" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
Expand Down
10 changes: 8 additions & 2 deletions nvim/lua/plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ return {
keymap = { preset = "enter" },

completion = {
list = { selection = "auto_insert" },
list = {
selection = { auto_insert = true, preselect = false },
},
menu = {
cmdline_position = function()
local Api = require("noice.api")
local pos = Api.get_cmdline_position()
return { pos.screenpos.row, pos.screenpos.col }
end,
border = "single",
auto_show = function()
return vim.bo.buftype ~= "prompt"
Expand Down Expand Up @@ -72,7 +79,6 @@ return {
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { "path", "lsp", "snippets", "buffer", "ripgrep", "emoji" },
cmdline = {},
providers = {
buffer = {
name = "buffer",
Expand Down
62 changes: 31 additions & 31 deletions nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,37 +53,37 @@ return {
end,
})

-- cmp commandline
local cmp = require("cmp")
local lspkind = require("lspkind")
cmp.setup.cmdline(":", {
sources = {
{ name = "cmdline", max_item_count = 3 },
{ name = "cmdline_history", max_item_count = 5 },
{ name = "buffer", max_item_count = 3 },
},
-- Enable pictogram icons for lsp/autocompletion
formatting = {
expandable_indicator = true,
format = lspkind.cmp_format({
mode = "symbol_text",
maxwidth = 50,
ellipsis_char = "...",
menu = {
cmdline_history = "[Hist]",
cmdline = "[CmdL]",
buffer = "[Buff]",
},
}),
},
})
-- `/` cmdline setup.
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
-- -- cmp commandline
-- local cmp = require("cmp")
-- local lspkind = require("lspkind")
-- cmp.setup.cmdline(":", {
-- sources = {
-- { name = "cmdline", max_item_count = 3 },
-- { name = "cmdline_history", max_item_count = 5 },
-- { name = "buffer", max_item_count = 3 },
-- },
-- -- Enable pictogram icons for lsp/autocompletion
-- formatting = {
-- expandable_indicator = true,
-- format = lspkind.cmp_format({
-- mode = "symbol_text",
-- maxwidth = 50,
-- ellipsis_char = "...",
-- menu = {
-- cmdline_history = "[Hist]",
-- cmdline = "[CmdL]",
-- buffer = "[Buff]",
-- },
-- }),
-- },
-- })
-- -- `/` cmdline setup.
-- cmp.setup.cmdline("/", {
-- mapping = cmp.mapping.preset.cmdline(),
-- sources = {
-- { name = "buffer" },
-- },
-- })

-- Diagnostic Appearance
local signs = {
Expand Down

0 comments on commit 1fc7fbe

Please sign in to comment.