summaryrefslogtreecommitdiff
path: root/zsh/.zshrc
diff options
context:
space:
mode:
authorbh <qn+git@excalibur.computer>2025-12-22 20:07:21 +0800
committerbh <qn+git@excalibur.computer>2025-12-22 20:07:21 +0800
commit5051dfeab887cf738fc5c279f34828fea4ec3c73 (patch)
tree203e67c55b49f2e80474658c001e6510335620e6 /zsh/.zshrc
parent9be45573ccb6a73d33e3a36934a6c82c6c6101f1 (diff)
Added history function for zsh
Diffstat (limited to 'zsh/.zshrc')
-rw-r--r--zsh/.zshrc16
1 files changed, 15 insertions, 1 deletions
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 82cdb2e..a83309c 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -125,7 +125,8 @@ HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=1000000000
setopt beep notify
-bindkey -v
+setopt CORRECT_ALL
+# bindkey -v
# Map Ctrl+G to switch to normal mode (like Escape)
# bindkey '^G' vi-cmd-mode
# End of lines configured by zsh-newuser-install
@@ -161,5 +162,18 @@ alias rename="perl-rename"
alias tt="~/Scripts/ttzoom"
+alias rm="rm -i"
+
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
+
+
+fzf-history-widget() {
+ local cmd
+ cmd=$(fc -l 1 | tac | sed 's/^[[:space:]]*[0-9]\+[[:space:]]*//' |
+ fzf --height 40% --reverse --prompt="history> ") || return
+ LBUFFER+="$cmd"
+}
+
+zle -N fzf-history-widget
+bindkey '^R' fzf-history-widget