silicon shortcut

This commit is contained in:
2026-07-24 16:11:26 -03:00
parent ffff15055b
commit a2d7391bbb
@@ -2,6 +2,14 @@ return {
"michaelrommel/nvim-silicon", "michaelrommel/nvim-silicon",
lazy = true, lazy = true,
cmd = "Silicon", cmd = "Silicon",
keys = {
{
"<leader>s",
"<cmd>Silicon<CR>",
desc = "[C]ode [S]elfie",
mode = "v",
},
},
config = function() config = function()
local get_visual = function() local get_visual = function()
local curpos = vim.fn.getcurpos() local curpos = vim.fn.getcurpos()
@@ -10,19 +18,16 @@ return {
if one.row == two.row then if one.row == two.row then
if one.col > two.col then if one.col > two.col then
local tmp = one one, two = two, one
one = two
two = tmp
end end
elseif one.row > two.row then elseif one.row > two.row then
local tmp = one one, two = two, one
one = two
two = tmp
end end
two.col = two.col + 1 two.col = two.col + 1
return one.row return one.row
end end
require("nvim-silicon").setup({ require("nvim-silicon").setup({
font = "Berkeley Mono Nerd Font Mono=24", font = "Berkeley Mono Nerd Font Mono=24",
theme = "gruvbox-dark", theme = "gruvbox-dark",
@@ -45,6 +50,5 @@ return {
return vim.bo.filetype return vim.bo.filetype
end, end,
}) })
vim.keymap.set("v", "<leader>cs", "<cmd>'<,'>Silicon<CR>", { desc = "[C]ode [S]elfie" })
end, end,
} }