From 9c6639c62ce29f116333c1f30a136ba4b62334cb Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 30 Sep 2024 19:44:53 +0300 Subject: [PATCH] feat(silicon): init --- config/plugins/default.nix | 1 + config/plugins/silicon.nix | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 config/plugins/silicon.nix diff --git a/config/plugins/default.nix b/config/plugins/default.nix index a9893ae..8449cff 100644 --- a/config/plugins/default.nix +++ b/config/plugins/default.nix @@ -8,6 +8,7 @@ ./lualine.nix ./oil.nix ./precognition.nix + ./silicon.nix ./telescope.nix ./tiny-code-action.nix ./toggleterm.nix diff --git a/config/plugins/silicon.nix b/config/plugins/silicon.nix new file mode 100644 index 0000000..16fc418 --- /dev/null +++ b/config/plugins/silicon.nix @@ -0,0 +1,53 @@ +{pkgs, ...}: { + extraPlugins = [ + (pkgs.vimUtils.buildVimPlugin { + name = "silicon"; + src = pkgs.fetchFromGitHub { + owner = "michaelrommel"; + repo = "nvim-silicon"; + rev = "9fe6001"; + hash = "sha256-1BeJSpcmZeuIZXrbrxMKvaQBZn2TtsjrFXk26w2In+E="; + }; + }) + ]; + + extraConfigLua = '' + require('nvim-silicon').setup({ + font = "FiraCode Nerd Font Mono", + theme = "Solarized (light)", + background = "#FFFFFF00", + pad_horiz = 40, + pad_vert = 40, + no_window_controls = true, + line_offset = function(args) + return args.line1 + end, + shadow_blur_radius = 24, + shadow_offset_x = 0, + shadow_offset_y = 0, + to_clipboard = true, + window_title = function() + return vim.fn.fnamemodify( + vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()), + ":t" + ) + end, + output = function() + return "~/Pictures/" .. os.date("!%Y-%m-%dT%H-%M-%SZ") .. "_code.png" + end, + }) + ''; + + keymaps = [ + { + action="lua require('nvim-silicon').clip()"; + key = "sc"; + options.desc = "silicon to clipboard"; + } + { + action="lua require('nvim-silicon').file()"; + key = "sf"; + options.desc = "silicon to file"; + } + ]; +} -- 2.44.1