Files
neovim-config/lua/taken/plugins/nvim-silicon.lua
Taken 9556024c93 Added types
Signed-off-by: Taken <taken@mairimashita.org>
2024-03-17 16:34:11 +01:00

35 lines
1006 B
Lua

--- @type LazyPluginSpec
return {
"michaelrommel/nvim-silicon",
lazy = true,
cmd = "Silicon",
keys = {
{
"<leader>sc",
"<cmd>Silicon<CR>",
mode = { "v" },
desc = "Capture code to image",
},
},
config = function()
local tmpdir = vim.fn.environ().TMP .. "/"
require("silicon").setup({
font = "CaskaydiaCove Nerd Font Mono=34",
theme = "Dracula",
-- background = "#076678",
-- background_image = nil,
gobble = true,
num_separator = " ",
output = function()
return tmpdir .. os.date("!%Y-%m-%dT%H-%M-%S") .. "_code.png"
end,
to_clipboard = true,
window_title = function()
return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()), ":t")
.. " | Silicon & nvim-silicon"
end,
})
end,
}