From 8d2607c8ad7c8bffdafcf186534dcdebd52df429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Sat, 11 Jul 2026 15:17:26 +0200 Subject: [PATCH] feat: gitsigns --- hosts/shark/default.nix | 1 + .../modules/nixvim/auto-session.nix | 6 ++- .../modules/nixvim/base/status-line.nix | 19 +------- .../home-manager/modules/nixvim/base/tabs.nix | 39 +++++++++++----- modules/home-manager/programs/nixvim.nix | 34 ++++++++++++-- modules/home-manager/theme/md3-evo.nix | 10 +++-- modules/home-manager/theme/nvim.vim | 45 +++++++++++++++++-- modules/nixos/desktops/hyprland.nix | 5 ++- 8 files changed, 118 insertions(+), 41 deletions(-) diff --git a/hosts/shark/default.nix b/hosts/shark/default.nix index 01b9d28..c9881da 100644 --- a/hosts/shark/default.nix +++ b/hosts/shark/default.nix @@ -151,6 +151,7 @@ "audio" "video" "plugdev" + "dialout" "cdrom" "kvm" ]; diff --git a/modules/home-manager/modules/nixvim/auto-session.nix b/modules/home-manager/modules/nixvim/auto-session.nix index 58a5a20..1712e43 100644 --- a/modules/home-manager/modules/nixvim/auto-session.nix +++ b/modules/home-manager/modules/nixvim/auto-session.nix @@ -14,13 +14,13 @@ in "buffers" "curdir" "folds" - "globals" "help" "tabpages" "winsize" "winpos" "terminal" "localoptions" + "globals" ] ); @@ -35,6 +35,10 @@ in }; }; lz-n.enable = true; + neo-tree.lazyLoad = { + enable = true; + settings.cmd = "Neotree"; + }; fidget.lazyLoad = { enable = true; settings = { diff --git a/modules/home-manager/modules/nixvim/base/status-line.nix b/modules/home-manager/modules/nixvim/base/status-line.nix index 88a46ee..8ccd37a 100644 --- a/modules/home-manager/modules/nixvim/base/status-line.nix +++ b/modules/home-manager/modules/nixvim/base/status-line.nix @@ -31,12 +31,6 @@ in settings = { options = { globalstatus = true; - /* - section_separators = { - left = ""; - right = ""; - }; - */ component_separators = { left = "┊"; right = "┊"; @@ -46,25 +40,14 @@ in lualine_a = [ { __unkeyed-1 = "mode"; - /* - separator = { - right = ""; - left = ""; - }; - */ icon = ""; } ]; + lualine_c = [ ]; lualine_x = lib.mkAfter [ { __unkeyed-1 = "filetype"; } ]; lualine_z = [ { __unkeyed-1 = "location"; - /* - separator = { - right = ""; - left = ""; - }; - */ } ]; }; diff --git a/modules/home-manager/modules/nixvim/base/tabs.nix b/modules/home-manager/modules/nixvim/base/tabs.nix index 868492a..891f34a 100644 --- a/modules/home-manager/modules/nixvim/base/tabs.nix +++ b/modules/home-manager/modules/nixvim/base/tabs.nix @@ -94,23 +94,42 @@ in letters = "etarfkcdmhsunobwgiyzqxvplj.,-ETARFKCDMHSUNOBWGIYZQXVPLJ"; }; }; - /* - scope = { - enable = true; - settings.hooks = { - pre_tab_leave.__raw = '' + auto-session.settings = { + pre_save_cmds = [ + { + __raw = '' function() - vim.api.nvim_exec_autocmds('User', {pattern = 'ScopeTabLeavePre'}) + -- require("scope.session").save_state() + vim.api.nvim_exec_autocmds('User', {pattern = 'SessionSavePre'}) end ''; - post_tab_enter.__raw = '' + } + ]; + post_restore_cmds = [ + { + __raw = '' function() - vim.api.nvim_exec_autocmds('User', {pattern = 'ScopeTabEnterPost'}) + -- require("scope.session").load_state() end ''; - }; + } + ]; + }; + scope = { + enable = false; + settings.hooks = { + pre_tab_leave.__raw = '' + function() + vim.api.nvim_exec_autocmds('User', {pattern = 'ScopeTabLeavePre'}) + end + ''; + post_tab_enter.__raw = '' + function() + vim.api.nvim_exec_autocmds('User', {pattern = 'ScopeTabEnterPost'}) + end + ''; }; - */ + }; }; }; } diff --git a/modules/home-manager/programs/nixvim.nix b/modules/home-manager/programs/nixvim.nix index 9035a70..78cbd96 100644 --- a/modules/home-manager/programs/nixvim.nix +++ b/modules/home-manager/programs/nixvim.nix @@ -77,7 +77,7 @@ status-line.enable = true; syntax.enable = true; tabs.enable = true; - yazi.enable = true; + tree.enable = true; }; languages = { c.enable = true; @@ -113,10 +113,38 @@ which-key.enable = true; schemastore.enable = true; todo-comments.enable = true; - origami.enable = false; nvim-surround.enable = true; fidget.enable = true; - gitsigns.enable = true; + gitsigns = { + enable = true; + settings = { + current_line_blame = true; + signcolumn = true; + numhl = true; + diff_opts = { + ignore_blank_lines = true; + ignore_whitespace_change = true; + ignore_whitespace_change_at_eol = true; + }; + + signs_staged = { + add.text = "██"; + change.text = "🮙🮙"; + delete.text = "▂▂"; + topdelete.text = "🮂🮂"; + changedelete.text = "╲╲"; + untracked.text = "╳╳"; + }; + signs = { + add.text = " █"; + change.text = " 🮙"; + delete.text = " ▂"; + topdelete.text = " 🮂"; + changedelete.text = " ╲"; + untracked.text = " ╳"; + }; + }; + }; treesitter-context = { enable = false; # TODO: looks weird with Neovide settings.line_numbers = false; diff --git a/modules/home-manager/theme/md3-evo.nix b/modules/home-manager/theme/md3-evo.nix index 5a41575..fb198fe 100644 --- a/modules/home-manager/theme/md3-evo.nix +++ b/modules/home-manager/theme/md3-evo.nix @@ -311,10 +311,12 @@ in theme = { name = "Adwaita"; }; - iconTheme = { - name = "Tela"; - package = pkgs.tela-icon-theme; - }; + /* + iconTheme = { + name = "Adwaita"; + package = pkgs.adwaita-icon-theme; + }; + */ }; qt.platformTheme.name = "qtct"; diff --git a/modules/home-manager/theme/nvim.vim b/modules/home-manager/theme/nvim.vim index 71b54ee..69fcdab 100644 --- a/modules/home-manager/theme/nvim.vim +++ b/modules/home-manager/theme/nvim.vim @@ -115,15 +115,49 @@ hi! SpellRare gui=undercurl guisp={{colors.success.default.hex}} hi! SpellLocal gui=undercurl guisp={{colors.success.default.hex}} hi! DiffAdd guibg={{colors.green_container.default.hex}} guifg={{colors.on_green_container.default.hex}} -hi! DiffChange guibg={{colors.yellow_container.default.hex}} guifg={{colors.on_yellow_container.default.hex}} +hi! DiffChange guibg={{colors.blue_container.default.hex}} guifg={{colors.on_blue_container.default.hex}} hi! DiffDelete guibg={{colors.red_container.default.hex}} guifg={{colors.on_red_container.default.hex}} -hi! DiffText guibg={{colors.blue_container.default.hex}} guifg={{colors.on_blue_container.default.hex}} +hi! DiffText guibg={{colors.yellow_container.default.hex}} guifg={{colors.on_yellow_container.default.hex}} + +hi Added guifg={{colors.green.default.hex}} +hi Changed guifg={{colors.blue.default.hex}} +hi Removed guifg={{colors.red.default.hex}} + +hi GitSignsAdd guibg={{colors.green_container.default.hex}} guifg={{colors.green.default.hex}} +hi GitSignsChange guibg={{colors.blue_container.default.hex}} guifg={{colors.blue.default.hex}} +hi GitSignsDelete guibg={{colors.red_container.default.hex}} guifg={{colors.red.default.hex}} +hi GitSignsTopdelete guifg={{colors.red_container.default.hex}} guifg={{colors.red.default.hex}} +hi GitSignsChangedelete guibg={{colors.yellow_container.default.hex}} guifg={{colors.yellow.default.hex}} +hi GitSignsUntracked guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} + +hi GitSignsStagedAdd guibg={{colors.green_container.default.hex}} guifg={{colors.green.default.hex}} +hi GitSignsStagedChange guibg={{colors.blue_container.default.hex}} guifg={{colors.blue.default.hex}} +hi GitSignsStagedDelete guibg={{colors.red_container.default.hex}} guifg={{colors.red.default.hex}} +hi GitSignsStagedTopdelete guifg={{colors.red_container.default.hex}} guifg={{colors.red.default.hex}} +hi GitSignsStagedChangedelete guibg={{colors.yellow_container.default.hex}} guifg={{colors.yellow.default.hex}} +hi GitSignsStagedUntracked guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} + +hi GitSignsAddNr guibg={{colors.green_container.default.hex}} guifg={{colors.on_green_container.default.hex}} +hi GitSignsChangeNr guibg={{colors.blue_container.default.hex}} guifg={{colors.on_blue_container.default.hex}} +hi GitSignsDeleteNr guibg={{colors.red_container.default.hex}} guifg={{colors.on_red_container.default.hex}} +hi GitSignsTopdeleteNr guibg={{colors.red_container.default.hex}} guifg={{colors.on_red_container.default.hex}} +hi GitSignsChangedeleteNr guibg={{colors.yellow_container.default.hex}} guifg={{colors.on_yellow_container.default.hex}} +hi GitSignsUntrackedNr guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} + +hi GitSignsStagedAddNr guibg={{colors.green_container.default.hex}} guifg={{colors.on_green_container.default.hex}} +hi GitSignsStagedChangeNr guibg={{colors.blue_container.default.hex}} guifg={{colors.on_blue_container.default.hex}} +hi GitSignsStagedDeleteNr guibg={{colors.red_container.default.hex}} guifg={{colors.on_red_container.default.hex}} +hi GitSignsStagedTopdeleteNr guibg={{colors.red_container.default.hex}} guifg={{colors.on_red_container.default.hex}} +hi GitSignsStagedChangedeleteNr guibg={{colors.yellow_container.default.hex}} guifg={{colors.on_yellow_container.default.hex}} +hi GitSignsStagedUntrackedNr guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} + +hi GitSignsCurrentLineBlame guifg={{colors.outline.default.hex}} hi! NeoTreeGitAdded guifg={{colors.green.default.hex}} hi! NeoTreeGitDeleted guifg={{colors.red.default.hex}} -hi! NeoTreeGitModified guifg={{colors.yellow.default.hex}} +hi! NeoTreeGitModified guifg={{colors.blue.default.hex}} hi! NeoTreeGitConflict guifg={{colors.danger.default.hex}} -hi! NeoTreeGitUntracked guifg={{colors.blue.default.hex}} +hi! NeoTreeGitUntracked guifg={{colors.yellow.default.hex}} hi! NonText guifg={{colors.outline_variant.default.hex}} hi! CursorLineNr guifg={{colors.on_surface.default.hex}} @@ -238,6 +272,9 @@ hi BufferInactiveSign guibg={{colors.surface.default.hex}} guifg={{colors.outlin hi BufferInactiveTarget guibg={{colors.surface.default.hex}} guifg={{colors.primary.default.hex}} hi BufferTabpageFill guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} +hi BufferScrollArrow guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} +hi BufferTabpages guibg={{colors.surface.default.hex}} guifg={{colors.secondary.default.hex}} +hi BufferTabpagesSep guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}} let g:lualine_theme = { \ "insert": { diff --git a/modules/nixos/desktops/hyprland.nix b/modules/nixos/desktops/hyprland.nix index 9a3d273..defe5a7 100644 --- a/modules/nixos/desktops/hyprland.nix +++ b/modules/nixos/desktops/hyprland.nix @@ -16,7 +16,10 @@ in }; config = lib.mkIf cfg.enable { - environment.systemPackages = with pkgs; [ glib ]; + environment.systemPackages = with pkgs; [ + glib + adwaita-icon-theme + ]; programs.hyprland = { enable = true;