Skip to content

Instantly share code, notes, and snippets.

@fn-alves
Last active October 23, 2017 16:40
Show Gist options
  • Save fn-alves/e3accf43697ce10eaa12487b7da8bc1e to your computer and use it in GitHub Desktop.
Save fn-alves/e3accf43697ce10eaa12487b7da8bc1e to your computer and use it in GitHub Desktop.
###############################################################################
# General settings and configuration #
###############################################################################
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
#source ~/.env
###############################################################################
# Third party packages settings and configuration #
###############################################################################
# getgist
export GETGIST_USER='fNxONE'
# autojump (when installed with brew)
if which brew > /dev/null; then [[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh; fi
# react-native
# export ANDROID_HOME=${HOME}/Library/Android/sdk
# export PATH=${PATH}:${ANDROID_HOME}/tools
# export PATH=${PATH}:${ANDROID_HOME}/platform-tools
# rbenv
if which apt-get > /dev/null; then export PATH="$HOME/rbenv/bin:$PATH"; fi
if which brew > /dev/null; then export RBENV_ROOT=/usr/local/var/rbenv; fi
if which rbenv > /dev/null; then eval "$(rbenv init - zsh)"; fi
# make sure macOS has a proper locale settings (not merely UTF-8)
export LC_ALL=pt_BR.UTF-8
export LC_CTYPE=pt_BR.UTF-8
export LANG=pt_BR.UTF-8
# pyenv
if which brew > /dev/null; then
pyenv_dir=/usr/local/var/pyenv
else
pyenv_dir="$HOME/.pyenv"
fi
export PYENV_ROOT="$pyenv_dir"
export PATH="$pyenv_dir/bin:$PATH"
# thefuck
eval "$(thefuck --alias)"
# virtualenv wrapper
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/projetos
###############################################################################
# General aliases #
###############################################################################
# general bash
alias dir='dir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ls='ls --color=auto'
alias l='ls -CF --color=auto'
alias ll='ls -lahG'
alias lh='ls -lahGg'
alias ~='cd ~'
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
# set linux timezone
alias tz='sudo dpkg-reconfigure tzdata'
###############################################################################
# Third party packages aliases #
###############################################################################
# apt update
if which apt-get > /dev/null; then
alias au='sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y'
# brew
elif which brew > /dev/null; then
alias bu='brew update && brew upgrade && brew cleanup -s && brew cask cleanup && rm -rfv `brew --cache` && brew prune'
fi
# conda
alias condaa="source /usr/local/var/pyenv/versions/anaconda3-4.1.1/bin/activate"
alias condad="source /usr/local/var/pyenv/versions/anaconda3-4.1.1/bin/deactivate"
# git
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias gl='git log --oneline'
alias go='git checkout'
alias gr='git remote'
alias gs='git status'
# em
alias em='~/.virtualenvs/em/bin/em'
# markright
alias mr="open -a markright "
# pip install and add to requirements.txt
pip-save () {
pip install $1 && pip freeze | grep -i $1 >> requirements.txt && sort -o requirements.txt requirements.txt
}
# tmux
alias t="tmux -2"
# vim/neovim
alias v='nvim'
# workon
alias w=workon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment