leftprompt() { e=$?; (( $e )) && r="\[$(tput setaf 1)\]<$e>\[$(tput sgr0)\]" || r=""; p=$(echo ${PWD:-?} | sed "s#.*/\(.*\)/\(.*\)#\1/\2#"); # s#$HOME#~# #${PWD##*/} d=$(date +"%H.%M"); v=$(vcs); u=#; (( $(id -u) )) && u=\$; PS1="\[$(tput sgr0)\][\[$(tput bold)\]\h:\[$(tput setaf 30)\]$p\[$(tput sgr0)\]]\ (\[$(tput setaf 32)\]$d\[$(tput sgr0)\])$r$v\[$(tput rev)\]$u\[$(tput sgr0)\] "; } PROMPT_COMMAND=leftprompt case ${TERM} in st*|xterm*|rxvt*|Eterm|aterm|kterm|gnome*|alacritty) PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s\007" "${PWD/#$HOME/\~}"' ;; screen*|tmux*) PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033k%s\033\\" "${PWD/#$HOME/\~}"' ;; esac alias rm='rm -i' alias ls='ls --group-directories-first -vF --color=always' alias hh='cd $HOME' alias bk='cd $OLDPWD' alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias .....='cd ../../../..' alias ......='cd ../../../../..' alias lower="tr '[:upper:]' '[:lower:]'" alias upper="tr '[:lower:]' '[:upper:]'" alias rot13="tr abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" mvf() { mv $*; cd $_ ;} c() { echo 'scale=13;' $* | bc -l; } j() { ce $*; cd `head -n 1 $HOME/.local/share/dir_lst`; } hd() { hexdump -e '"%08.8_ax " 8/1 "%02X " " - " 8/1 "%02X "' -e '" |" "%_p"' -e '"|\n"' "$@"; } mkpw() { cat /dev/urandom | tr -dc "[:print:]" | fold -w `[[ "$2" == "" ]] && echo 16 || echo $2` | head -n `[[ "$1" == "" ]] && echo 1 || echo "$1"` ;} stty -ixon umask 077 set -o emacs shopt -s autocd shopt -s checkwinsize # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 +complete -F _command doas # doas completions # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"