From 508a5d5410d05eed87c2709817d37084e3b6de47 Mon Sep 17 00:00:00 2001 From: bh Date: Mon, 22 Dec 2025 20:07:21 +0800 Subject: Added history function for zsh --- mpd/.config/mpd/log | 2 ++ mpd/.config/mpd/pid | 2 +- mpd/.config/mpd/state | 4 ++-- zsh/.zshrc | 16 +++++++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/mpd/.config/mpd/log b/mpd/.config/mpd/log index 34f5cb9..427849a 100644 --- a/mpd/.config/mpd/log +++ b/mpd/.config/mpd/log @@ -385,3 +385,5 @@ 2025-12-09T22:09:47 player: played "The Beatles/08 - Sgt. Pepper's Lonely Hearts Club Band/10 - Lovely Rita.flac" 2025-12-10T17:00:47 player: played "The Beatles/08 - Sgt. Pepper's Lonely Hearts Club Band/13 - A Day In The Life.flac" 2025-12-12T15:52:36 player: played "The Beatles/08 - Sgt. Pepper's Lonely Hearts Club Band/13 - A Day In The Life.flac" +2025-12-20T13:53:25 player: played "The Beatles/08 - Sgt. Pepper's Lonely Hearts Club Band/09 - When I'm Sixty-Four.flac" +2025-12-22T00:35:19 player: played "The Beatles/08 - Sgt. Pepper's Lonely Hearts Club Band/09 - When I'm Sixty-Four.flac" diff --git a/mpd/.config/mpd/pid b/mpd/.config/mpd/pid index d50bf78..8163eed 100644 --- a/mpd/.config/mpd/pid +++ b/mpd/.config/mpd/pid @@ -1 +1 @@ -835 +850 diff --git a/mpd/.config/mpd/state b/mpd/.config/mpd/state index a78e323..a2048ad 100644 --- a/mpd/.config/mpd/state +++ b/mpd/.config/mpd/state @@ -2,8 +2,8 @@ sw_volume: 100 audio_device_state:1:PipeWire Output audio_device_state:1:Visualizer state: pause -current: 12 -time: 105.593 +current: 8 +time: 110.99000000000001 random: 0 repeat: 0 single: 0 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 -- cgit v1.2.3