From 1464259ece0f4f09983db1f09270b2bb87352974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 16 Jun 2024 22:05:56 +0200 Subject: [PATCH] [feat] nvim: configure nvim-silicon Allows me to easily take screenshots of my code --- nvim/mappings.nix | 9 ++++++++- nvim/nixvim.nix | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/nvim/mappings.nix b/nvim/mappings.nix index e548847..49933ef 100644 --- a/nvim/mappings.nix +++ b/nvim/mappings.nix @@ -135,7 +135,14 @@ in [ { mode = "n"; key = "w"; - action = mkRaw "require'conform'.format"; + action = mkRaw "require('conform').format"; options.desc = "Format buffer"; } + # Nvim Silicon + { + mode = "v"; + key = "sc"; + action = mkRaw "require('nvim-silicon').clip"; + options.desc = "Snap Code (to clipboard)"; + } ] diff --git a/nvim/nixvim.nix b/nvim/nixvim.nix index feb62e4..2996b80 100644 --- a/nvim/nixvim.nix +++ b/nvim/nixvim.nix @@ -89,6 +89,22 @@ in { end -- END: Lua Pre Config ''; + extraConfigLua = '' + -- Lua Config + require("nvim-silicon").setup { + theme = "gruvbox-dark", + pad_horiz = 16, + pad_vert = 16, + -- Current buffer name + window_title = function() + return vim.fn.fnamemodify( + vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()), + ":t" + ) + end, + } + -- END: Lua Config + ''; }) ]; }