Compare commits

..

2 commits

Author SHA1 Message Date
xeruf
d400aaba20 bash_aliases: fix completion and stuff for zsh 2023-01-05 10:37:25 +01:00
xeruf
1406b016da bin: extend jrnl-tag 2023-01-05 10:36:50 +01:00
2 changed files with 17 additions and 9 deletions

View file

@ -1,13 +1,5 @@
test -n "$PS1" || return 0 test -n "$PS1" || return 0
export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)"
bind '"\ek":history-search-backward'
bind '"\ej":history-search-forward'
if test -f /etc/bash_completion && ! shopt -oq posix
then . /etc/bash_completion
fi
alias sc="sudo systemctl" alias sc="sudo systemctl"
alias scs="sudo systemctl status" alias scs="sudo systemctl status"
alias sce="sudo systemctl enable --now" alias sce="sudo systemctl enable --now"
@ -18,6 +10,8 @@ difr() { diff --color=always --unified=1 --recursive "$@" | less --RAW-CONTROL-C
# Copy recursively with rsync # Copy recursively with rsync
alias rc='rsync --recursive --info=progress2,remove,symsafe,flist,del --human-readable --links --hard-links --times' alias rc='rsync --recursive --info=progress2,remove,symsafe,flist,del --human-readable --links --hard-links --times'
export LESS="--RAW-CONTROL-CHARS --ignore-case --LONG-PROMPT --jump-target=5 $(test $(less --version | head -1 | cut -f2 -d' ') -ge 590 && echo --incsearch)"
# ls aliases # ls aliases
export LS_OPTIONS='--human-readable --si --group-directories-first --file-type --dereference-command-line' export LS_OPTIONS='--human-readable --si --group-directories-first --file-type --dereference-command-line'
@ -47,13 +41,25 @@ alias rm='rm -I'
alias cp='cp -i' alias cp='cp -i'
alias mv='mv -i' alias mv='mv -i'
# Bash completion
src() { test -f "$1" && source "$1"; }
case $(readlink /proc/$$/exe) in (*bash)
bind '"\ek":history-search-backward'
bind '"\ej":history-search-forward'
shopt -oq posix || src /etc/bash_completion
# Fancy prompt # Fancy prompt
PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]" PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]"
PS1="$PS1 \`if [ \$? = 0 ]; then echo -e '\[\033[01;32m\]:)';" PS1="$PS1 \`if [ \$? = 0 ]; then echo -e '\[\033[01;32m\]:)';"
PS1="$PS1 else echo -e '\[\033[01;31m\]' \$?; fi\`\[\033[00m\]" PS1="$PS1 else echo -e '\[\033[01;31m\]' \$?; fi\`\[\033[00m\]"
;;
(*zsh) setopt sh_word_split;;
esac
src() { test -f "$1" && source "$1"; }
src /usr/share/git/completion/git-prompt.sh && PS1="$PS1\$(__git_ps1 \" (%s)\")" src /usr/share/git/completion/git-prompt.sh && PS1="$PS1\$(__git_ps1 \" (%s)\")"
src $HOME/.config/shell/functions src $HOME/.config/shell/functions

View file

@ -1,4 +1,6 @@
#!/bin/sh #!/bin/sh
# Find terms in jrnl and turn them into tags
# Check with jrnl --tags
if test $# -eq 0 if test $# -eq 0
then $0 sleep nap health tech read dev phone Zinc run bike tour laptop computer PC CB piano faith journal then $0 sleep nap health tech read dev phone Zinc run bike tour laptop computer PC CB piano faith journal
else else