-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdot_zshrc.tmpl
More file actions
98 lines (71 loc) · 2.43 KB
/
dot_zshrc.tmpl
File metadata and controls
98 lines (71 loc) · 2.43 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
#!/bin/zsh
# History options
export HISTSIZE=99999999
export HISTFILE=$HOME/.zsh_history
export SAVEHIST=99999999
setopt append_history
setopt inc_append_history
setopt HIST_VERIFY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_REDUCE_BLANKS
# The AUTO_PUSHD option lets you use cd to get back to any directory you've ever cd'ed to. Without this option you are only able to get back to the previous directory you've cd'ed to but with this option you can use something like cd -5 to get back to the 5th directory you've visited.
setopt AUTO_PUSHD
# Pushd
DIRSTACKSIZE=20
setopt PUSHD_IGNORE_DUPS
setopt PUSHD_TO_HOME
# Auto completion
setopt AUTO_LIST
setopt AUTO_MENU
setopt LIST_AMBIGUOUS
setopt LIST_PACKED
setopt LIST_TYPES
# Regexp
setopt BAD_PATTERN
# Internal
setopt HIST_FCNTL_LOCK
# Misc
setopt INTERACTIVE_COMMENTS
# Key bindings
bindkey -v
bindkey "^R" history-incremental-search-backward
# press M-CR to accept and keep the completion going
#bindkey '\e^M' accept-and-menu-complete
# Ctrl-E to launch line editor
autoload -U edit-command-line
zle -N edit-command-line
bindkey '^E' edit-command-line
# Automatically quote meta-characters in URLs!
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
# Tab completion changes
{{- if index . "spellcheck" }}
zstyle ':completion:*' completer _expand _complete _correct _approximate
{{- else }}
zstyle ':completion:*' completer _expand _complete
{{- end }}
zstyle :compinstall filename "${HOME}/.zshrc"
{{- if not (index . "spellcheck") }}
unsetopt correct
unsetopt correct_all
{{- end }}
{{ template "prompt.tmpl" deepCopy $ | merge (dict "shell" "zsh") }}
# Helper stuff
#setopt autocd
setopt interactivecomments # Enable comments in interactive mode (useful)
#setopt extended_glob # More powerful glob features
# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
fpath=($HOME/.local/share/zsh/site-functions $fpath)
autoload -Uz compinit
compinit
# Colours and aliases
autoload -U colors && colors
{{ template "shell-aliases.tmpl" $ }}
{{ template "shell-term-env.tmpl" $ }}
{{ template "shell-man-env.tmpl" $ }}
{{ template "dev-utils-env.tmpl" $ }}
{{ template "atuin.tmpl" deepCopy $ | merge (dict "shell" "zsh") }}
{{ template "gpg-tty.tmpl" deepCopy $ | merge (dict "shell" "zsh") }}
return # This prevents scripts which append their own installers from "working"
{{/* vim: set filetype=zsh: */}}