Skip to content

Instantly share code, notes, and snippets.

@full-stack-king
Created February 28, 2020 04:16
Show Gist options
  • Save full-stack-king/821f4bb95a77fab4fcaf81b344c323b7 to your computer and use it in GitHub Desktop.
Save full-stack-king/821f4bb95a77fab4fcaf81b344c323b7 to your computer and use it in GitHub Desktop.
My ZSH settings
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# 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/king/.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="wedisagree"
#POWERLINE THEME
# POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_HOME_SUB_ICON=''
POWERLEVEL9K_FOLDER_ICON=''
# POWERLEVEL9K_DISABLE_RPROMPT=true
#(dir vcs php_version docker_machine)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(time context dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status)
POWERLEVEL9K_OS_ICON_BACKGROUND='blue'
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
POWERLEVEL9K_SHORTEN_DELIMITER=""
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right"
# ZSH_THEME="powerlevel9k/powerlevel9k"
ZSH_THEME=powerlevel10k/powerlevel10k
#POWERLINE THEME
# 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 emoji)
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"
DEFAULT_USER="king"
alias rjhtdocs='nautilus /var/www/html'
alias rjphp='php -S php.local:2000'
alias rjzshrc='subl /home/king/.zshrc'
alias rjsource='source /home/king/.zshrc'
# Valet
alias rjlog='subl /home/king/.valet/Log/nginx-error.log'
alias rjvaletconfig='sudo nano /etc/nginx/sites-enabled/valet.conf'
# Laravel
alias art='php artisan'
alias artclean='php artisan view:clear && php artisan cache:clear && php artisan config:clear && php artisan clear-compiled && composer dumpautoload && php artisan queue:restart'
alias rjtinker='php artisan tinker'
# Git
alias gis='git status'
alias gia='git add'
alias gic='git commit -m'
# Apache
alias rjhosts='subl /etc/hosts'
alias rjapstop='sudo service apache2 stop'
alias rjapstart='sudo service apache2 start'
alias rjapstatus='sudo service apache2 status'
alias rjmyerror='subl /var/log/mysql/error.log'
alias rjaprestart='sudo service apache2 restart'
alias rjaperror='subl /var/log/apache2/error.log'
alias rjphp7ini='subl /etc/php/7.0/apache2/php.ini'
alias rjaperrorclean='sudo > /var/log/apache2/error.log'
alias rjvhosts='subl /etc/apache2/sites-enabled/000-default.conf'
alias rjapclean="sudo bash -c 'echo > /var/log/apache2/error.log'"
alias rjssl='sudo nano /etc/apache2/sites-available/default-ssl.conf'
# Nginx
alias rjngstop='sudo service nginx stop'
alias rjngstart='sudo service nginx start'
alias rjngstatus='sudo service nginx status'
alias rjngrestart='sudo service nginx restart'
alias rjngswitch='sudo service apache2 stop && sudo service nginx start'
alias rjapswitch='sudo service nginx stop && sudo service apache2 start'
# Mongo
alias rjmstop='sudo service mongodb stop'
alias rjmstart='sudo service mongodb start'
alias rjmstatus='sudo service mongodb status'
alias rjmrestart='sudo service mongodb restart'
alias rjsshconfig='subl /home/king/.ssh/config'
alias rjfixpermission='sudo chown -R www-data:www-data ./ && sudo chown -R king:www-data ./ && sudo find ./ -type f -exec chmod 664 {} \; && sudo find ./ -type d -exec chmod 775 {} \; && sudo chgrp -R www-data storage bootstrap/cache && sudo chmod -R ug+rwx storage bootstrap/cache'
alias rjcleandns='sudo /etc/init.d/dns-clean restart && sudo /etc/init.d/networking force-reload && sudo /etc/init.d/dnsmasq restart'
alias rjsomnium='cd /var/www/html/somnium'
alias rjking='cd /var/www/html/king'
alias rjaccess='subl /home/king/Documents/Somnium/Access.txt'
alias rj='cat /home/king/Documents/General/linux-commands/bashrc'
alias rjhelp='cat /home/king/Documents/General/linux-commands/bashrc'
alias c='clear'
alias x='exit'
alias rjsuspend='systemctl suspend'
alias rjresolve='sudo cp /media/king/85807d66-9947-4f2f-a801-3760979212f4/home/raja/Documents/General/resolv.conf /etc/resolv.conf'
# router pwd Raja@home#1#2#3
alias rjpma='subl /usr/share/phpmyadmin/config.inc.php'
# Android commands
alias rjnexus9='emulator -use-system-libs -avd Nexus_9_API_28 -dns-server 8.8.8.8&'
alias rjtablet='rjnexus9'
alias rjnexus7='emulator -use-system-libs -avd Nexus_7_API_29 -dns-server 8.8.8.8&'
alias rjpixelc='emulator -use-system-libs -avd Pixel_C_API_29 -dns-server 8.8.8.8&'
alias rjrelease='cd android && ./gradlew assembleRelease && ../'
# to clear cache of previous release
# react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
# to fix npm overflow error
# echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server && sudo sysctl -p
alias rjsmartsvn='/home/king/Downloads/smartsvn/bin/smartsvn.sh&'
#alias rjhubstaff='ruby hubstaff-export.rb export-screens 2017-04-28T04:00:00Z 2017-04-28T16:30:00Z -u 123982,124007,123987,123965,123991,123990,123934,123933 -o 46627'
alias rjsource='source /home/king/.zshrc'
alias www='cd /media/king/85807d66-9947-4f2f-a801-3760979212f4/home/raja/Documents/www'
export PATH="/opt/node/bin:$PATH"
export PATH="$HOME/.composer/vendor/bin:$PATH"
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
export COMPOSER_ALLOW_XDEBUG=1
export COMPOSER_DISABLE_XDEBUG_WARN=1
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
#export PATH="$PATH:$HOME/.rvm/bin"
#PATH="$GEM_HOME/bin:$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting
#[ -s ${HOME}/.rvm/scripts/rvm ] && source ${HOME}/.rvm/scripts/rvm
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i
# Android / React Native
export ANDROID_HOME="$HOME/Android/Sdk"
export PATH="$HOME/.npm-global/bin:$PATH"
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"
export JAVA_HOME="/usr/local/android-studio/jre/jre"
# Heptagon
alias hepvpn='sudo openvpn --config /home/king/Documents/heptagon/keys/pfSense-TCP-1194-Raja/pfSense-TCP-1194-Raja.ovpn --pkcs12 /home/king/Documents/heptagon/keys/pfSense-TCP-1194-Raja/pfSense-TCP-1194-Raja.p12 --tls-auth /home/king/Documents/heptagon/keys/pfSense-TCP-1194-Raja/pfSense-TCP-1194-Raja-tls.key'
export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
alias python=python3
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript:/home/king/.nvm/versions/node/v7.1.0/lib/node_modules
source /home/king/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
# [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh# Install Ruby Gems to ~/gems
export GEM_HOME="$HOME/gems"
export PATH="$HOME/gems/bin:$PATH"
# firefox dev
export PATH=/opt/firefox-dev/firefox:$PATH
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment