git-crypt: setup
[julm/julm-nix.git] / home-manager / profiles / bash.nix
index ac87dd488f88a5344ee9b82013695e3b27647a06..3626cd2324b60ab1b2cc250217ddf579f5e61b13 100644 (file)
@@ -3,11 +3,14 @@
 programs.bash = {
   enable = lib.mkDefault true;
   shellAliases = {
+    black-on-white = "echo -e '\\033]11;black\\007\\033]10;white\\007'";
+    c = "bat";
     cl = "clear";
     eic = "edit-in-commit";
     eigg = "edit-in-git-grep";
     emacs = "emacsclient --create-frame";
     g = "git";
+    gg = "git grep";
     grep = "grep --color";
     j="sudo journalctl -u";
     jb="sudo journalctl -b";
@@ -18,21 +21,35 @@ programs.bash = {
     mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
     mem-top = "smem --sort rss --autosize";
     mpl = "mplayer";
+    nf = "sudo nft list ruleset | less";
     nixos-clean="sudo nix-collect-garbage -d";
     nixos-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
     nixos-rollback="sudo nixos-rebuild switch --rollback";
     pass-gen = "tr -d -C A-Za-z0-9_- </dev/urandom | head -c";
+    r = "reset";
     rsync = "rsync --no-inc-recursive --info=progress2 --inplace --partial";
     s="sudo systemctl";
     st="sudo systemctl status";
+    theme-black-on-white = "echo -e '\\033]10;black\\007\\033]11;white\\007'";
+    theme-white-on-black = "echo -e '\\033]10;white\\007\\033]11;black\\007'";
     u="systemctl --user";
     ut="systemctl --user status";
+    w1 = "watch --color --differences --interval 1";
+    w5 = "watch --color --differences --interval 5";
+    w10 = "watch --color --differences --interval 10";
+    w = "watch --color --differences";
+    watch = "watch --color --differences";
     yt = "yt-dlp";
-    watch = "watch --color";
     zfs-umount = "zfs-unmount";
   };
   initExtra = ''
+    # Alias completion
+    . ${pkgs.complete-alias}/bin/complete_alias
+    complete -F _complete_alias "''${!BASH_ALIASES[@]}"
+
     shopt -s globstar
+    shopt -s histreedit
+    shopt -s histverify
     # Disable ctrl-s/ctrl-q flow control
     stty -ixon
 
@@ -103,7 +120,7 @@ programs.bash = {
   '';
 };
 programs.direnv.enableBashIntegration = true;
-programs.broot.enableBashIntegration = true;
+#programs.broot.enableBashIntegration = true;
 home.sessionVariables = {
   PS1 = ''\[\033[1;32m\]\[\e]0;\u@\h: \w\a\]\W\[\033[0m\] \$(e=\$?; if [ \$e != 0 ]; then echo '\[\e[0;91m\]'\$e'\[\e[0m\]'; fi)\$ '';
 };