summaryrefslogtreecommitdiff
path: root/zsh/.zshrc
diff options
context:
space:
mode:
authorbh <qn+git@epicurus.dev>2025-12-22 20:07:21 +0800
committerbh <qn+git@epicurus.dev>2025-12-22 20:07:21 +0800
commit508a5d5410d05eed87c2709817d37084e3b6de47 (patch)
tree203e67c55b49f2e80474658c001e6510335620e6 /zsh/.zshrc
parent902becd0109f714c25f21e77482ee85938627ae7 (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