Skip to content

Commit

Permalink
fix(blink-cmp): improve tab completion in command line
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Jan 6, 2025
1 parent f913ab6 commit bb1dc4f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lua/astrocommunity/completion/blink-cmp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,23 @@ return {
"select_next",
"snippet_forward",
function(cmp)
if has_words_before() then return cmp.show() end
if has_words_before() or vim.api.nvim_get_mode().mode == "c" then return cmp.show() end
end,
"fallback",
},
["<S-Tab>"] = {
"select_prev",
"snippet_backward",
function(cmp)
if vim.api.nvim_get_mode().mode == "c" then return cmp.show() end
end,
"fallback",
},
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
},
completion = {
list = { selection = function(ctx) return ctx.mode == "cmdline" and "auto_insert" or "preselect" end },
menu = {
auto_show = function(ctx) return ctx.mode ~= "cmdline" end,
border = "rounded",
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None",
draw = {
Expand Down

0 comments on commit bb1dc4f

Please sign in to comment.