|
# Path to your oh-my-zsh installation. |
|
export ZSH=$HOME/.oh-my-zsh |
|
|
|
# Set name of the theme to load. |
|
# Look in ~/.oh-my-zsh/themes/ |
|
# Optionally, if you set this to "random", it'll load a random theme each |
|
# time that oh-my-zsh is loaded. |
|
ZSH_THEME="powerlevel10k/powerlevel10k" |
|
POWERLEVEL9K_MODE='nerdfont-complete' |
|
DEFAULT_USER=n3tn0de |
|
|
|
# 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 colorize zsh-autosuggestions macos) |
|
|
|
|
|
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( |
|
dir |
|
vcs |
|
newline |
|
ssh |
|
root_indicator |
|
context |
|
background_jobs |
|
time |
|
history |
|
status |
|
virtualenv |
|
# nvm |
|
# node_version |
|
newline |
|
os_icon |
|
) |
|
|
|
export NVM_BIN='/Users/Alexey/.nvm/versions/node/v12.7.0/bi' |
|
|
|
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(ram battery) |
|
POWERLEVEL9K_DISABLE_RPROMPT=true |
|
|
|
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true |
|
|
|
POWERLEVEL9K_CUSTOM_OS_ICON='POWERLEVEL9K_APPLE_ICON' |
|
POWERLEVEL9K_CUSTOM_OS_ICON_BACKGROUND=162 |
|
# POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='⭐️' |
|
|
|
|
|
# POWERLEVEL9K_CUSTOM_OS_ICON_FOREGROUND=white |
|
|
|
|
|
# POWERLEVEL9K_PROMPT_ON_NEWLINE=true |
|
# POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='✏️ ' |
|
# POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='' |
|
|
|
|
|
# POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 |
|
# POWERLEVEL9K_SHORTEN_STRATEGY=truncate_beginning |
|
# POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='╭─%F{blue}' |
|
# POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='╰%f ' |
|
|
|
# User configuration |
|
export HOMEBREW_NO_ANALYTICS=1 |
|
export PATH="$HOME/bin:$PATH" |
|
export PATH="/usr/local/opt/gpg-agent/bin:$PATH" |
|
export PATH="/usr/local/sbin:$PATH" |
|
export PATH="$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin" |
|
export PATH="$HOME/.composer/vendor/bin:$PATH" |
|
|
|
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib" |
|
|
|
export GOPATH=$HOME/go |
|
export PATH="$PATH:$GOPATH/bin" |
|
export PATH=$PATH:/usr/local/opt/go/libexec/bi |
|
|
|
export PATH="$PATH:$HOME/Library/Application Support/itch/apps/butler" |
|
export PATH="/usr/local/opt/sqlite/bin:$PATH" |
|
export PATH="$HOME/Library/Python/3.7/bin:$PATH" |
|
|
|
export PATH="/usr/local/opt/curl/bin:$PATH" |
|
|
|
# export NVM_DIR="$HOME/.nvm" |
|
# . "/usr/local/opt/nvm/nvm.sh" |
|
|
|
# https://www.growingwiththeweb.com/2018/01/slow-nvm-init.html |
|
# Defer initialization of nvm until nvm, node or a node-dependent command is |
|
# run. Ensure this block is only run once if .bashrc gets sourced multiple times |
|
# by checking whether __init_nvm is a function. |
|
if [ -s "/usr/local/opt/nvm/nvm.sh" ] && [ ! "$(type __init_nvm)" = function ]; then |
|
export NVM_DIR="$HOME/.nvm" |
|
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" |
|
declare -a __node_commands=($(ls -al $NVM_DIR/versions/node/*/lib/node_modules | awk '{print $9}' | awk '!NF || !seen[$0]++' | awk '/[^\.]+/' | tr '\r\n' ' ')) |
|
__node_commands+=('node' 'nvm' 'npx') |
|
function __init_nvm() { |
|
for i in "${__node_commands[@]}"; do unalias $i; done |
|
. /usr/local/opt/nvm/nvm.sh |
|
unset __node_commands |
|
unset -f __init_nvm |
|
} |
|
for i in "${__node_commands[@]}"; do alias $i='__init_nvm && '$i; done |
|
fi |
|
|
|
export NVM_BIN='system' |
|
|
|
export PATH="$HOME/.rbenv/bin:$PATH" |
|
eval "$(rbenv init -)" |
|
|
|
eval "$(thefuck --alias)" |
|
|
|
# export MANPATH="/usr/local/man:$MANPATH" |
|
|
|
source $ZSH/oh-my-zsh.sh |
|
|
|
# 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='code' |
|
fi |
|
|
|
# Compilation flags |
|
# export ARCHFLAGS="-arch x86_64" |
|
|
|
# ssh |
|
# export SSH_KEY_PATH="~/.ssh/dsa_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" |
|
|
|
function homestead() { |
|
( cd ~/Homestead && vagrant $* ) |
|
} |
|
|
|
alias ls='lsd' |
|
|
|
alias sky='. ~/bin/launchSecondSkype.sh' |
|
alias nrc='. ~/bin/newReactComponent.sh' |
|
# alias bfg='java -jar ~/bin/bfg-1.12.12.jar' |
|
alias lint='node_modules/eslint/bin/eslint.js .' |
|
alias npmls='npm list -g --depth=0' |
|
alias update-node='nvm install node --reinstall-packages-from=node' |
|
|
|
alias tre="tree -aI 'node_modules|dist|.git|.DS_Store|.idea|.svn'" |
|
alias dlweb='wget -e robots=off -r --no-parent --reject "index.html*"' |
|
alias get-yt-music-pl=" |
|
youtube-dl -x -c --embed-thumbnail --audio-format "m4a" --audio-quality 0 \ |
|
--add-metadata -o \"%(playlist)s/%(playlist_index)s. %(title)s.%(ext)s\"" |
|
alias clean-local-tm-backups='sudo tmutil thinLocalSnapshots / 107374182400 4' |
|
alias tm-logs="\ |
|
clear; printf '\e[3J' && \ |
|
log show --predicate 'subsystem == \"com.apple.TimeMachine\"' \ |
|
--info --last 24h | \ |
|
grep -F 'eMac' | \ |
|
grep -Fv 'etat' | \ |
|
awk -F']' '{print substr(\$0,1,19), \$NF}'\ |
|
" |
|
|
|
alias loc='cloc ./ --by-file-by-lang --exclude-dir=node_modules,dist,package-lock.json' |
|
|
|
alias wttr='curl -4 http://wttr.in' |
|
alias iambored='fortune | cowthink | lolcat' |
|
|
|
alias sayEn='say -v Ralph' |
|
|
|
alias smol='mpv --ytdl-format="bestvideo[height<=?720]+bestaudio/best" --autofit 480 --ontop --no-border' |
|
|
|
function drmi() { |
|
if [[ -z "$1" ]]; then |
|
echo "Specify filter!" |
|
return 1 |
|
fi |
|
docker image ls | grep $1 |
|
echo 'Sure you want delete these? (y/n)' |
|
read reallyDelete |
|
if [[ $reallyDelete == "y" ]]; then |
|
echo "Deleting in 3 seconds" |
|
sleep 3 |
|
docker image ls | grep $1 | awk '{print $3}' | xargs docker rmi $2 |
|
fi |
|
} |
|
|
|
function wbpkStats() { |
|
NODE_ENV=production webpack --profile --json > stats.json |
|
trap "rm stats.json" SIGINT |
|
webpack-bundle-analyzer stats.json |
|
} |
|
|
|
# Clear Apple log files |
|
# clearAsl() |
|
function clearAsl() { |
|
if [[ -s '/private/var/log/asl/*.asl' ]]; then |
|
rm -r /private/var/log/asl/*.asl |
|
fi |
|
} |
It's kinda messy, but whatever 乁| ・ 〰 ・ |ㄏ