Last active
February 26, 2016 15:31
-
-
Save seangwright/557d5a77d04cf3de0087 to your computer and use it in GitHub Desktop.
Sample .bashrc
This file contains 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
# Filesystem aliases | |
alias ls='ls -F --color=auto --show-control-chars' | |
alias ll='ls -alh' | |
alias size='du -sh *' | |
# Git aliases | |
alias gs='git status ' | |
alias ga='git add ' | |
alias gb='git branch ' | |
alias gc='git commit' | |
alias gd='git diff' | |
alias go='git checkout ' | |
alias gh='git hist' | |
alias gk='gitk --all&' | |
alias gx='gitx --all' | |
alias got='git ' | |
alias get='git ' | |
# App aliases | |
alias npp='notepad++.exe $*' | |
# Functions | |
# splits Conemu's screen in half, with Notepad++ below if `split npp` and Git Bash below if `split bash` | |
split() { | |
case $1 in | |
npp ) | |
notepad++ $2 -new_console:sV50 ;; | |
bash ) | |
/c/Program\ Files/Git/bin/sh.exe --login -i -new_console:sV50 ;; | |
esac | |
} | |
# opens up first .sln file found in directory for quick visual studio launching | |
vs() { | |
FILES_LIST="$(ls *.sln 2>/dev/null)" | |
for file in $FILES_LIST; do | |
start $file | |
done | |
} | |
# makes dir and cd's into it | |
mkdir() { | |
command mkdir $1 && cd $1 | |
} | |
# ConEmu Customization | |
PROMPT_COMMAND='ConEmuC -StoreCWD' # See http://conemu.github.io/en/ShellWorkDir.html#bash_and_other_cygwin_shells | |
# SSH Init | |
SSH_ENV=$HOME/.ssh/environment | |
# start the ssh-agent | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
# spawn ssh-agent | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} | |
echo succeeded | |
chmod 600 ${SSH_ENV} | |
. ${SSH_ENV} > /dev/null | |
/usr/bin/ssh-add | |
} | |
if [ -f "${SSH_ENV}" ]; then | |
. ${SSH_ENV} > /dev/null | |
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { | |
start_agent; | |
} | |
else | |
start_agent; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment