-
Notifications
You must be signed in to change notification settings - Fork 52
/
rootzshrc
69 lines (65 loc) · 3.96 KB
/
rootzshrc
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
## Options section
setopt extendedglob # Extended globbing. Allows using regular expressions with *
setopt nocaseglob # Case insensitive globbing
setopt rcexpandparam # Array expension with parameters
setopt nocheckjobs # Don't warn about running processes when exiting
setopt numericglobsort # Sort filenames numerically when it makes sense
setopt nobeep # No beep
setopt incappendhistory # Immediately append history instead of overwriting
setopt histignorealldups # If a new command is a duplicate, remove the older one
setopt autocd # If only directory path is entered, cd there
setopt interactivecomments # Allow comments even in interactive shells
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' # Case insensitive tab completion
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc)
zstyle ':completion:*' rehash true # automatically find new executables in path
HISTFILE=~/.zhistory
HISTSIZE=1000
SAVEHIST=500
export EDITOR=/usr/bin/nano
export VISUAL=/usr/bin/nano
WORDCHARS=${WORDCHARS//[\/&.;]} # Don't consider certain characters part of the word
alias cp="cp -i"
## Keybindings section
bindkey -e
bindkey '^[[H' beginning-of-line # Home key (xterm)
bindkey '^[[OH' beginning-of-line # Home key (smkx mode)
bindkey '^[[1~' beginning-of-line # Home key (screen & tmux)
bindkey '^[[7~' beginning-of-line # Home key (urxvt)
bindkey '^[[F' end-of-line # End key (xterm)
bindkey '^[[OF' end-of-line # End key (smkx mode)
bindkey '^[[4~' end-of-line # End key (screen & tmux)
bindkey '^[[8~' end-of-line # End key (urxvt)
bindkey '^[[2~' overwrite-mode # Insert key
bindkey '^[[3~' delete-char # Delete key
bindkey '^[[C' forward-char # Right key
bindkey '^[[D' backward-char # Left key
bindkey '^[[5~' history-beginning-search-backward # Page up key
bindkey '^[[6~' history-beginning-search-forward # Page down key
bindkey '^[[A' up-line-or-history # Up key
bindkey '^[[B' down-line-or-history # Down key
# Navigate words with ctrl+arrow keys
bindkey '^[Oc' forward-word #
bindkey '^[Od' backward-word #
bindkey '^[[1;5D' backward-word #
bindkey '^[[1;5C' forward-word #
bindkey '^H' backward-kill-word # delete previous word with ctrl+backspace
bindkey '^[[Z' undo # Shift+tab undo last action
## Theming section
autoload -Uz compinit colors zcalc
compinit
colors
# enable substitution for prompt
setopt prompt_subst
# bash style prompt
PROMPT='[%n@%m %1~]%# '
# Right prompt with exit status of previous command if not successful
RPROMPT='%(?..%F{red}[%?]%f)'
# Color man pages
export LESS_TERMCAP_mb=$'\E[01;32m'
export LESS_TERMCAP_md=$'\E[01;32m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;47;34m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;36m'
export LESS=-r