feat(plugin): add showkeys integrationfor quick key preview

Adds nvzone/showkeys plugin and toggles it on demand to display current key bindings, enhancing developer workflow discoverability of mappings.
This commit is contained in:
sankalp committed 2026-06-11 22:58:16 +05:45
1 parent d2487a6aac
commit 942c60e0cf
3 files changed
+158 -138

No files matched your search

+76 -73
View File
@@ -1,79 +1,82 @@
add({
"saghen/blink.lib",
{ src = "saghen/blink.cmp", build = "cargo build --release" },
"rafamadriz/friendly-snippets",
'saghen/blink.lib',
{ src = 'saghen/blink.cmp', build = 'cargo build --release' },
'rafamadriz/friendly-snippets',
})
require("blink.cmp").setup({
fuzzy = { implementation = "prefer_rust" },
snippets = { preset = "default" },
sources = {
default = function()
local type = vim.fn.getcmdtype()
if type == "/" or type == "?" then return { "buffer" } end
if type == ":" then return { "cmdline" } end
return { "lsp", "path", "snippets", "buffer" }
end,
providers = {
snippets = {
opts = {
search_paths = { vim.fn.stdpath("config") .. "/snippets" },
extended_filetypes = { mdx = { "markdown" } },
},
},
},
},
require('blink.cmp').setup({
fuzzy = { implementation = 'prefer_rust' },
snippets = { preset = 'default' },
sources = {
default = function()
local type = vim.fn.getcmdtype()
if type == '/' or type == '?' then
return { 'buffer' }
end
if type == ':' then
return { 'cmdline' }
end
return { 'lsp', 'path', 'snippets', 'buffer' }
end,
providers = {
snippets = {
opts = {
search_paths = { vim.fn.stdpath('config') .. '/snippets' },
extended_filetypes = { mdx = { 'markdown' } },
},
},
},
},
completion = {
ghost_text = { enabled = true },
completion = {
ghost_text = { enabled = true },
list = {
selection = {
preselect = false,
auto_insert = true,
},
},
documentation = {
window = { border = "rounded" },
auto_show = true,
auto_show_delay_ms = 50,
},
menu = {
border = "rounded",
draw = {
components = {
kind_icon = {
text = function(ctx)
local kind_icon, _, _ = require("mini.icons").get("lsp", ctx.kind)
return kind_icon
end,
highlight = function(ctx)
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
return hl
end,
},
kind = {
highlight = function(ctx)
local _, hl, _ = require("mini.icons").get("lsp", ctx.kind)
return hl
end,
},
},
},
},
},
signature = {
window = { border = "rounded" },
},
keymap = {
preset = "none",
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<C-space>"] = { "hide", "show" },
["<C-y>"] = { "show", "show_documentation", "hide_documentation" },
["<C-u>"] = { "scroll_documentation_up", "fallback" },
["<C-d>"] = { "scroll_documentation_down", "fallback" },
},
list = {
selection = {
preselect = false,
auto_insert = true,
},
},
documentation = {
window = { border = 'rounded' },
auto_show = true,
auto_show_delay_ms = 50,
},
menu = {
border = 'rounded',
draw = {
components = {
kind_icon = {
text = function(ctx)
local kind_icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
return kind_icon
end,
highlight = function(ctx)
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
return hl
end,
},
kind = {
highlight = function(ctx)
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
return hl
end,
},
},
},
},
},
signature = {
window = { border = 'rounded' },
},
keymap = {
preset = 'none',
['<S-Tab>'] = { 'select_prev', 'snippet_backward', 'fallback' },
['<Tab>'] = { 'select_next', 'snippet_forward', 'fallback' },
['<CR>'] = { 'accept', 'fallback' },
['<C-space>'] = { 'hide', 'show' },
['<C-y>'] = { 'show', 'show_documentation', 'hide_documentation' },
['<C-u>'] = { 'scroll_documentation_up', 'fallback' },
['<C-d>'] = { 'scroll_documentation_down', 'fallback' },
},
})