summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2023-04-23 15:54:24 +0200
committerAlan Pearce2023-04-23 15:54:24 +0200
commit58f56db988eb929d4f1a55987d3200f9bdd78175 (patch)
tree8ece7c82703a569a83bc3aa139ede905e6c2dc02 /user
parent8d1dfe0927fa3815d87700df6087f159f002fe36 (diff)
downloadnixfiles-58f56db988eb929d4f1a55987d3200f9bdd78175.tar.lz
nixfiles-58f56db988eb929d4f1a55987d3200f9bdd78175.tar.zst
nixfiles-58f56db988eb929d4f1a55987d3200f9bdd78175.zip
zsh: sort history-analysis results by frequency descending
Diffstat (limited to 'user')
-rw-r--r--user/settings/zsh.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/user/settings/zsh.nix b/user/settings/zsh.nix
index 24da676f..6fae5a41 100644
--- a/user/settings/zsh.nix
+++ b/user/settings/zsh.nix
@@ -110,8 +110,8 @@ in
       https = "xh --default-scheme https";
 
       history = "fc -l $(( $LINES - 2 ))";
-      hist-freq-lines = "fc -l -10000 | cut -d' ' -f4- | sort | uniq -c | sort -g | tail -n100 | less";
-      hist-freq-commands = "fc -l -10000 | cut -d' ' -f4 | sort | uniq -c | sort -g | tail -n10 | less";
+      hist-freq-lines = "fc -l -10000 | cut -d' ' -f4- | sort | uniq -c | sort -gr | head -n100 | less";
+      hist-freq-commands = "fc -l -10000 | cut -d' ' -f4 | sort | uniq -c | sort -gr | head -n10 | less";
       wprop = "xprop | egrep '^WM_(CLASS|NAME|WINDOW_ROLE|TYPE)'";
 
       # Enable the following commands to support aliases.
@@ -219,7 +219,7 @@ in
         export GHQ_ROOT="${config.home.homeDirectory}/projects"
 
         function hist-freq-subcommands () {
-          fc -l -m "$1*" -10000 | cut -d' ' -f4- | sort | uniq -c | sort -g | tail -n100 | less
+          fc -l -m "$1*" -10000 | cut -d' ' -f4- | sort | uniq -c | sort -gr | head -n100 | less
         }
 
         source ${pkgs.fzf}/share/fzf/key-bindings.zsh