Skip to content

Instantly share code, notes, and snippets.

@rubencaro rubencaro/.bashrc
Last active Mar 16, 2019

Embed
What would you like to do?
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
export PATH=$HOME/.local/bin:$PATH
# fix too conservative defaults for colors
export TERM=xterm-256color
####### chivato del GIT
function parse_git_dirty {
git diff --quiet HEAD &>/dev/null
[[ $? == 1 ]] && echo "!"
}
git_branch() {
BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1)/")
echo "$BRANCH"
}
##### helpers de dot
#### ex: go_render myfile.dot &
function get_mtime {
ls -l --time-style=+%s "${1?}" | cut -d' ' -f6
}
function go_render {
dotfile="$1"
mtime=0
while true;
do
newtime=$(get_mtime "$dotfile")
test $mtime -ne $newtime && dot -O -Tpng $dotfile;
mtime=$newtime
sleep 1;
done;
}
#######
# joder ya con la dislexia !!
alias gti="git"
alias got="git"
alias tit="git" # yeah
# vim con poderes
alias vim="vimx"
alias whitenoise="play -q -c 2 --null synth 1:00:00 whitenoise bass 0 treble 0 reverb 0 tremolo 0.1 40 band 500 500"
#### prompt
PROMPT_DIRTRIM=2
bold=$(tput bold)
blink=$(tput blink)
brightwhite=$(tput setaf 15)
cyan=$(tput setaf 6)
brightred=$(tput setaf 9)
yellow=$(tput setaf 11)
orange=$(tput setaf 208)
gray=$(tput setaf 8)
reset=$(tput sgr0)
export PS1='\[$bold\]\[$gray\]\w\[$orange\]$(git_branch)\[$brightred\]\[$blink\]\[$bold\]$(parse_git_dirty)\[$reset\]\[$gray\] $(date +%M%S)\[$reset\] \$ '
### other stuff
export PROJECTS_PATH="$HOME/Documentos"
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
export ERL_AFLAGS="-kernel shell_history enabled"
# to allow qt5ct setup KDE apps settings
export QT_QPA_PLATFORMTHEME="qt5ct"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.