improve yash history and add a haccounts alias
This commit is contained in:
parent
2cc389f7da
commit
7aaa8c2e61
8
yashrc
8
yashrc
@ -10,12 +10,14 @@ if command --identify --builtin-command bindkey >/dev/null; then
|
||||
set --emacs
|
||||
fi
|
||||
|
||||
# set history
|
||||
# arrange history
|
||||
HISTFILE=
|
||||
HISTSIZE=5000
|
||||
HISTRMDUP=5000
|
||||
histstart=$(mktemp)
|
||||
history -r "$HOME/.yash_history"
|
||||
trap 'h=$(mktemp) && history -w $h && history -c && history -r "$HOME/.yash_history" && history -r $h && history -w $HOME/.yash_history && rm $h' EXIT
|
||||
history -w "$histstart"
|
||||
trap "history -w - | diff --old-line-format='' '$histstart' - > '$HOME/.yash_history' && rm '$histstart'" EXIT
|
||||
|
||||
# Get ourselves a nice prompt
|
||||
ks() { s="$?" ; $* ; return "$s" ; }
|
||||
@ -75,6 +77,8 @@ alias unlock='gpg-connect-agent <<<bye'
|
||||
alias weechat="ssh -t weechat@Chatmachine abduco -A weechat"
|
||||
alias agenda="khal list today 7d"
|
||||
|
||||
alias haccounts="hledger -I --alias '/.*:Accounts .*:(.*)/=Accounts:\1' bal accounts"
|
||||
|
||||
go() {
|
||||
dir="$(lr /home /data /etc -t '(name ~~ ".*" && prune || print) && type = d && !(name = ".git")' \
|
||||
| fzf --height 10 \
|
||||
|
Loading…
Reference in New Issue
Block a user