commit 3b1cc8fc5a33724b5fdabe6dfb9d6761904f9b46 from: amb date: Mon Jun 1 02:02:28 2026 UTC ksh fzf integration commit - 05d660eefee351f303fb5e6e4bc67864761f5120 commit + 3b1cc8fc5a33724b5fdabe6dfb9d6761904f9b46 blob - fab28682aae027de299dae3b7ef184ced3d2a157 blob + 5d5b9f91bd2988d3fbd7172cc70e76c240cda87b --- .config/ksh/kshrc +++ .config/ksh/kshrc @@ -1,5 +1,5 @@ set -C -set -o vi +# set -o vi git_branch() { if git_dir=$(git rev-parse --git-dir 2>/dev/null); then @@ -15,6 +15,22 @@ home_pwd() { esac } +function history2 { + eval fzf --tac --no-sort -e < "$HISTFILE" +} + +function history { + RES=$(fzf --tac --no-sort -e < "$HISTFILE") + + # If no selection is made, exit the function gracefully + test -n "$RES" || return 0 + + # Execute the selected command + eval "$RES" +} + +alias h='history2' + PS1='$(home_pwd) $(git_branch); ' [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/alias" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/alias"