Last active
November 2, 2020 00:17
-
-
Save dfelton/7fff43172eb388a557a1343df374a243 to your computer and use it in GitHub Desktop.
~/.bashrc preferences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git | |
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="\u@\[\033[32m\]\w\[\033[33m\]\$(git_branch)\[\033[00m\]\$ " | |
# Aliases | |
alias la='ls -la' | |
removeTrailingSpaces() | |
{ | |
[ "$1" == "" ] && >&2 echo please provide path to directory && return; | |
[ ! -d "$1" ] && >&2 echo \"$1\" is not a directory && return; | |
while read filename | |
do | |
sed -i 's/[ ]*$//' "$filename" | |
done <<< "$(find $1 -type f -exec grep -lIm 1 -P ' $' {} \;)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment