[feat] nvim: configure nvim-silicon #5

Merged
jalil merged 2 commits from nvim-silicon into main 2024-06-16 22:22:10 +02:00
6 changed files with 47 additions and 4 deletions

View file

@ -5,7 +5,7 @@ jobs:
steps: steps:
- uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://code.forgejo.org/actions/checkout@v4
- run: nix --version - run: nix --version
- run: nix flake check --keep-going - run: nix flake check --keep-going --verbose
build: build:
runs-on: nixos runs-on: nixos
strategy: strategy:

View file

@ -0,0 +1,4 @@
{pkgs}: {
vim-jjdescription = pkgs.callPackage ./vim-jjdescription.nix {};
nvim-silicon = pkgs.callPackage ./nvim-silicon.nix {};
}

View file

@ -0,0 +1,15 @@
{
vimUtils,
fetchFromGitHub,
silicon,
}:
vimUtils.buildVimPlugin {
name = "nvim-silicon";
dependencies = [silicon];
src = fetchFromGitHub {
owner = "michaelrommel";
repo = "nvim-silicon";
rev = "v1.0.0";
hash = "sha256-cZOzgzLUNC9qOS2m/rc6YJfpNGdRTSCAdEPQDy+wT6I=";
};
}

View file

@ -135,7 +135,14 @@ in [
{ {
mode = "n"; mode = "n";
key = "<leader>w"; key = "<leader>w";
action = mkRaw "require'conform'.format"; action = mkRaw "require('conform').format";
options.desc = "Format buffer"; options.desc = "Format buffer";
} }
# Nvim Silicon
{
mode = "v";
key = "<leader>sc";
action = mkRaw "require('nvim-silicon').clip";
options.desc = "Snap Code (to clipboard)";
}
] ]

View file

@ -55,11 +55,12 @@ in {
inherit (import ./augroups.nix) autoGroups autoCmd; inherit (import ./augroups.nix) autoGroups autoCmd;
extraPlugins = let extraPlugins = let
plugins = pkgs.unstable.vimPlugins; plugins = pkgs.unstable.vimPlugins;
jjdescription = pkgs.unstable.callPackage ./vim-jjdescription.nix {}; extraPlugins = import ./extraPlugins {pkgs = pkgs.unstable;};
in [ in [
plugins.nui-nvim plugins.nui-nvim
plugins.nvim-web-devicons plugins.nvim-web-devicons
jjdescription extraPlugins.vim-jjdescription
extraPlugins.nvim-silicon
]; ];
# Formatting & linters # Formatting & linters
extraPackages = [ extraPackages = [
@ -88,6 +89,22 @@ in {
end end
-- END: Lua Pre Config -- 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
'';
}) })
]; ];
} }