Skip to content

Instantly share code, notes, and snippets.

@himanshurajora
Last active September 5, 2024 08:56
Show Gist options
  • Save himanshurajora/b32becf289d37548ca360b2038f7d820 to your computer and use it in GitHub Desktop.
Save himanshurajora/b32becf289d37548ca360b2038f7d820 to your computer and use it in GitHub Desktop.
The ZSH configuration you always wanted, and I have it.
# 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"
# 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 zsh-nvm zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)
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"
source ~/powerlevel10k/powerlevel10k.zsh-theme
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# alias l='exa -l --icons'
# alias ls='exa -1 --icons'
# alias ll='exa -la --icons'
# alias ld='exa -lD --icons'
alias in='sudo pacman -S' # install package
alias un='sudo pacman -Rns' # uninstall package
alias up='sudo pacman -Syu' # update system/package/aur
alias pl='pacman -Qs' # list installed package
alias pa='pacman -Ss' # list availabe package
alias pc='sudo pacman -Sc' # remove unused cache
alias po='pacman -Qtdq | sudo pacman -Rns -' # remove unused packages, also try > pacman -Qqd | pacman -Rsu --print -
alias vc='code' # gui code editor
alias lrh="lwsm restore home"
alias lsh="lwsm save home"
alias lro="lwsm restore office"
alias lso="lwsm save office"
alias lsc="lwsm restore --closeAllOpenWindows"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
#Display specs
#neofetch
#Display Pokemon
# pokemon-colorscripts --no-title -r 1,3,6
#Display gif
#kitten icat --align left ~/.config/neofetch/pochita.gif
# Use powerline
# USE_POWERLINE="true"
# including this ensures that new gnome-terminal tabs keep the parent `pwd` !
if [ -e /etc/profile.d/vte.sh ]; then
. /etc/profile.d/vte.sh
fi
DISABLE_AUTO_TITLE="true"
function termtitle() {
echo -en "\e]2;$@\a"
}
# Source manjaro-zsh-configuration
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
source /usr/share/zsh/manjaro-zsh-config
fi
# Use manjaro zsh prompt
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
source /usr/share/zsh/manjaro-zsh-prompt
fi
# source /usr/share/nvm/init-nvm.sh
# [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
# source /usr/share/nvm/nvm.sh
# # source /usr/share/nvm/bash_completion
# source /usr/share/nvm/install-nvm-exec
# source /home/himanshu/.zsh/zsh-nvm-auto-switch/zsh-nvm-auto-switch.plugin.zsh
alias g="git status"
alias ga="git add"
alias gaa="git add ."
alias gau="git add -u"
alias gc="git commit -m"
alias gca="git commit -am"
alias gb="git branch"
alias gbd="git branch -d"
alias gco="git checkout"
alias gcob="git checkout -b"
alias gt="git stash"
alias gta="git stash apply"
alias gm="git merge"
alias gr="git rebase"
alias gl="git log --oneline --decorate --graph"
alias glog="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
alias glga="git log --graph --oneline --all --decorate"
alias gb="git branch"
alias gs="git show"
alias gd="diff --color --color-words --abbrev"
alias gdc="git diff --cached"
alias gbl="git blame"
alias gps="git push"
# Push but skip the husky workflows
alias gpsn="git push --no-verify"
alias gpl="git pull"
alias gb="git branch"
alias gc="git commit"
alias gd="git diff"
# alias go="git checkout "
alias gk="gitk --all&"
alias gx="gitx --all"
alias grm="git rebase -i main"
alias gmi="git merge -"
alias gcm="git checkout main"
alias gcd="git checkout develop"
alias gcps="gh copilot suggest"
alias gcpe="gh copilot explain"
alias dcu="docker compose up -d"
alias dcu="docker compose up -d"
alias dcd="docker compose down"
alias gx="ign = ls-files -o -i --exclude-standard"
alias grmc="git rm -r --cached"
alias l="lvim ."
alias s="ddgr"
alias ta="tmux attach-session -t"
alias tn="tmux new -s"
alias cl="clear"
alias nssd="npm run start:debug"
alias ns="npm run start"
alias nrd="npm run dev"
# junction start commands
alias ajd="cd ~/workspace/awarion/junction && docker compose up -d"
alias ajs="cd ~/workspace/awarion/junction/packages/server && nrd"
alias ajt="cd ~/workspace/awarion/junction/packages/temporal-data-server && ns"
alias ajdash="cd ~/workspace/awarion/junction/packages/dashboard && ns"
alias ajds="cd ~/workspace/awarion/junction/packages/delivery-service && nssd"
alias ajdm="cd ~/workspace/awarion/junction/packages/db-monitoring-service && nssd"
alias ajps="cd ~/workspace/awarion/junction/packages/playlist-service && nssd"
alias ajte="cd ~/workspace/awarion/junction/packages/task-executor/packages/junction && ns"
alias aja="cd ~/workspace/awarion/junction/packages/ad-server && ns"
alias ajc="cd ~/workspace/awarion/junction/packages/common && nrd"
alias cw="cd ~/workspace"
alias ct="cd ~/test"
alias acd="cd ~/workspace/awarion/centrum && docker compose up -d"
alias acs="nvm install 12 && cd ~/workspace/awarion/centrum/apps/server && nrd"
alias acsdash="nvm install 12 && cd ~/workspace/awarion/centrum/apps/supplier-dashboard && ns"
alias acds="nvm install 18 && cd ~/workspace/awarion/centrum/apps/delivery-service && nssd"
alias acdm="nvm install 18 && cd ~/workspace/awarion/centrum/apps/db-monitoring-service && nssd"
alias acps="nvm install 18 && cd ~/workspace/awarion/centrum/apps/playlist-service && nssd"
alias acte="nvm install 12 && cd ~/workspace/awarion/centrum/apps/task-executor && ns"
alias acdm="nvm install 18 && cd ~/workspace/awarion/centrum/apps/db-monitoring-service && nssd"
alias acc="nvm install 18 && cd ~/workspace/awarion/centrum/apps/common && nrd"
# pnpm
# pnpm
export PNPM_HOME="/home/himanshu/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"
# pnpm end
export ANDROID_HOME=$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
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/himanshu/Downloads/google-cloud-cli-428.0.0-linux-x86_64/google-cloud-sdk/path.zsh.inc' ]; then . '/home/himanshu/Downloads/google-cloud-cli-428.0.0-linux-x86_64/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/home/himanshu/Downloads/google-cloud-cli-428.0.0-linux-x86_64/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/himanshu/Downloads/google-cloud-cli-428.0.0-linux-x86_64/google-cloud-sdk/completion.zsh.inc'; fi
# bun completions
[ -s "/home/himanshu/.bun/_bun" ] && source "/home/himanshu/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
export PATH="$PATH:/home/himanshu/.dotnet"
export FLYCTL_INSTALL="/home/himanshu/.fly"
export PATH="$FLYCTL_INSTALL/bin:$PATH"
export PATH="/home/himanshu/.local/bin:$PATH"
# pokemon-colorscripts -n sizzlipede --no-title
export PATH=$PATH:/home/himanshu/.cargo/bin
# tabtab source for electron-forge package
# uninstall by removing these lines or running `tabtab uninstall electron-forge`
[[ -f /home/himanshu/workspace/hand-scroll/node_modules/.pnpm/[email protected]/node_modules/tabtab/.completions/electron-forge.zsh ]] && . /home/himanshu/workspace/hand-scroll/node_modules/.pnpm/[email protected]/node_modules/tabtab/.completions/electron-forge.zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment