From 02c0ea2270b59ec7eae9457152107a211a87a883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pacana?= Date: Wed, 29 Jul 2026 23:58:57 +0200 Subject: [PATCH] Hide timestamps in fzf history * Override fzf's Fish history widget after shell integration loads so Ctrl-R keeps the fuzzy history search but shows only commands. --- modules/fish.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/fish.nix b/modules/fish.nix index fec256e..61a830a 100644 --- a/modules/fish.nix +++ b/modules/fish.nix @@ -43,6 +43,22 @@ # not read. Prepend it after brew so Nix-provided CLI tools win. fish_add_path --global --prepend /run/current-system/sw/bin ''; + + interactiveShellInit = lib.mkAfter '' + function fzf-history-widget -d "Show command history" + set -l fzf_query (commandline) + set -lx FZF_DEFAULT_OPTS "$FZF_DEFAULT_OPTS --scheme=history --read0 --print0 --no-multi-line --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS" + set -lx FZF_DEFAULT_OPTS_FILE + + test -z "$fish_private_mode"; and builtin history merge + + if set -l result (builtin history -z | fzf --query "$fzf_query" | string split0) + commandline -- $result + end + + commandline --function repaint + end + ''; }; # Named to sort before plugin-hydro.fish: hydro bakes hydro_symbol_prompt -- 2.51.2