-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc.mine
48 lines (35 loc) · 1.38 KB
/
zshrc.mine
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
# zsh specific settings
test ! -t 0 && return
# get path of the script being `source`'d. Per [1], `$0` works for zsh, not bash
# [1]: https://unix.stackexchange.com/a/4673/38968
# Mon Sep 7 00:25:27 PDT 2020: stopped using realpath - not supported on NetBSD
DIR="$(cd $(dirname "$0"); pwd)"
source "$DIR/common.sh"
source_rc ~/rc.d/zsh/pre '*'
source_rc ~/rc.d/sh/pre '*'
source $DIR/rc.mine
autoload -Uz colors && colors
autoload -Uz compinit && compinit
NEWLINE=$'\n'
# Fix corrupted/jumpy prompt (use `%{...%}` to escape ANSI: https://stackoverflow.com/a/10644062/695964
export PS1="%B[ %n@%M %~ ]%b %(?.%{$fg[green]%}.%{$fg[red]%})%#%{$reset_color%} ${NEWLINE}%{$fg[cyan]%}>>> %{$reset_color%}"
## zstyle ':completion:*' menu select
## zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
# To fix path completion doesn't work after '=' sign, e.g. cmd foo=<tab>
# https://www.zsh.org/mla/users/2002/msg00741.html
setopt magic_equal_subst
# To fix variable assignment with '~' expansion to $HOME.
# expected 'x=~/foo' => 'x=/home/user/foo'
# this disables zsh 'equal expansion' in filename
setopt no_equals
source_rc ~/rc.d/zsh/post '*'
source_rc ~/rc.d/sh/post '*'
bindkey -e
# (experimental) make zsh history more reliable
# https://unix.stackexchange.com/a/575102/38968
HISTSIZE=500000
SAVEHIST=500000
setopt appendhistory
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
# vim: set ft=sh: