DEVELOPMENT ENVIRONMENT

~liljamo/nvim-flake

9c6639c62ce29f116333c1f30a136ba4b62334cb — Jonni Liljamo a month ago 3101f0f
feat(silicon): init
2 files changed, 54 insertions(+), 0 deletions(-)

M config/plugins/default.nix
A config/plugins/silicon.nix
M config/plugins/default.nix => config/plugins/default.nix +1 -0
@@ 8,6 8,7 @@
    ./lualine.nix
    ./oil.nix
    ./precognition.nix
    ./silicon.nix
    ./telescope.nix
    ./tiny-code-action.nix
    ./toggleterm.nix

A config/plugins/silicon.nix => config/plugins/silicon.nix +53 -0
@@ 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="<cmd>lua require('nvim-silicon').clip()<CR>";
      key = "<leader>sc";
      options.desc = "silicon to clipboard";
    }
    {
      action="<cmd>lua require('nvim-silicon').file()<CR>";
      key = "<leader>sf";
      options.desc = "silicon to file";
    }
  ];
}