Skip to content

Instantly share code, notes, and snippets.

@ghasemdev
Last active September 5, 2022 11:50
Show Gist options
  • Save ghasemdev/fa1e9b0f88a52b750040bdfb22c2f2c7 to your computer and use it in GitHub Desktop.
Save ghasemdev/fa1e9b0f88a52b750040bdfb22c2f2c7 to your computer and use it in GitHub Desktop.
Terminal Configure
# Inserts a blank line between shell prompts
add_newline = false
# Disable the package module, hiding it from the prompt completely
[package]
disabled = true
# Exec time
command_timeout=5000
[cmd_duration]
min_time = 2000
format = "⌛[$duration](bold yellow) "
# [character]
# success_symbol = "[➜](bold green) "
# error_symbol = "[✗](bold red) "
# success_symbol = "[➜](bold green) "
# error_symbol = "[➜](bold red) "
# Languages
[dart]
style = "bold 87"
format = "via [🎯 2.17]($style)"
[golang]
style = "bold 51"
format = "via [🐹 1.18.3]($style)"
[java]
style = "bold 172"
format = "via [${symbol}(${version} )]($style)"
[kotlin]
symbol = "🟣"
style = "bold 127"
format = "via [$symbol 1.7.0 ]($style)"
[python]
style = "bold 27"
format = 'via [${symbol}${pyenv_prefix}3.10.5 (\($virtualenv\) )]($style)'
[conda]
symbol = "🐍 "
# Git
[git_branch]
symbol = "🌱 "
[git_commit]
tag_symbol = "🔖 "
[git_state]
cherry_pick = "[🍒 PICKING](bold red)"
[git_status]
conflicted = "⚔ "
ahead = "🏎️ ×${count} "
behind = "🐢 ×${count} "
diverged = "🏎️ ×${ahead_count} 🐢 ×${behind_count} "
untracked = "🛤️ ×${count} "
stashed = "📦 "
modified = "✏ ×${count} "
staged = "🗃️ ×${count} "
renamed = "📛 ×${count} "
deleted = "🗑️ ×${count} "
style = "bright-white"
format = "$all_status$ahead_behind"
[battery]
full_symbol = "🔋 "
charging_symbol = "⚡ "
discharging_symbol = "💀 "
[[battery.display]]
threshold = 30
style = "bold red"
[memory_usage]
symbol = "💾 "
style = "bold dimmed white"
format = "$symbol[${ram}( | ${swap})]($style)"
threshold = 70
disabled = false
[sudo]
symbol = "🧑<200d>💻 "
# [time]
# format = '🕙[\[ $time \]]($style) '
# 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/jakode/.oh-my-zsh"
export STARSHIP_CONFIG=~/.starship/config.toml
export STARSHIP_CACHE=~/.starship/cache
export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# Theme
ZSH_THEME=""
# 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
plugins=(
adb # android programming tools
autojump # change directory fast
command-not-found # show install package name
common-aliases # aliases
debian # apt aliases
docker # continer
docker-compose # docker compose aliases
emoji # support emoji in zsh
emoji-clock # print current clock emoji
encode64 # encode or decode string
extract # extract files with 7z, zip, rar , ... format
git # git aliases
git-extras # git-extras aliases
git-flow # git-flow aliases
gitignore # git ingnore generator
golang # go aliases
gradle # android package manager
heroku # heroku aliases
history # history aliases
jump # jump file dir with mark
man # manuals
nmap # nmap aliases
pass # password store
pipenv # python environment
pylint # python linter
python # python aliases
singlechar # single char aliases
sudo # add sudo first of command
systemadmin # a system administrator's aliases
systemd # systemctl aliases
taskwarrior # command todo list
tig # git commits
tmux # terminal splitter
universalarchive # archive files
urltools # url encode and decode
vscode # vscode aliases
z # z navigation dir
zsh-autosuggestions # auto suggestions for zsh
zsh-interactive-cd # auto complete navigation
)
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='nvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Zsh alias
alias zshc="nvim ~/.zshrc"
alias zshs="source ~/.zshrc"
alias zsht='nvim ~/.starship/config.toml'
alias vimc='nvim ~/.config/nvim/init.vim'
# Terminal alias
alias '?'='echo'
alias as='alias | fzf -m | cut -d "=" -f 1 | c'
alias al='sudo apt list --installed'
alias aptu='alu;aar;aac'
alias bat='batcat'
alias btop='glances -w -B 127.0.0.1 -p 8080'
alias c='clip.exe'
alias clock='tty-clock -sct -f "%a, %d %b %Y %T %z"'
alias code='cmd.exe /c code'
alias glances='glances.exe'
alias go='go.exe'
alias wgradle='cmd.exe /c gradlew.bat'
alias gradleclean='find /mnt/c/Users/shird/.gradle -type f -atime +15 -delete; find /mnt/c/Users/shird/.gradle -mindepth 1 -type d -empty -delete'
alias kt='/mnt/c/Users/shird/AppData/Roaming/JetBrains/IntelliJIdea2021.3/plugins/Kotlin/kotlinc/bin/kotlinc'
alias nvtop='nvitop.exe -m full'
alias p='ps -f'
alias v='vim'
alias nv='nvim'
alias vsc='code `wslpath -w "$PWD"`'
alias adb='cmd.exe /c /mnt/c/Users/shird/AppData/Local/Android/Sdk/platform-tools/adb.exe'
# files alias
alias ar='ua'
alias ex='extract'
# Links2 alias
alias tmuxg='links2 https://high5.nl/gist/tmux.html'
alias lpic='links2 https://jadi.gitbooks.io/lpic1/content/'
alias vimg='links2 https://vim.rtorr.com/'
alias git-flow='links2 https://danielkummer.github.io/git-flow-cheatsheet/'
# url alias
alias ud='urldecode'
alias ue='urlencode'
# Git alias
alias gta='git tag -a'
alias gpt='git push origin --tags'
# Python alias
alias pyinstaller='pyinstaller.exe'
alias python='python.exe'
alias scrapy='scrapy.exe'
alias termgraph='termgraph.exe'
# Jupyter notebook alias
alias jupyter='jupyter.exe'
alias nb='jupyter notebook'
# Pip alias
alias pip-review='pip-review.exe'
alias pip='pip.exe'
alias pipi='pip install'
alias pipir="pip install -r requirements.txt"
alias pipl='pip list --outdated'
alias pipreq="pip freeze > requirements.txt"
alias pipu='pip install --upgrade'
alias pipua='pip-review --local --interactive'
alias pipun='pip uninstall'
# Flutter alias
alias flutter='cmd.exe /c flutter'
alias f='flutter'
alias fatt='flutter attach'
alias fbl='flutter build'
alias fch='flutter channel'
alias fcl='flutter clean'
alias fdev='flutter devices'
alias fdoc='flutter doctor'
alias femu='flutter emulators'
alias finit='flutter create'
alias frun='flutter run'
alias frund='flutter run --debug'
alias frunp='flutter run --profile'
alias frunr='flutter run --release'
alias fupg='flutter upgrade'
# Flutter pub alias
alias fpub='flutter pub'
alias fpuba='flutter pub add'
alias fpubg='flutter pub get'
alias fpubo='flutter pub outdated'
alias fpubt='flutter pub add test --dev'
alias fpubu='flutter pub upgrade'
# Dart alias
alias dart='cmd.exe /c dart'
alias d='dart'
alias dinit='dart create'
alias drun='dart run'
alias ddoc='dart doc'
alias ddev='dart devtools'
# Dart pub alias
alias dpub='dart pub'
alias dpuba='dart pub add'
alias dpubg='dart pub get'
alias dpubo='dart pub outdated'
alias dpubt='dart pub add test --dev'
alias dpubu='dart pub upgrade'
# Directory alias
alias c:='cd /mnt/c'
alias d:='cd /mnt/d'
alias e:='cd /mnt/e'
alias desktop='cd /mnt/c/Users/shird/oneDrive/Desktop'
alias explorer='explorer.exe'
alias open='explorer `wslpath -w "$PWD"`'
lfcd() {
tmp="$(mktemp)"
/home/jakode/.local/bin/lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
if [ -d "$dir" ]; then
if [ "$dir" != "$(pwd)" ]; then
cd "$dir"
fi
fi
fi
}
# Define a widget called "lfcd", mapped to our function above.
zle -N lfcd
# Bind it to 'Ctrl + O'.
bindkey '^o' lfcd
# Create shortcut for jcal
calendar() {
jcal
}
zle -N calendar
bindkey '^j' calendar
# clock
terminal_clock() {
clock
}
zle -N terminal_clock
bindkey '^t' terminal_clock
source /home/jakode/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /home/jakode/git-commit-template/zsh_gct
eval "$(starship init zsh)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment