Last active
May 8, 2023 21:02
-
-
Save hectorcorrea/fd56edea3333bec47829 to your computer and use it in GitHub Desktop.
My .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
PS1="\w \$ " | |
alias ls='ls -G -la' | |
# Git aliases | |
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' | |
alias notes='code ~/src/notes/notes.md' | |
# use which psql instead | |
# psql -h 127.0.0.1 -U postgres -d development_db -p 54509 | |
# alias pg='open /Applications/PostgreSQL\ 10/SQL\ Shell\ \(psql\).app' | |
# Don't save duplicate entries in history | |
export HISTCONTROL=ignoreboth | |
export PATH=$PATH:/Library/PostgreSQL/10/bin/ | |
# Created by `pipx` on 2022-03-22 19:21:09 | |
export PATH="$PATH:/Users/correah/.local/bin" | |
# Version 12 was installed with Homebrew and it's the version that I use normally. | |
# Version 14 was installed by downloading the binaries from Node.js and I am using it for the Invenio workshop (6/6/2022) | |
# Version 16 is what I am using since 8/10/2022 | |
# | |
# export PATH=$PATH:/usr/local/opt/node@12/bin | |
# export PATH=$PATH:/usr/local/opt/node@14/bin | |
export PATH=$PATH:/usr/local/opt/node@16/bin | |
# GitHub token (needed to brew install auto) | |
export GH_TOKEN=... | |
# 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 | |
# To support CTRL+X + CTRL+E when editing long commands | |
# https://twitter.com/nixcraft/status/1387475672914747393 | |
export EDITOR=vi | |
# Ruby Version | |
source /usr/local/opt/chruby/share/chruby/chruby.sh | |
# chruby 2.6.6 - for Cicognara | |
# chruby 2.7.5 | |
chruby 3.0.3 # for PDC-Describe | |
# chruby 3.1.3 # for Tiger Data | |
# 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) . | |
} | |
# Checks out a remote branch | |
function co-remote { | |
if [ -z "$1" ]; then | |
echo "usage: co-remote branch-name" | |
return 1 | |
fi | |
echo "Checking out remote branch $1" | |
git checkout --track origin/$1 | |
} | |
# 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) | |
# | |
# This did not quite work so I removed the passphrase from my key. | |
# --- | |
# Run this to prevent getting error with Capistrano | |
# ``` | |
# net-ssh requires the following gems for ed25519 support: | |
# * rbnacl (>= 3.2, < 5.0) | |
# * rbnacl-libsodium, if your system doesn't have libsodium installed. | |
# * bcrypt_pbkdf (>= 1.0, < 2.0) | |
# ``` | |
ssh-add -q ~/.ssh/id_rsa | |
# Ta-da! | |
cd ~/src |
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
" 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