-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
99 lines (68 loc) · 2.06 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
97
98
99
#
# Configure interactive shells.
#
### Basic settings
# Custom prompt (hostname:dir username% )
if [[ -r "${HOME}/.zshrc.colorprompt" ]]; then
source "${HOME}/.zshrc.colorprompt"
else
PROMPT='%m:%1~ %n%# '
fi
# Disable Apple session restoration.
# See /private/etc/zshrc_Apple_Terminal for more details.
SHELL_SESSIONS_DISABLE=1
# Allow comments in interactive shells.
setopt INTERACTIVE_COMMENTS
### App-specific settings
# Configure Homebrew if necessary.
if [[ -r "${HOME}/.zshrc.homebrew" ]]; then
source "${HOME}/.zshrc.homebrew"
fi
### ZLE settings
# Use viins mode.
bindkey -v
# Use bash-style reverse history search.
# Default:
# bindkey -M viins '^R' redisplay
bindkey -M viins '^R' history-incremental-search-backward
# When navigating history, keep the cursor at the beginning of the line.
# Default:
# bindkey -M vicmd k up-line-or-history
# bindkey -M vicmd k down-line-or-history
bindkey -M vicmd k vi-up-line-or-history
bindkey -M vicmd j vi-down-line-or-history
### Aliases
# 06/09/2011 ls alias
alias ls='ls -FG'
# 03/10/2013 avoid annoying warnings
alias scp='scp -o "ClearAllForwardings yes"'
# 10/18/2022 output the entire history, with ISO-style timestamps
alias history='history -i 0'
# Source external alias definitions.
if [[ -r "${HOME}/.aliasrc.gvim" ]]; then
source "${HOME}/.aliasrc.gvim"
fi
### History options
# Ensure we are actually capturing history.
if [[ -z "${HISTFILE}" ]]; then
HISTFILE=${HOME}/.zsh_history
fi
# Increase the size of the History buffer.
HISTSIZE=4096
SAVEHIST=4096
# Include timestamps.
setopt EXTENDED_HISTORY
# Don't record commands prefixed with a space.
setopt HIST_IGNORE_SPACE
# Don't record invocations of the `history` command.
setopt HIST_NO_STORE
# Record to HISTFILE at command completion rather than at shell termination.
setopt INC_APPEND_HISTORY_TIME
### Completion
# Allow liberal partial pathname completion.
zstyle ':completion:*' list-suffixes
zstyle ':completion:*' expand prefix suffix
# Initialize the completion system.
autoload -Uz compinit
compinit
# vim:sw=2 ts=2 et filetype=zsh