From 0bd80412072a8830db9528cc609845618d10621c Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Fri, 1 Mar 2024 12:56:39 +0100 Subject: [PATCH] feat(nvim): add silicon plugin to create code screenshots --- nvim/lazy-lock.json | 1 + nvim/lua/plugins/screenshots.lua | 33 ++++++++++++++++++++++++++++++++ setup/init.sh | 2 ++ 3 files changed, 36 insertions(+) create mode 100644 nvim/lua/plugins/screenshots.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 7ffd117..394bf4a 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -82,6 +82,7 @@ "nvim-lspconfig": { "branch": "master", "commit": "0ebcaedb2feb946e56658e0c9b6155fb6c8ad62b" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-silicon": { "branch": "main", "commit": "6637c3e366bcee54a322672ad57d4697cca9a920" }, "nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" }, "nvim-transparent": { "branch": "main", "commit": "fd35a46f4b7c1b244249266bdcb2da3814f01724" }, "nvim-treesitter": { "branch": "master", "commit": "31d06480554789557d24f1c2b7eacf627e43510c" }, diff --git a/nvim/lua/plugins/screenshots.lua b/nvim/lua/plugins/screenshots.lua new file mode 100644 index 0000000..eb4bee9 --- /dev/null +++ b/nvim/lua/plugins/screenshots.lua @@ -0,0 +1,33 @@ +-- Create code images using the external silicon tool +-- https://github.com/michaelrommel/nvim-silicon +return { + "michaelrommel/nvim-silicon", + lazy = true, + cmd = "Silicon", + config = function() + require("silicon").setup({ + font = "Fira Code=34;Noto Emoji=34", + theme = "Catppuccin-mocha", + background = "#68677b", + pad_horiz = 100, + pad_vert = 80, + no_round_corner = false, + no_window_controls = false, + no_line_number = false, + line_pad = 0, + tab_width = 2, + language = function() + return vim.bo.filetype + end, + shadow_blur_radius = 16, + shadow_offset_x = 8, + shadow_offset_y = 8, + shadow_color = "#100808", + gobble = true, + to_clipboard = true, + window_title = function() + return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()), ":t") + end, + }) + end, +} diff --git a/setup/init.sh b/setup/init.sh index 8aab1a9..8822b15 100755 --- a/setup/init.sh +++ b/setup/init.sh @@ -62,7 +62,9 @@ source ./golang.sh # GitHub CLI Extensions echo "Installing GitHub CLI Extensions" source ./github.sh + # Install Themes cd ~/.dotfiles/bat bat cache --build +silicon --build-cache cd ..