DEVELOPMENT ENVIRONMENT

~liljamo/nvim-flake

ref: 5fc3e3c83ba2f044334653ba01aabbf9054d08e9 nvim-flake/config/plugins/silicon.nix -rw-r--r-- 1.3 KiB
5fc3e3c8Jonni Liljamo feat(lsp): pylsp 12 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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";
    }
  ];
}