Skip to content

Commit d1e435a

Browse files
committed
feat(blink): add toggle for blink.cmp
1 parent 0f98614 commit d1e435a

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

lua/plugins/blink.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ return {
5353
config.cmdline.enabled = false
5454
config.keymap['<Tab>'] = { 'select_and_accept', 'fallback'}
5555
config.enabled = function()
56-
-- vim.notify(vim.bo.filetype)
57-
return not vim.tbl_contains({ "DressingInput" }, vim.bo.filetype)
56+
return not vim.tbl_contains({ "DressingInput" }, vim.bo.filetype) or vim.g.use_blink
5857
end
5958
table.insert(config.sources.default, "arsync")
6059
table.insert(config.sources.default, "vimtex")

lua/plugins/snack.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,25 @@ return {
309309
end,
310310
})
311311
:map("<leader>lh", { desc = "Toggle cursorline and cursorcolumn highlight" })
312+
Snacks.toggle
313+
.new({
314+
id = "blink_cmp",
315+
name = "blink_cmp",
316+
get = function()
317+
return vim.g.use_blink
318+
end,
319+
set = function(state)
320+
vim.g.use_blink = state
321+
end,
322+
})
323+
:map("<leader>ub", { desc = "enable blink_cmp in all input" })
312324
Snacks.toggle.diagnostics():map "<leader>ud"
313325
Snacks.toggle.line_number():map "<leader>ul"
314326
Snacks.toggle
315327
.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 })
316328
:map "<leader>uc"
317329
Snacks.toggle.treesitter():map "<leader>uT"
318-
Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map "<leader>ub"
330+
Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map "<leader>uB"
319331
Snacks.toggle.inlay_hints():map "<leader>uh"
320332
Snacks.toggle.indent():map "<leader>ui"
321333
Snacks.toggle.dim():map "<leader>uD"

0 commit comments

Comments
 (0)