Skip to content

Instantly share code, notes, and snippets.

@mehulpamale
Last active March 26, 2023 12:34
Show Gist options
  • Save mehulpamale/e6962dae926ea5147e82dbc7ddd2fe8e to your computer and use it in GitHub Desktop.
Save mehulpamale/e6962dae926ea5147e82dbc7ddd2fe8e to your computer and use it in GitHub Desktop.
.zshrc
# 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/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME="robbyrussell"
ZSH_THEME="intheloop"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will 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 one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# 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.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# 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.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# 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?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
gitfast
docker docker-compose
zsh-interactive-cd
zsh-autosuggestions
)
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"
# 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"
echo 'welcome'
set -o vi
#export start
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
# fvm default
export FVM_DEFAULT="/Users/mehul/fvm/default/bin"
export PATH="$FVM_DEFAULT:$PATH"
alias f=flutter
alias fpg=flutter\ pub\ get
alias fr=f\ run
alias fri="f run -t lib/main_dev.dart --flavor dev -d iPhone\ 13"
alias fd=f\ devices
alias fc=f\ clean
alias fa=f\ attach
alias d="dart"
#export JAVA_HOME='/usr/local/Cellar/openjdk/17.0.1_1'
#jdk 17
#export JAVA_HOME='/opt/homebrew/opt/openjdk'
#jdk 8
#export JAVA_HOME='/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home'
export JAVA_HOME='/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home'
export PATH=$JAVA_HOME/bin/:$PATH
#export end
#if [ -z "$TMUX" ]
#then
# #tmux attach -t TMUX ||
# tmux new
#fi
alias v=nvim
alias vf='vifm .'
alias e=exit
alias rz='. ~/.zshrc'
alias ez='v ~/.zshrc || vim ~/.zshrc && . ~/.zshrc'
alias es='v ~/.ssh/config'
alias et='v ~/.tmux.conf'
alias b=brew
alias bi='brew install'
#function bi {
# echo "do you want to install $1? (y)" ; read ANS;
# [[ "$ANS" == "y" ]] && b install $1 || echo "$1 will not be installed"
#}
alias bl='brew list'
alias bs='brew search'
alias bif='brew info'
alias bc='brew --cask'
alias bic='brew install --cask'
alias blc='brew list --cask'
alias bsc='brew search --cask'
alias bifc='brew info --cask'
alias code='/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code'
alias c='code .'
alias mc='node_modules/mocha/bin/mocha'
alias fetw='firebase emulators:exec "npm run test:watch"'
alias fet='firebase emulators:exec "npm t"'
alias fee='firebase emulators:exec'
alias fes='firebase emulators:start'
alias feto='firebase emulators:exec "npm run test:ol"'
alias fetow='firebase emulators:exec "npm run test:olw"'
alias fetoj='firebase emulators:exec "npm run jest"'
alias ni='npm install'
alias ng='npm run generate'
alias nb='npm run build'
alias ncl='if [[ ${PWD##*/} == functions ]] then; rm -rf node_modules src/generated lib ; mkdir -p src/generated ; npm install && echo ** npm i done && npm run generate && echo ** generate done && npm run build && echo ** build done; else echo can only be run from firebase/functions dir; fi'
alias ag='alias | grep'
alias gdsw='git diff --staged --word-diff'
alias gd1='git diff HEAD~1..'
zstyle ':completion:*' completer _expand_alias _complete _ignored
unalias gp
alias pn='ping google.com --apple-time'
pingWhile(){
while true; do;
ping google.com --apple-time;
done;
}
lp(){
FILENAME="`date | tr -s \ _`.txt"
pn > $FILENAME 2>&1 &!
[[ $? == 0 ]] && tail -f $FILENAME
}
alias o='open -a'
#source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"
#source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"
#alias hg='history | grep'
function hg(){
history | grep $1 | less
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
#source /opt/homebrew/opt/powerlevel10k/powerlevel10k.zsh-theme
alias cs='gcloud cloud-shell ssh --authorize-session'
export PATH="/Users/mehul/Library/Android/sdk/platform-tools:$PATH"
export PATH="/Users/mehul/Library/Android/sdk/emulator:$PATH"
source /opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc
source /opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
alias ac='adb connect 192.168.0.100'
alias at='adb tcpip 5555'
alias atc='at && ac'
alias lt='ls -lrt'
alias wip='gaa && gcmsg wip'
alias uwip='git reset HEAD~1'
alias sn="git pull && gaa && gcmsg na && git push -u origin master"
alias lh='ls -larth'
alias grbd='gf && grb origin/dev'
alias grbom='gf && grb origin/main'
alias grbs='gf && grb staging'
alias grbos='gf && grb origin/staging'
alias grbu='grb origin/$(git_current_branch)'
alias grbc='grb --continue'
alias grba='grb --abort'
alias gmc='gm --continue'
alias gma='gm --abort'
alias gcpc='gcp --continue'
alias gcpa='gcp --abort'
alias fin='find . -iname'
alias fid='find . -type d -iname '
alias fen='f emulator --launch nexus'
export fen='f emulator --launch nexus'
alias ak='adb kill-server'
alias ad='adb devices'
alias fl=fastlane
alias p3=pip3
alias gs=gss
alias h=hub
alias m=man
alias ti=tig
alias rsh='ssh 192.168.0.100 -p 8022'
function grbi() {
grb -i 'head~${1}'
}
alias gshn='git show --name-only'
alias glor='glo --reverse'
alias gshw='gsh --word-diff'
alias gud='gf && gcd && gl && gco -'
alias gcd2='gco dev2'
alias gcq='gco qa'
alias gflo='gf && glo'
function fcr {
f create $1 && cd $1 && git init && git add . && git commit -m 'initial'
}
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
alias hl="history | less"
alias gi='git init && gaa && gcmsg initial'
alias gbdi='git-branch-delete'
alias gcnd='gco ndev'
export PATH="$PATH":"$HOME/.pub-cache/bin"
alias s="~/ss"
alias nig="ni -g"
alias td=todoist
alias cra="npx create-react-app"
alias cna="npx create-next-app"
alias ns="npm start"
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn
# pnpm
export PNPM_HOME="/Users/mehul/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
# pnpm end
alias p=pnpm
alias r18="nvm use 18"
alias grc="npx generate-react-cli"
## [Completion]
## Completion scripts setup. Remove the following line to uninstall
[[ -f /Users/mehul/.dart-cli-completion/zsh-config.zsh ]] && . /Users/mehul/.dart-cli-completion/zsh-config.zsh || true
## [/Completion]
alias y=yarn
alias ys="yarn start"
alias i="idea"
alias n=npm
alias nr=npm\ run
alias l=ls\ -lrth
file-to-clipboard() {
osascript \
-e 'on run args' \
-e 'set the clipboard to POSIX file (first item of args)' \
-e end \
"$@"
}
export PATH="/opt/homebrew/bin:$PATH"
#alias f=fvm\ flutter
export PATH="/Users/mehul/fvm/versions/3.3.10/bin:$PATH"
export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"
export CPPFLAGS="-I/opt/homebrew/opt/openjdk@11/include"
export JAVA_HOME="/opt/homebrew/opt/openjdk@11"
alias dl=~/Downloads
export LANG=en_US.UTF-8
alias grhhcb="grhh origin/$(git_current_branch)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment