From 60242632d0f6cd78e3782ab7551fa80453e89631 Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Sun, 12 Oct 2025 19:50:29 +0000 Subject: [PATCH] up --- modules/home/default.nix | 3 +- modules/home/git.nix | 5 +++ modules/home/lazygit.nix | 54 ++++++++++++++++++++++++++ modules/home/neovim/default.nix | 1 + modules/home/neovim/mappings.nix | 10 +++++ modules/home/neovim/plugins/neogit.nix | 13 +++++++ modules/home/starship.nix | 34 +++++++++++++--- 7 files changed, 113 insertions(+), 7 deletions(-) create mode 100644 modules/home/lazygit.nix create mode 100644 modules/home/neovim/plugins/neogit.nix diff --git a/modules/home/default.nix b/modules/home/default.nix index 7ae341a..f5fbc32 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -12,8 +12,7 @@ ./fish.nix ./fzf.nix ./git.nix - - + ./lazygit.nix ./mise.nix ./neovim ./opencode.nix diff --git a/modules/home/git.nix b/modules/home/git.nix index 93471ad..0e037f7 100644 --- a/modules/home/git.nix +++ b/modules/home/git.nix @@ -27,6 +27,11 @@ in { side-by-side = true; pager = "less -FRX"; }; + pager = { + diff = "delta"; + log = "delta"; + show = "delta"; + }; }; }; diff --git a/modules/home/lazygit.nix b/modules/home/lazygit.nix new file mode 100644 index 0000000..0816891 --- /dev/null +++ b/modules/home/lazygit.nix @@ -0,0 +1,54 @@ +{ + programs.lazygit = { + enable = true; + settings = { + git = { + commit.signOff = true; + paging = { + colorArg = "always"; + pager = "DELTA_FEATURES=decorations delta --light --paging=never --line-numbers --hyperlinks --hyperlinks-file-link-format=\"lazygit-edit://{path}:{line}\""; + }; + }; + + gui = { + authorColors = { + "*" = "#7287fd"; + }; + theme = { + activeBorderColor = [ + "#8839ef" + "bold" + ]; + inactiveBorderColor = [ + "#6c6f85" + ]; + optionsTextColor = [ + "#1e66f5" + ]; + selectedLineBgColor = [ + "#ccd0da" + ]; + cherryPickedCommitBgColor = [ + "#bcc0cc" + ]; + cherryPickedCommitFgColor = [ + "#8839ef" + ]; + defaultFgColor = [ + "#4c4f69" + ]; + searchingActiveBorderColor = [ + "#df8e1d" + ]; + unstagedChangesColor = [ + "#d20f39" + ]; + }; + }; + }; + }; + + home.shellAliases = { + lg = "lazygit"; + }; +} diff --git a/modules/home/neovim/default.nix b/modules/home/neovim/default.nix index bd19865..45834c2 100644 --- a/modules/home/neovim/default.nix +++ b/modules/home/neovim/default.nix @@ -8,6 +8,7 @@ ./plugins/conform.nix ./plugins/grug-far.nix ./plugins/lsp.nix + ./plugins/neogit.nix ./plugins/mini.nix ./plugins/supermaven.nix ./plugins/oil.nix diff --git a/modules/home/neovim/mappings.nix b/modules/home/neovim/mappings.nix index c1027f2..51e926d 100644 --- a/modules/home/neovim/mappings.nix +++ b/modules/home/neovim/mappings.nix @@ -94,6 +94,16 @@ options.desc = "Symbols (LSP, buffer)"; } # g - git + { + mode = "n"; + key = "gg"; + action.__raw = '' + function() + require('neogit').open({}) + end + ''; + options.desc = "Neogit"; + } # l - lsp/formatter { diff --git a/modules/home/neovim/plugins/neogit.nix b/modules/home/neovim/plugins/neogit.nix new file mode 100644 index 0000000..9372237 --- /dev/null +++ b/modules/home/neovim/plugins/neogit.nix @@ -0,0 +1,13 @@ +{ + programs.nixvim.plugins.neogit = { + enable = true; + settings = { + disable_signs = false; + integrations = { + diffview = true; + telescope = true; + }; + use_telescope = true; + }; + }; +} diff --git a/modules/home/starship.nix b/modules/home/starship.nix index d23821b..1cfb81a 100644 --- a/modules/home/starship.nix +++ b/modules/home/starship.nix @@ -5,7 +5,7 @@ settings = { add_newline = true; command_timeout = 200; - format = "[$directory$git_commit$git_branch$git_status]($style)$character"; + format = "$directory$git_commit$git_branch$git_status$git_state$git_metrics$character"; character = { error_symbol = "[✗ ](bold #e64553)"; success_symbol = "[❯](bold #40a02b)[❯](bold #df8e1d)[❯](bold #dc8a78)"; @@ -20,14 +20,38 @@ commit_hash_length = 4; only_detached = false; tag_disabled = true; - format = "[$hash]($style) "; + format = " [$hash]($style)"; + style = "bold #89b4fa"; }; git_branch = { - format = "[$branch]($style) "; - symbol = ""; + format = " [$symbol$branch(:$remote_branch)]($style)"; + symbol = " "; + style = "bold #a6e3a1"; + truncation_length = 28; }; git_status = { - format = "| [$all_status$ahead_behind]($style) "; + format = " [$ahead_behind$staged$modified$renamed$deleted$typechanged$untracked$stashed$conflicted]($style)"; + style = "bold #f9e2af"; + conflicted = "✖$count"; + ahead = "⇡$count"; + behind = "⇣$count"; + diverged = "⇕$ahead_count/$behind_count"; + staged = "+$count"; + modified = "~$count"; + renamed = "»$count"; + deleted = "×$count"; + untracked = "?$count"; + stashed = "⚑$count"; + typechanged = "≋$count"; + }; + git_state = { + format = " [$state($progress_current/$progress_total)]($style)"; + style = "bold #f38ba8"; + }; + git_metrics = { + disabled = false; + format = " [+$added/-$deleted]($style)"; + style = "bold #94e2d5"; }; }; };