X-Git-Url: https://git.shemshak.org/gitweb.cgi/~bandali/configs/blobdiff_plain/dc9a8087274fa7dd52a83993fbe52d412e9739df..efbfa83fb174bd5dd7def633929a637ae547bd06:/.bashrc diff --git a/.bashrc b/.bashrc index 04cacb6..cce2dc8 100644 --- a/.bashrc +++ b/.bashrc @@ -1,9 +1,15 @@ -# If not running interactively, don't do anything -# [[ $- != *i* ]] && return +# various bash tweaks +shopt -s histappend +shopt -s cmdhist +HISTSIZE= +HISTFILESIZE= +HISTCONTROL=ignoreboth +HISTIGNORE='ls:l:s:bg:fg:history' +HISTTIMEFORMAT='%F %T ' +stty stop "" # aliases alias ls='ls --color=auto' -PS1='[\u@\h \W]\$ ' alias mpv="mpv --ytdl-format mp4" alias mv="mv -iv" alias cp="cp -iv" @@ -22,3 +28,12 @@ aur() { # echo -e "\033[5 q" # blinking echo -e "\033[6 q" # non-blinking + +# If not running interactively, don't do anything else +[[ $- != *i* ]] && return + +a_prompt() { + cwd=$(pwd | sed -e "s!$HOME!~!" | sed -re "s!([^/])[^/]+/!\1/!g") + printf $cwd +} +PS1="\u@\h \$(a_prompt)> "