diff --git a/hosts/desktop/config.nix b/hosts/desktop/config.nix index 47ae677..f5b6cbf 100755 --- a/hosts/desktop/config.nix +++ b/hosts/desktop/config.nix @@ -5,7 +5,7 @@ movOpts = { sysEnv = { issue.enable = true; - sddmConfig.enable = true; + sddmConfig.enable = false; stylixConfig.enable = true; nixSettings.enable = true; }; diff --git a/modules/home/programs/nixvim/keymaps.nix b/modules/home/programs/nixvim/keymaps.nix index d3be2e9..19ce534 100755 --- a/modules/home/programs/nixvim/keymaps.nix +++ b/modules/home/programs/nixvim/keymaps.nix @@ -1,6 +1,11 @@ { programs.nixvim = { keymaps = [ + { + action = "ggG"; # select entire document + key = ""; + mode = "n"; + } { action = "ChatGPTEditWithInstructions"; key = "!egpt"; diff --git a/overlay/scripts/commands/viconf.nix b/overlay/scripts/commands/viconf.nix index c309e8e..c944dcc 100755 --- a/overlay/scripts/commands/viconf.nix +++ b/overlay/scripts/commands/viconf.nix @@ -3,12 +3,15 @@ pkgs.writeShellApplication { name = "viconf"; runtimeInputs = with pkgs; [ coreutils fd ripgrep fzf ]; text = '' - #!/usr/bin/env bash + set -- "''${1:-}" + if [ ! $# -lt 1 ]; then + results=$(find "$FLAKEPATH" -exec find {} \; | sort | uniq | rg '\.nix$') + numresults=$(echo "$results" | wc -l) + else + results=$(find "$FLAKEPATH" -wholename "*$1*" -exec find {} \; | sort | uniq | rg '\.nix$') + numresults=$(echo "$results" | wc -l) + fi - [ ! $# -eq 1 ] && echo "Usage: viconf <*.nix>" && exit 1 - - results=$(find "$FLAKEPATH" -wholename "*$1*" -exec find {} \; | sort | uniq | rg '\.nix$') - numresults=$(echo "$results" | wc -l) [ "$numresults" -eq 0 ] && echo "$1 not found in \$FLAKEPATH" && exit 1 @@ -16,10 +19,16 @@ pkgs.writeShellApplication { # cut up the paths to give shorter path names to fuzzy finder results_prefix=$(echo "$results" | tail -n 1 | cut -d'/' -f-3) results=$(echo "$results" | cut -d'/' -f4-) - results=$(echo "$results" | grep "$1") + if [ -n "$1" ]; then + results=$(echo "$results" | grep "$1") + fi file=$(echo "$results" | tr ' ' '\n' | fzf) - file="$results_prefix/$file" + if [ -n "$file" ]; then + file="$results_prefix/$file" + else + exit 1 + fi # Check if the file contains any non-UTF-8 characters if grep --color='auto' -P -q "[^\x00-\x7F]" "$file"; then diff --git a/overlay/scripts/nix/rebuild.nix b/overlay/scripts/nix/rebuild.nix index dcf2104..5e77546 100755 --- a/overlay/scripts/nix/rebuild.nix +++ b/overlay/scripts/nix/rebuild.nix @@ -10,10 +10,10 @@ pkgs.writeShellApplication { str="''${str::-1}" if [ "$char" = "-" ]; then return 0; fi case "$char" in - "a") if checkbools; then echo "$usage" && exit 1; else all=true; fi ;; - "s") if checkbools; then system=true; else echo "$usage" && exit 1; fi ;; - "h") if checkbools; then home=true; else echo "$usage" && exit 1; fi ;; - "n") if [ "$dry" = false ]; then dry=true; else echo "$usage" && exit 1; fi ;; + "a") if checkbools; then all=true; else echo -e "$usage" && exit 1; fi ;; + "s") if checkbools; then system=true; else echo -e "$usage" && exit 1; fi ;; + "h") if checkbools; then home=true; else echo -e "$usage" && exit 1; fi ;; + "n") if [ "$dry" = false ]; then dry=true; else echo -e "$usage" && exit 1; fi ;; *) echo -e "$usage" && exit 1 ;; esac checkflags "$str"