Skip to content

Instantly share code, notes, and snippets.

@jbobbylopez
Created April 20, 2020 06:37
Show Gist options
  • Save jbobbylopez/984f1f842701b3d8319229e7b121aae1 to your computer and use it in GitHub Desktop.
Save jbobbylopez/984f1f842701b3d8319229e7b121aae1 to your computer and use it in GitHub Desktop.
custom bash prompt
#custom functions
declare -x PS1="\\[\\e[00;32m\\]\\u\\[\\e[0m\\]\\[\\e[00;37m\\]@\\[\\e[0m\\]\\[\\e[00;33m\\]\\h\\[\\e[0m\\]\\[\\e[00;37m\\] \\[\\e[0m\\]\\[\\e[00;36m\\]2020\\[\\e[0m\\]\\[\\e[00;37m\\]-\\[\\e[0m\\]\\[\\e[00;36m\\]Feb\\[\\e[0m\\]\\[\\e[00;37m\\]-\\[\\e[0m\\]\\[\\e[00;36m\\]28\\[\\e[0m\\]\\[\\e[00;37m\\] \\[\\e[0m\\]\\[\\e[00;36m\\](Friday)\\[\\e[0m\\]\\[\\e[00;37m\\] \\[\\e[0m\\]\\[\\e[00;36m\\]09:22:57 AM\\[\\e[0m\\]\\[\\e[00;37m\\] \\[\\e[0m\\]\\[\\e[00;33m\\]\$(parse_git_branch)\\[\\e[0m\\]\\[\\e[00;37m\\] \\n \\[\\e[0m\\]\\[\\e[00;35m\\][\\w]\\[\\e[0m\\]\\[\\e[00;37m\\] \\n \\\$ \\[\\e[0m\\] "
parse_git_branch ()
{
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
viewcsv ()
{
column -s, -t < $1 | less -#2 -N -S
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment