-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathzshrc
96 lines (76 loc) · 2.14 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Config File for ZSH
# Prompt related configuration
function git_stuff(){
branch=$(git branch 2> /dev/null | grep '\*' | awk '{print ($2)}')
if [ ! -z "$branch" ]; then
st=$(git status --short)
if [ -z "$st" ]; then
echo "%F{green}$branch"
else
echo "%F{red}$branch"
fi
fi
}
PROMPT='
%F{blue}%S %B%1~%b%F{blue} %s ▶%f '
RPROMPT='$(git_stuff)'
# reevaluate prompt every time
setopt promptsubst
# appends cd in front of a directory name
setopt autocd
# allow to make a beep noise
setopt beep
# glob based on ~
setopt extendedglob
# if no match found, show a error line
setopt nomatch
#
setopt notify
# vim like key bindings
bindkey -v
# If we have a glob, this will expand it
setopt glob_complete
setopt pushd_minus
# case insensitive glob
setopt no_case_glob
# command completion
autoload -U compinit
compinit
# autocomplete with keyboard
zstyle ':completion:*' menu select
# case insensitive completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# generate description with magic
zstyle ':completion:*' auto-description 'specify: %d'
# autocompletion for command line switches for alias
setopt completealiases
# history related settings
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory
# prevent duplicate lines in history
setopt hist_save_no_dups
setopt hist_ignore_all_dups
setopt hist_find_no_dups
# write to history after each command
setopt inc_append_history
bindkey "^F" history-beginning-search-forward
bindkey "^R" history-incremental-search-backward
# rehash automatically so new files in $PATH are found
zstyle ':completion:*' rehash true
# disable "flow control" (flow control locks terminal when pressing ctrl+s
stty -ixon
# The following lines were added by compinstall
zstyle :compinstall filename '/home/dharmin/.zshrc'
# End of lines added by compinstall
# function zle-line-init zle-keymap-select {
# RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
# RPS2=$RPS1
# zle reset-prompt
# }
# zle -N zle-line-init
# zle -N zle-keymap-select
# source zsh_aliases file
source ~/dotfiles/aliases
source ~/dotfiles/source_list