-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
71 lines (55 loc) · 1.53 KB
/
.zshrc
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
# Welcome
echo -ne "Welcome, It's "; date '+%A, %B %-d %Y'
# git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
# ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
# ZSH_THEME="spaceship"
ZSH_THEME="robbyrussell"
plugins=(
git
# git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
zsh-autosuggestions
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
zsh-syntax-highlighting
# git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z
zsh-z
)
source $ZSH/oh-my-zsh.sh
# alias
alias ..='cd ..'
# Node Package Manager
alias nio='ni --prefer-offline'
alias d="nr dev"
alias p="nr play"
alias l="nr lint"
alias t="nr test"
alias b="nr build"
# Git
alias gb="git branch"
alias gbd="git branch -d"
alias gc="git checkout"
alias gcb"git checkout -b"
# Check the most used commands
function muc() {
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
}
# Run ls immediately when you change directory.
function cd() {
if [ -d $1 ]; then
builtin cd $1
ls
else
echo No such file or directory: $1
fi
}
function dir() {
mkdir $1 && cd $1
}
function i() {
cd ~/i/$1
}
function f() {
cd ~/f/$1
}
function w() {
cd ~/w/$1
}