-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
159 lines (137 loc) · 5.01 KB
/
.zshrc
File metadata and controls
159 lines (137 loc) · 5.01 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# nikhil's zshrc
# created 17 June 2009
# --------
# thanks to srobertson's zshrc (http://bitbucket.org/srobertson/rc-files)
# --------
# don't start in /
if [ "`pwd`" = '/' ]; then
cd
fi
# X11 settings for XMonad
export PATH=/Users/nikhil/.cabal/bin:$PATH
export USERWM=$(which xmonad)
# environment variables
source $HOME/.env
# aliases
source $HOME/.aliases
autoload -U colors
colors
# The following lines were added by compinstall
zstyle ':completion:*' cache-path ~/.zsh_cache
zstyle ':completion:*' completer _list _complete _ignored _approximate
zstyle ':completion:*' condition 0
zstyle ':completion:*' expand prefix suffix
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' list-suffixes true
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]} r:|[._-]=* r:|=*' 'm:{[:lower:]}={[:upper:]}'
zstyle ':completion:*' max-errors 2
zstyle ':completion:*' menu select=3
zstyle ':completion:*' preserve-prefix '//[^/]##/'
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-cache on
zstyle ':completion:*' verbose true
zstyle ':completion:*' cache-path ~/.zsh_cache
# Processes
zstyle ':completion:*:processes' command 'ps -axw'
zstyle ':completion:*:processes-names' command 'ps -awxho command'
# My Scripts
zstyle ':completion:*:*:rarstream.py:*' file-patterns \
'*.rar:rar-files' '%p:all-files'
zstyle ':completion:*:*:play.py:*' file-patterns \
'*.(avi|mkv|mp4):movie-files' '%p:all-files'
zstyle :compinstall filename '/home/nikhil/.zshrc'
autoload -Uz compinit
compinit
###############
# ZSH OPTIONS #
###############
# Changing Directories
setopt AUTO_PUSHD # make cd push old directory onto dir stack
setopt PUSHD_IGNORE_DUPS # don't push multiple copies of the same dir onto the dir stack
# Completion
setopt COMPLETE_ALIASES # complete aliases before command is run
setopt MENU_COMPLETE # use menu to select from completions
# Expansion and Globbing
setopt GLOB # glob files
setopt MARK_DIRS # append / to directories when globbing
# History
setopt INC_APPEND_HISTORY # append to same history file and don't wait for shell exit to write history
setopt EXTENDED_HISTORY # put timestamps in history
setopt HIST_FIND_NO_DUPS # don't display duplicates when searching through history in line editor
# Input/Output
setopt HASH_CMDS # hash commands to avoid lots of PATH searches
setopt HASH_DIRS # hash dirs containing commands used
# Job Control
unsetopt BG_NICE # don't nice bg commands
setopt AUTO_CONTINUE # automatically continue disowned jobs
# Allow Prompt Substitution
setopt PROMPT_SUBST
# Autoload zsh functions
fpath=(~/.zsh/functions $fpath)
autoload -U ~/.zsh/functions/*(:t)
# Enable auto-execution of functions.
typeset -ga preexec_functions
typeset -ga precmd_functions
typeset -ga chpwd_functions
# Append git functions needed for prompt
preexec_functions+='preexec_update_git_vars'
precmd_functions+='precmd_update_git_vars'
chpwd_functions+='chpwd_update_git_vars'
# Prompt
# autoload colors zsh/terminfo
# if [[ "$terminfo[colors]" -ge 8 ]]; then
# colors
# fi
# for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
# eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
# eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
# (( count = $count + 1 ))
# done
# PR_NO_COLOR="%{$terminfo[sgr0]%}"
# prompt_setup () {
# prompt_base=${1:-'blue'}
# prompt_user=${2:-'green'}
# prompt_root=${3:-'red'}
#
# if [ "`whoami`" = "root" ]; then
# base_prompt="%B%F{$prompt_root}%m%k$PR_NO_COLOR"
# else
# base_prompt="%B%F{$prompt_user}$PR_BLUE%U%n%u$PR_NO_COLOR@$PR_GREEN%m%k$PR_NO_COLOR"
# fi
# post_prompt="%b%f%k"
# path_prompt="%B%F{$prompt_base}:$PR_RED%3~$PR_NO_COLOR"
# PROMPT="$base_prompt$path_prompt (prompt_git_info) %# $post_prompt"
# }
#
# if [ -n "SSH_CLIENT" ]; then
# prompt_setup gray
# else
# prompt_setup blue
# fi # taken from srobertson's zshrc
#
# if [ $TERM = "xterm" -o $TERM = "xterm-color" ]; then
# precmd() { print -Pn "\e]0;%m:%~\a" }
# preexec () { print -Pn "\e]0;$1\a" }
# fi # taken from srobertson's zshrc
# Set the prompt.
PROMPT=$'%{${fg[cyan]}%}%B%~%b$(prompt_git_info)%{${fg[default]}%} '
# Zle (line editor)
unsetopt BEEP # don't beep
bindkey -v # vi bindings
bindkey '^r' history-incremental-search-backward
bindkey '\e[1~' beginning-of-line
bindkey '\e[7~' beginning-of-line
bindkey '\eOH' beginning-of-line
bindkey '\e[H' beginning-of-line
bindkey '^A' beginning-of-line
bindkey '\e[4~' end-of-line
bindkey '\e[8~' end-of-line
bindkey '\eOF' end-of-line
bindkey '\e[F' end-of-line
bindkey '^E' end-of-line
bindkey '\e[3~' delete-char
bindkey '^?' backward-delete-char
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
# vim:set ft=zsh