From e4d859a6ae916a2f30f03bdef4def8a69d766b4a Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Fri, 13 Mar 2026 12:58:12 +0000 Subject: [PATCH] small fix --- modules/_neovim/mappings.nix | 13 +++++++++++++ modules/_neovim/plugins/opencode.nix | 24 ++++++++++++------------ modules/shell.nix | 22 ++++++++-------------- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/modules/_neovim/mappings.nix b/modules/_neovim/mappings.nix index a85d228..68ce48d 100644 --- a/modules/_neovim/mappings.nix +++ b/modules/_neovim/mappings.nix @@ -440,6 +440,19 @@ action = "="; options.desc = "Equalize windows"; } + # scrolling + { + mode = "n"; + key = ""; + action = "zz"; + options.desc = "Scroll down and center"; + } + { + mode = "n"; + key = ""; + action = "zz"; + options.desc = "Scroll up and center"; + } # other { mode = "n"; diff --git a/modules/_neovim/plugins/opencode.nix b/modules/_neovim/plugins/opencode.nix index bf71e9f..fddf2e9 100644 --- a/modules/_neovim/plugins/opencode.nix +++ b/modules/_neovim/plugins/opencode.nix @@ -10,18 +10,18 @@ rev = "800c4f891f5d940f2805780a39872a0207b5a446"; hash = "sha256-3xyZux5S8ThBsi7AC4AWnd2h2LEI5L+I5Am2PNWKu64="; }; - doCheck = false; - postPatch = '' - # Widen sign column and move border further left for more padding - sed -i "s/signcolumn', 'yes'/signcolumn', 'yes:2'/" lua/opencode/ui/output_window.lua - sed -i "s/, -3)/, -5)/g" lua/opencode/ui/formatter.lua - sed -i "s/win_col = -3/win_col = -5/g" lua/opencode/ui/formatter.lua - # Fix off-by-one: user border starts 1 line too early (bleeds into header empty line) - sed -i 's/start_line = output:get_line_count() *$/start_line = output:get_line_count() + 1/' lua/opencode/ui/formatter.lua - # Fix file mention border starting 1 line too early - sed -i 's/file_line - 1, file_line/file_line, file_line/' lua/opencode/ui/formatter.lua - ''; - }; + doCheck = false; + postPatch = '' + # Widen sign column and move border further left for more padding + sed -i "s/signcolumn', 'yes'/signcolumn', 'yes:2'/" lua/opencode/ui/output_window.lua + sed -i "s/, -3)/, -5)/g" lua/opencode/ui/formatter.lua + sed -i "s/win_col = -3/win_col = -5/g" lua/opencode/ui/formatter.lua + # Fix off-by-one: user border starts 1 line too early (bleeds into header empty line) + sed -i 's/start_line = output:get_line_count() *$/start_line = output:get_line_count() + 1/' lua/opencode/ui/formatter.lua + # Fix file mention border starting 1 line too early + sed -i 's/file_line - 1, file_line/file_line, file_line/' lua/opencode/ui/formatter.lua + ''; + }; in { programs.nixvim = { autoCmd = [ diff --git a/modules/shell.nix b/modules/shell.nix index 96979c8..d1147cf 100644 --- a/modules/shell.nix +++ b/modules/shell.nix @@ -224,18 +224,11 @@ } ]) - # Vi mode prompt indicators (Starship can't detect vi mode in nushell, - # so we handle the character here instead of in the character module) - $env.PROMPT_INDICATOR = {|| $"(ansi green_bold)󰘧(ansi reset) " } - $env.PROMPT_INDICATOR_VI_INSERT = {|| - if $env.LAST_EXIT_CODE == 0 { - $"(ansi green_bold)󰘧(ansi reset) " - } else { - $"(ansi red_bold)󰘧(ansi reset) " - } - } - $env.PROMPT_INDICATOR_VI_NORMAL = {|| $"(ansi {attr: b, fg: '#286983'})󰘧(ansi reset) " } - ''; + # Vi mode indicators — Starship handles the character (green/red for + # success/error), nushell adds a dot for normal mode. + $env.PROMPT_INDICATOR_VI_INSERT = "· " + $env.PROMPT_INDICATOR_VI_NORMAL = "\e[1;38;2;40;105;131m·\e[0m " + ''; }; programs.zsh = { @@ -246,12 +239,13 @@ enable = true; enableNushellIntegration = true; settings = { - format = "$directory\${custom.scm}$hostname$line_break"; + format = "$directory\${custom.scm}$hostname$line_break$character"; buf = { disabled = true; }; character = { - disabled = true; + error_symbol = "[󰘧](bold red)"; + success_symbol = "[󰘧](bold green)"; }; directory = { truncate_to_repo = false;