Skip to content

Instantly share code, notes, and snippets.

@bennettmcelwee

bennettmcelwee/.bashrc

Last active Oct 27, 2016
Embed
What would you like to do?
if [ -f ~/bin/sensible.bash ]; then
source ~/bin/sensible.bash
fi
if [ -f ~/bin/git-completion.bash ]; then
source ~/bin/git-completion.bash
fi
export EDITOR="open -t -n -W"
### Set the prompt
usertext='\u'
prompttext='$'
sshtext=
if [ -n "$SSH_CLIENT" ];
then sshtext='\[\e[32m\]ssh\[\e[90m\]'
fi
if [ $(id -u) -eq 0 ];
then
usertext='\[\e[91m\]\u\[\e[39m\]'
prompttext='#'
fi
export PS1='\[\e[90m\]'${usertext}'@\h \t \w\n'${sshtext}${prompttext}'\[\e[39m\] '
### Useful aliases
alias ll="ls -Fla"
# cd to a Windows path (e.g. wd 'C:\Foo\Bar')
# wd() { cd "`echo $1 | sed 's/^\\(\\w\\):/\\/\\1/' | sed 's/\\\\/\\//g'`"; }
# Create an alias to cd to the current directory
a() { alias $1=cd\ $PWD; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment