Skip to content

Instantly share code, notes, and snippets.

Last active Aug 27, 2021
What would you like to do?
My .bashrc
# On a Mac, make sure to source this file from .bash_profile
# source ~/.bashrc
PS1="\w \$ "
alias ls='ls -G -la'
alias lsr='find . -name "*" -exec ls -latd '{}' \;'
alias st='git status'
alias br='git branch'
alias co='git checkout'
alias lg='git log'
alias df='git diff'
alias grlast='git reset HEAD~1'
alias be='bundle exec'
alias rr='bundle exec rails server'
# Don't save duplicate entries in history
export HISTCONTROL=ignoreboth
# export PATH=/usr/local/fits-0.6.2:/usr/local/bin:/usr/bin:/Applications/$PATH
# Stop Apple from telling me that zhs is the new hotness
# Source:
# Ruby 2.6
source /usr/local/opt/chruby/share/chruby/
chruby 2.6.6
cd ~/src
# I thought I needed this to prevent GitHub from asking for my passphrase
# ( but turns out editing the
# ssh/config file takes care of it
# eval $(ssh-agent)
# tabname
function tn {
printf "\e]1;${1:-bash}\a"
# bundle grep
function bgrep {
if [ -z "$1" ]; then
echo "usage: bgrep text-to-search"
return 1
echo "Searching for $1"
grep -r $1 $(bundle list --paths) .
function ff {
if [ -z "$1" ]; then
echo "usage: ff name-of-file"
return 1
find ./ -iname "*$1*"
syntax on
" If Nerdtree is installed
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment