Skip to content

Instantly share code, notes, and snippets.

@alsgu3rra
Created May 14, 2024 20:10
Show Gist options
  • Save alsgu3rra/05310dc7df00bb820dd8d9566ce78397 to your computer and use it in GitHub Desktop.
Save alsgu3rra/05310dc7df00bb820dd8d9566ce78397 to your computer and use it in GitHub Desktop.
Padronizando Bash e Zsh
export EDITOR='nano'
export VISUAL='nano'
export HISTCONTROL=ignoreboth:erasedups
export PAGER='most'
[[ $- != *i* ]] && return
if [ -d "$HOME/.bin" ] ;
then PATH="$HOME/.bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ] ;
then PATH="$HOME/.local/bin:$PATH"
fi
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) tar xf $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
function_depends() {
search=$(echo "$1")
sudo pacman -Sii $search | grep "Required" | sed -e "s/Required By : //g" | sed -e "s/ /\n/g"
}
# NVM
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Java
export _JAVA_AWT_WM_NONREPARENTING=1
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
export ANDROID_HOME=~/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
# rvm
export PATH="$PATH:$HOME/.rvm/bin"
# ruby on rails
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export PATH="$PATH:$GEM_HOME/bin"
# cargo
. "$HOME/.cargo/env"
# Anaconda
export PATH="/home/guerra/anaconda3/bin:$PATH"
# Bun.js
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH
# Deno.js
export DENO_INSTALL="/home/guerra/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
# Load Angular CLI autocompletion.
# source <(ng completion script)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment