Skip to content

Commit

Permalink
Improve history execute commands
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiya-kume committed Jan 4, 2025
1 parent e0d685f commit d1fd072
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions config/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ alias gb='git switch -m "$(git branch -a --sort=-authordate | grep -v -e "->" -e
# fi
#}

alias cd='builtin cd $@ && ls;'
# alias cd='builtin cd $@ && ls;'
alias cl='clear'
alias ts='tig status'
alias gp='git pull --autostash'
alias tssh='ssh $(tailscale status | awk "/^# / {next} /^[ \t]*$/ {next} /^\-/ {next} {print \$2}" | peco | tr "\n" "\0")'

function h() {
local selected
selected=$(history -E 1| awk '!a[$0]++' | peco --initial-index=-1)
if [[ -n "$selected" ]]; then
eval "$selected"
fi
}
# function h() {
h() { eval $(history -n -r | awk '!a[$0]++' | peco --initial-index=-1); }
# local selected
# selected=$(history -E 1| awk '!a[$0]++' | peco --initial-index=-1)
# if [[ -n "$selected" ]]; then
# eval "$selected"
# fi
#}
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"

0 comments on commit d1fd072

Please sign in to comment.