-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzshrc
78 lines (60 loc) · 1.57 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
72
73
74
75
76
77
78
#
# -= Start of prompt setting =-
# (This part has to come from .zshrc as zellij is ifnoring zsh login)
#
# Get current branch name if inside git repo
git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null)
if [[ -n $ref ]]; then
echo "[%{$fg_bold[green]%}${ref#refs/heads/}%{$reset_color%}]"
fi
}
# Makes color constants available
autoload -U colors
colors
# Change prompt
export PS1="$(git_prompt_info)[${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%~%{$reset_color%}] "
#
# -= End of prompt setting =-
#
# disable flow control to enable C-s in vim
stty start undef
stty stop undef
# completion
autoload -Uz compinit
compinit
# automatically enter directories without cd
setopt auto_cd
# aliases
if [ -e "$HOME/.aliases" ]; then
source "$HOME/.aliases"
fi
# vi mode
bindkey -v
bindkey "^F" vi-cmd-mode
# use incremental search
bindkey "^R" history-incremental-search-backward
# add some readline keys back
bindkey "^S" beginning-of-line
bindkey "^E" end-of-line
# handy keybindings
bindkey "^P" history-search-backward
bindkey "^K" kill-line
bindkey "^Y" accept-and-hold
bindkey "^N" insert-last-word
bindkey -s "^T" "^[Isudo ^[A" # "t" for "toughguy"
# expand functions in the prompt
setopt prompt_subst
# ignore duplicate history entries
setopt histignoredups
# automatically pushd
setopt auto_pushd
export dirstacksize=5
# awesome cd movements from zshkit
setopt AUTOCD
setopt AUTOPUSHD PUSHDMINUS PUSHDSILENT PUSHDTOHOME
setopt cdablevars
# Try not to correct command line spelling
unsetopt CORRECT_ALL
# Enable extended globbing
setopt EXTENDED_GLOB