Skip to content

Instantly share code, notes, and snippets.

@pignuante
Created July 27, 2021 08:56
Show Gist options
  • Save pignuante/6a86bcbe8a9de7ab8590c44b5d8430fa to your computer and use it in GitHub Desktop.
Save pignuante/6a86bcbe8a9de7ab8590c44b5d8430fa to your computer and use it in GitHub Desktop.
# 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="/Users/hanyul/.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"
POWERLEVEL9K_MODE='nerdfont-complete'
source /usr/local/opt/powerlevel9k/powerlevel9k.zsh-theme
# ZSH_THEME="powerlevel9k/powerlevel9k"
export KEYTIMEOUT=0.5
# 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 the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=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.
# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)
# See https://github.com/ohmyzsh/ohmyzsh/issues/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=(
# zsh-256color
git
gitignore
zsh-autosuggestions
fast-syntax-highlighting
colored-man-pages
fasd
zsh-completions
urltools
common-aliases
sudo
pip
command-not-found
alias-tips
history-substring-search
k
vi-mode # 화살표 검색이 안먹힘
)
# source ~/.zplug/init.zsh
# zplug "b4b4r07/enhancd", use:init.sh
source $ZSH/oh-my-zsh.sh
# source $HOME/k/k.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"
# setopt correct
setopt sharehistory
setopt autocd
alias vimgo='vim -u ~/.vimrc.go'
alias hy='/Users/hanyul/Dropbox/HY'
alias py="open -a /Applications/PyCharm.app"
alias clion="open -a /Applications/CLion.app"
alias webstorm="open -a /Applications/WebStorm.app"
alias gr="go run "
alias lg1="git log --show-signature --graph --abbrev-commit --decorate -- +++\format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) +++\%C(white)%s%C(reset) %C(dim white)- +++\%an%C(reset)%C(bold +++\yellow)%d%C(reset)' --all"
alias lg2="git log --graph --abbrev-commit --decorate --format=format:'%C(bold +++\blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold +++\green)(%ar)%C(reset)%C(bold +++\yellow)%d%C(reset)%n'' +++\%C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
# alias weather='curl wttr.in/seoul'
alias weather="curl wttr.in"
# alias msfs="ssh -X pignu@192.2.48.20"
alias ls="exa --icons -Fh"
alias ee="exa -abghHliS"
[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'
## enhancd
# source ~/enhancd/init.sh
## autoSuggestion
[[ -s /Users/hanyul/.autojump/etc/profile.d/autojump.sh ]] && source /Users/hanyul/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u
## zsh-completions
# autoload -U compinit && compinit
## 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
## autoPair
if [[ ! -d ~/.zsh-autopair ]]; then
git clone https://github.com/hlissner/zsh-autopair ~/.zsh-autopair
fi
source ~/.zsh-autopair/autopair.zsh
autopair-init
## RUST
export PATH="$HOME/.cargo/bin:$PATH"
##########
#### pyenv
# export PATH="/Users/hanyul/.pyenv/bin:$PATH"
# eval "$(pyenv init -)"
# eval "$(pyenv virtualenv-init -)"
# (The below instructions are intended for common
# shell setups. See the README for more guidance
# if they don't apply and/or don't work for you.)
# Add pyenv executable to PATH and
# enable shims by adding the following
# to ~/.profile and your shell's login startup file:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
# Load pyenv into the shell by adding
# the following to your shell's interactive startup file:
eval "$(pyenv init -)"
# Make sure to restart your entire logon session
# for changes to profile files to take effect.
# Load pyenv-virtualenv automatically by adding
# the following to your profile:
eval "$(pyenv virtualenv-init -)"
###########
## goenv
export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"
export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"
######################################################3
# powerlevel9k
#######################################################
# prompt_zsh_battery_level() {
# percentage=`pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f1 -d';' | grep -oe '\([0-9.]*\)'`
# local color='%F{red}'
# local symbol="\uf00d"
# if [ "$(bc <<< "scale=2 ; $percentage<25")" = '1' ]
# then symbol="\uf244" ; color='%F{red}' ;
# #Less than 25
# fi
# if [ "$(bc <<< "scale=2 ; $percentage>=25")" = '1' ] && [ "$(bc <<< "scale=2 ; $percentage<50")" = '1' ]
# then symbol='\uf243' ; color='%F{red}' ;
# #25%
# fi
# if [ "$(bc <<< "scale=2 ; $percentage>=50")" = '1' ] && [ "$(bc <<< "scale=2 ; $percentage<75")" = '1' ]
# then symbol="\uf242" ; color='%F{yellow}' ;
# #50%
# fi
# if [ "$(bc <<< "scale=2 ; $percentage>=75")" = '1' ] && [ "$(bc <<< "scale=2 ; $percentage<100")" = '1' ]
# then symbol="\uf241" ; color='%F{blue}' ;
# #75%
# fi
# if [ "$(bc <<< "scale=2 ; $percentage>99")" = '1' ]
# then symbol="\uf240" ; color='%F{green}' ;
# #100%
# fi
# pmset -g batt | grep "discharging" >& /dev/null
# if [ $? -eq 0 ]; then
# true;
# else ;
# color='%F{green}' ;
# fi
# echo -n "%{$color%}$symbol "
# }
# OS segment
POWERLEVEL9K_OS_ICON_BACKGROUND="white"
POWERLEVEL9K_OS_ICON_FOREGROUND="blue"
# Dirs
POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
# right status
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
# Double-Lined Prompt
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="%F{014}╭%F{cyan}"
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%K{white}%F{black} \uF311 %f%k%F{white}%f "
# Context
POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND='greenyellow'
POWERLEVEL9K_CONTEXT_TEMPLATE="%F{black}%n%f"
POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND='orchid1'
# Status
POWERLEVEL9K_STATUS_VERBOSE=true
POWERLEVEL9K_STATUS_CROSS=true
# Double-Lined Prompt
# POWERLEVEL9K_PROMPT_ON_NEWLINE=true
# POWERLEVEL9K_RPROMPT_ON_NEWLINE=false
# POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="%F{014}╭%F{cyan}"
# POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{014}\u2570%F{cyan}\uF460%F{073}\uF460%F{109}\uF460%f "
## battery
# POWERLEVEL9K_BATTERY_CHARGING='yellow'
# POWERLEVEL9K_BATTERY_CHARGED='green'
# POWERLEVEL9K_BATTERY_DISCONNECTED='$DEFAULT_COLOR'
# POWERLEVEL9K_BATTERY_LOW_THRESHOLD='10'
# POWERLEVEL9K_BATTERY_LOW_COLOR='red'
# POWERLEVEL9K_BATTERY_BACKGROUND="green"
# POWERLEVEL9K_BATTERY_ICON=`prompt_zsh_battery_level`
## Time
POWERLEVEL9K_TIME_FORMAT="%D{\uf017 %H:%M \uf073 %y.%m.%d}"
POWERLEVEL9K_TIME_BACKGROUND='blue'
## network
# POWERLEVEL9K_NETWORK_ICON=`zsh_internet_signal`
# POWERLEVEL9K_CUSTOM_INTERNET_SIGNAL="zsh_internet_signal"
## Vi-Mode
# POWERLEVEL9K_VI_MODE_INSERT_BACKGROUND='005'
# POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND='236'
# POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND='245'
# POWERLEVEL9K_VI_MODE_NORMAL_FOREGROUND='236'
# POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_BACKGROUND="blue"
# POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_FOREGROUND="yellow"
# zsh_wifi_signal(){
# local output=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I)
# local airport=$(echo $output | grep 'AirPort' | awk -F': ' '{print $2}')
# if [ "$airport" = "Off" ]; then
# local color='%F{yellow}'
# echo -n "%{$color%}Wifi Off"
# else
# local ssid=$(echo $output | grep ' SSID' | awk -F': ' '{print $2}')
# local speed=$(echo $output | grep 'lastTxRate' | awk -F': ' '{print $2}')
# local color='%F{yellow}'
# [[ $speed -gt 100 ]] && color='%F{green}'
# [[ $speed -lt 50 ]] && color='%F{red}'
# echo -n "%{$color%}\uf424 %{%f%}$speed Mb/s%{%f%}" # removed char not in my PowerLine font
# fi
# }
# zsh_internet_signal(){
# #source on quality levels - http://www.wireless-nets.com/resources/tutorials/define_SNR_values.html
# #source on signal levels - http://www.speedguide.net/faq/how-to-read-rssisignal-and-snrnoise-ratings-440
# local signal=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep agrCtlRSSI | awk '{print $2}' | sed 's/-//g')
# local noise=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep agrCtlNoise | awk '{print $2}' | sed 's/-//g')
# local SNR=$(bc <<<"scale=2; $signal / $noise")
# local net=$(curl -D- -o /dev/null -s http://www.google.com | grep HTTP/1.1 | awk '{print $2}')
# local color='%F{yellow}'
# local symbol="\uf197"
# # Excellent Signal (5 bars)
# if [[ ! -z "${signal// }" ]] && [[ $SNR -gt .40 ]] ;
# then color='%F{blue}' ; symbol="\uf1eb" ;
# fi
# # Good Signal (3-4 bars)
# if [[ ! -z "${signal// }" ]] && [[ ! $SNR -gt .40 ]] && [[ $SNR -gt .25 ]] ;
# then color='%F{green}' ; symbol="\uf1eb" ;
# fi
# # Low Signal (2 bars)
# if [[ ! -z "${signal// }" ]] && [[ ! $SNR -gt .25 ]] && [[ $SNR -gt .15 ]] ;
# then color='%F{yellow}' ; symbol="\uf1eb" ;
# fi
# # Very Low Signal (1 bar)
# if [[ ! -z "${signal// }" ]] && [[ ! $SNR -gt .15 ]] && [[ $SNR -gt .10 ]] ;
# then color='%F{red}' ; symbol="\uf1eb" ;
# fi
# # No Signal - No Internet
# if [[ ! -z "${signal// }" ]] && [[ ! $SNR -gt .10 ]] ;
# then color='%F{red}' ; symbol="\uf011";
# fi
# if [[ -z "${signal// }" ]] && [[ "$net" -ne 200 ]] ;
# then color='%F{red}' ; symbol="\uf011" ;
# fi
# # Ethernet Connection (no wifi, hardline)
# if [[ -z "${signal// }" ]] && [[ "$net" -eq 200 ]] ;
# then color='%F{blue}' ; symbol="\uf197" ;
# fi
# echo -n "%{$color%}$symbol " # \f1eb is wifi bars
# }
# # internet
# zsh_internet_signal(){
# #Try to ping google DNS to see if you have internet
# local net=$(ping 8.8.8.8 -c 1| grep transmitted | awk '{print $6}' | grep 0)
# local color='%F{red}'
# local symbol="\uf127"
# if [[ ! -z "$net" ]] ;
# then color='%F{green}' ; symbol="\uf1e6" ;
# fi
# echo -n "%{$color%}$symbol" # \f1eb is wifi bars
# }
# POWERLEVEL9K_CUSTOM_INTERNET_SIGNAL="zsh_internet_signal"
POWERLEVEL9K_DIR_SHOW_WRITABLE=false
POWERLEVEL9K_VI_INSERT_MODE_STRING="I"
POWERLEVEL9K_VI_COMMAND_MODE_STRING="N"
POWERLEVEL9K_PYENV_FOREGROUND="blue"
POWERLEVEL9K_PYENV_BACKGROUND="black"
# right status
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true
# POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon custom_internet_signal root_indicator context virtualenv dir_writable dir vcs)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon root_indicator context virtualenv go_version dir_writable dir vcs)
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs command_execution_time history nvm node_version time)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs history nvm node_version time)
# POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_wifi_signal os_icon root_indicator context dir_writable dir vcs)
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(history status background_jobs command_execution_time pyenv virtualenv rvm battery time vi_mode)
eval $(thefuck --alias)
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
export NODE_PATH="/usr/local/lib/node_modules"
export PATH="/usr/local/Cellar/node/v13.8.0/bin:$PATH"
## nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# autopair
if [[ ! -d ~/.zsh-autopair ]]; then
git clone https://github.com/hlissner/zsh-autopair ~/.zsh-autopair
fi
source ~/.zsh-autopair/autopair.zsh
autopair-init
## tcl-tk
# export PATH="/usr/local/opt/tcl-tk/bin:$PATH"
## bazel
source /Users/hanyul/.bazel/bin/bazel-complete.bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment