-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zsh_aliases
125 lines (100 loc) · 3.4 KB
/
.zsh_aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Change when necessary
export PATH="$PATH:$HOME/bin"
# Import constants
if [ -f ~/.bash_constants ]; then
. ~/.bash_constants
fi
# ----------------------------------------------------------------------------
# Environment variables
# ----------------------------------------------------------------------------
# Set locales
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PYTHONIOENCODING=UTF-8 # http://stackoverflow.com/a/6361471/1054939
# Tell 'ls' to be colorful
export CLICOLOR=1
# Linker library
export LD_LIBRARY_PATH='/usr/local/lib'
export EDITOR=nvim
# ----------------------------------------------------------------------------
# Aliases
# ----------------------------------------------------------------------------
# global
alias sourceb='source ~/.bashrc'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias ..='cd ..'
alias ..2='cd ../..'
alias ..3='cd ../../..'
alias ..4='cd ../../../..'
alias ..5='cd ../../../../..'
alias vi='nvim'
alias agi='ag --ignore-dir'
alias e2u='iconv -f euckr -t utf8'
alias ports='lsof -Pn -i4 | grep LISTEN'
alias rm='rm -i'
alias rmed='find . -type d -empty -delete'
# for many small files
alias rscp='rsync -r --ignore-existing --progress --rsh=ssh'
# for a few big files
alias rscpb='rsync -r --partial --progress --rsh=ssh'
alias tl='tree -L 2'
alias wgetr='wget -r --no-parent'
alias sshuttles='sshuttle -r lovit 0/0'
alias gpustats='while true; do gpustat -cp; sleep 5; done'
alias duh='du -h -d 1'
alias randfile='ls | shuf -n 1'
# zoxide
export PATH="$HOME/.local/bin:$PATH"
eval "$(zoxide init zsh)"
alias f='open .' # overwrite f
alias subl='open -a "Sublime Text"'
alias emem='sudo bash -c "sync; echo 1 > /proc/sys/vm/drop_caches"'
# github/gist
alias gistup='gistup --remote=gist --private --'
# nvm
export NVM_DIR="$HOME/.nvm"
# NOTE: The following line is VERY SLOW
alias sourcen='. "${NVM_DIR}/nvm.sh"'
# python
alias pyserv='python -m SimpleHTTPServer || python -m http.server'
alias pyprofile='python -m cProfile --sort=cumulative'
# tmux
alias ta='tmux attach -t lucypark || tmux new -s lucypark'
alias tw='tmux rename-window -t'
alias vii='vi $(fzf)'
alias weather='curl -4 wttr.in/Seoul'
# SCM Breeze
[ -s "$HOME/.scm_breeze/scm_breeze.sh" ] && source "$HOME/.scm_breeze/scm_breeze.sh"
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
alias sourcer='eval "$(rbenv init -)"'
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)" # This only sets up the path stuff
eval "$(pyenv init -)" # This makes pyenv work in the shell
eval "$(pyenv virtualenv-init -)" # Enabling virtualenv so it works natively
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_OPTS='--height 40% --reverse --border'
# ----------------------------------------------------------------------------
# Misc
# ----------------------------------------------------------------------------
# bash history logging
if [ -d "$HOME/.logs" ]; then
export HISTCONTROL=ignoredups:erasedups
shopt -s histappend
export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi'
fi
# local bash
if [ -f "$HOME/.bash_local" ]; then
. ~/.bash_local
fi
# for agnoster-zsh-theme
export DEFAULT_USER="lucypark"
# for konlpy
# export JAVA_HOME=$(/usr/libexec/java_home)
# pdflatex
# eval "$(/usr/libexec/path_helper)"