Skip to content

Instantly share code, notes, and snippets.

@crearo
Last active October 19, 2019 10:07
Show Gist options
  • Save crearo/c4fc937d4505c725f7ae7ee3e3eadae4 to your computer and use it in GitHub Desktop.
Save crearo/c4fc937d4505c725f7ae7ee3e3eadae4 to your computer and use it in GitHub Desktop.
My .zshrc config file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/rish/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array have no effect
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
git-extras
lol
z
python
wd
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#
unsetopt BEEP
set bell-style none
source /home/rish/code/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /home/rish/code/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
bindkey "^R" history-incremental-search-backward
#export PATH=~/Android/Sdk/platform-tools/:$PATH
adb-restart() {
#sudo zsh -c '. $0; "$@"' ~/.zshrc adb kill-server
#sudo zsh -c '. $0; "$@"' ~/.zshrc adb start-server
sudo adb kill-server
sudo adb start-server
adb devices
}
adb-root() {
adb devices
adb root
adb remount
}
fix-keyboard() {
xmodmap -e "keycode 112 = Home"
xmodmap -e "keycode 117 = End"
}
youtube-mp3(){
youtube-dl --extract-audio --audio-format mp3 $1
}
ndk-build() {
# export GSTREAMER_ROOT_ANDROID=/home/rish/code/gstreamer/gstreamer-1.0-android-universal-1.14.1
# export GSTREAMER_ROOT_ANDROID=/home/rish/code/gstreamer/gstreamer-1.0-android-universal-1.14.5
# export GSTREAMER_ROOT_ANDROID=/home/rish/code/gstreamer/android_arm
export GSTREAMER_ROOT_ANDROID=/home/rish/code/gstreamer/gstreamer-1.0-android-universal-1.11.91
# /home/rish/software/android-ndk-r17b/android-ndk-r17b/ndk-build
/home/rish/software/android-ndk-r12b/ndk-build
# /home/rish/software/android-ndk-r16b/ndk-build
}
alias cerbero='~/git/cerbero/cerbero-uninstalled'
accolade() {
cd /home/rish/code/android/projects/knight/accolade
workon venv
./make-release.py
}
use-java-7() {
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH
}
use-java-8(){
sudo update-java-alternatives -s java-1.8.0-openjdk-amd64
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH
}
use-java-11(){
sudo update-java-alternatives -s java-1.11.0-openjdk-amd64
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH
}
gcmd(){
git checkout master-dev
}
aosp(){
cd ~/code/aosp/msm8909_android;
. build/envsetup.sh
lunch msm8909_sight-user
}
java-run(){
# javac $1
print ${$1%.*}
}
set-volume(){
# must be set in percentage
pactl set-sink-volume 0 $1
}
git-unset(){
git config --global --unset credential.helper;
}
git-set(){
git config --global credential.helper cache;
git config --global credential.helper 'cache --timeout=604800';
}
# cuda
export PATH=/usr/local/cuda-10.1/bin:/usr/local/cuda-10.1/NsightCompute-1.0${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# virtualenv and virtualenvwrapper for opencv
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
# xclip
alias copy="xclip -selection c"
alias paste="xclip -selection c -o"
alias camera="cd ~/code/android/projects/knight/android_knight_camera/"
alias client="cd ~/code/android/projects/knight/android_knight_client/"
alias lifehacks="cd ~/code/android/projects/personal/lifehacks"
alias cat="bat"
alias crearo="xcowsay go take a break!"
# GPU
alias gpu_reload="sudo rmmod nvidia_uvm; sudo modprobe nvidia_uvm;"
. /usr/share/autojump/autojump.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment