Skip to content

Instantly share code, notes, and snippets.

@hectorcorrea
Last active Aug 27, 2021
Embed
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/LibreOffice.app/Contents/MacOS:$PATH
# Stop Apple from telling me that zhs is the new hotness
# Source: https://www.saintlad.com/hide-default-interactive-shell-is-now-zsh-in-terminal-on-macos/
export BASH_SILENCE_DEPRECATION_WARNING=1
# Ruby 2.6
source /usr/local/opt/chruby/share/chruby/chruby.sh
chruby 2.6.6
cd ~/src
# I thought I needed this to prevent GitHub from asking for my passphrase
# (https://stackoverflow.com/a/10032655/446681) but turns out editing the
# ssh/config file takes care of it https://stackoverflow.com/a/41576222/446681
#
# eval $(ssh-agent)
# tabname
# http://thelucid.com/2012/01/04/naming-your-terminal-tabs-in-osx-lion/
function tn {
printf "\e]1;${1:-bash}\a"
}
# bundle grep
function bgrep {
if [ -z "$1" ]; then
echo "usage: bgrep text-to-search"
return 1
fi
echo "Searching for $1"
grep -r $1 $(bundle list --paths) .
}
function ff {
if [ -z "$1" ]; then
echo "usage: ff name-of-file"
return 1
fi
find ./ -iname "*$1*"
}
" https://linuxhint.com/vimrc_tutorial/
syntax on
" If Nerdtree is installed
" https://github.com/preservim/nerdtree
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