summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules12
-rw-r--r--environment/.config/environment.d/10-less.conf1
-rw-r--r--environment/.config/environment.d/99-defaults.conf4
l---------zsh/.config/zsh/.zlogin1
l---------zsh/.config/zsh/.zlogout1
m---------zsh/.config/zsh/.zprezto0
-rw-r--r--zsh/.config/zsh/.zpreztorc253
l---------zsh/.config/zsh/.zprofile1
-rw-r--r--[l---------]zsh/.config/zsh/.zshenv8
-rw-r--r--zsh/.config/zsh/.zshrc31
-rw-r--r--zsh/.config/zsh/aliases.zsh28
-rw-r--r--zsh/.config/zsh/bracketed-paste.zsh12
-rw-r--r--zsh/.config/zsh/colors.zsh48
-rw-r--r--zsh/.config/zsh/completions.zsh112
-rw-r--r--zsh/.config/zsh/help.zsh6
-rw-r--r--zsh/.config/zsh/history.zsh3
-rw-r--r--zsh/.config/zsh/keybinds.zsh42
-rw-r--r--zsh/.config/zsh/opts.zsh146
m---------zsh/.config/zsh/p10k0
-rw-r--r--zsh/.config/zsh/ssh-agent.zsh29
-rw-r--r--zsh/.config/zsh/termtitle.zsh12
m---------zsh/.config/zsh/zsh-autosuggestions0
m---------zsh/.config/zsh/zsh-syntax-highlighting0
l---------[-rw-r--r--]zsh/.zshenv8
24 files changed, 488 insertions, 270 deletions
diff --git a/.gitmodules b/.gitmodules
index ce1794f..1d373fa 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,9 @@
1[submodule "zsh/.config/zsh/.zprezto"] 1[submodule "zsh/.config/zsh/p10k"]
2 path = zsh/.config/zsh/.zprezto 2 path = zsh/.config/zsh/p10k
3 url = https://github.com/sorin-ionescu/prezto.git 3 url = https://github.com/romkatv/powerlevel10k.git
4[submodule "zsh/.config/zsh/zsh-syntax-highlighting"]
5 path = zsh/.config/zsh/zsh-syntax-highlighting
6 url = https://github.com/zsh-users/zsh-syntax-highlighting
7[submodule "zsh/.config/zsh/zsh-autosuggestions"]
8 path = zsh/.config/zsh/zsh-autosuggestions
9 url = https://github.com/zsh-users/zsh-autosuggestions
diff --git a/environment/.config/environment.d/10-less.conf b/environment/.config/environment.d/10-less.conf
new file mode 100644
index 0000000..c282850
--- /dev/null
+++ b/environment/.config/environment.d/10-less.conf
@@ -0,0 +1 @@
LESS=-giMRSwz-4
diff --git a/environment/.config/environment.d/99-defaults.conf b/environment/.config/environment.d/99-defaults.conf
new file mode 100644
index 0000000..ca96b16
--- /dev/null
+++ b/environment/.config/environment.d/99-defaults.conf
@@ -0,0 +1,4 @@
1EDITOR=${EDITOR:-emacs}
2VISUAL=${VISUAL:-emacs}
3PAGER=${PAGER:-less}
4LANG=${LANG:-en_US.UTF-8}
diff --git a/zsh/.config/zsh/.zlogin b/zsh/.config/zsh/.zlogin
deleted file mode 120000
index 5765ab0..0000000
--- a/zsh/.config/zsh/.zlogin
+++ /dev/null
@@ -1 +0,0 @@
1.zprezto/runcoms/zlogin \ No newline at end of file
diff --git a/zsh/.config/zsh/.zlogout b/zsh/.config/zsh/.zlogout
deleted file mode 120000
index 8f76c74..0000000
--- a/zsh/.config/zsh/.zlogout
+++ /dev/null
@@ -1 +0,0 @@
1.zprezto/runcoms/zlogout \ No newline at end of file
diff --git a/zsh/.config/zsh/.zprezto b/zsh/.config/zsh/.zprezto
deleted file mode 160000
Subproject 6e564503f1c5e6ddba2bcf5d9065e5872ca207d
diff --git a/zsh/.config/zsh/.zpreztorc b/zsh/.config/zsh/.zpreztorc
deleted file mode 100644
index 294a989..0000000
--- a/zsh/.config/zsh/.zpreztorc
+++ /dev/null
@@ -1,253 +0,0 @@
1# -*- sh -*-
2
3# Set case-sensitivity for completion, history lookup, etc.
4zstyle ':prezto:*:*' case-sensitive 'no'
5
6# Color output (auto set to 'no' on dumb terminals).
7zstyle ':prezto:*:*' color 'yes'
8
9# Add additional directories to load prezto modules from
10# zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib
11
12# Allow module overrides when pmodule-dirs causes module name collisions
13# zstyle ':prezto:load' pmodule-allow-overrides 'yes'
14
15# Set the Zsh modules to load (man zshmodules).
16# zstyle ':prezto:load' zmodule 'attr' 'stat'
17
18# Set the Zsh functions to load (man zshcontrib).
19# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
20
21# Set the Prezto modules to load (browse modules).
22# The order matters.
23zstyle ':prezto:load' pmodule \
24 'environment' \
25 'terminal' \
26 'editor' \
27 'history' \
28 'spectrum' \
29 'utility' \
30 'prompt' \
31 \
32 'syntax-highlighting' \
33 'autosuggestions' \
34 \
35 'git' \
36 'rsync' \
37 'ssh' \
38 \
39 'completion'
40
41#
42# Autosuggestions
43#
44
45# Set the query found color.
46# zstyle ':prezto:module:autosuggestions:color' found ''
47
48#
49# Completions
50#
51
52# Set the entries to ignore in static '/etc/hosts' for host completion.
53# zstyle ':prezto:module:completion:*:hosts' etc-host-ignores \
54# '0.0.0.0' '127.0.0.1'
55
56#
57# Editor
58#
59
60# Set the characters that are considered to be part of a word.
61# zstyle ':prezto:module:editor' wordchars '*?_-.[]~&;!#$%^(){}<>'
62
63# Set the key mapping style to 'emacs' or 'vi'.
64zstyle ':prezto:module:editor' key-bindings 'emacs'
65
66# Auto convert .... to ../..
67zstyle ':prezto:module:editor' dot-expansion 'yes'
68
69# Allow the zsh prompt context to be shown.
70#zstyle ':prezto:module:editor' ps-context 'yes'
71
72#
73# Git
74#
75
76# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'.
77zstyle ':prezto:module:git:status:ignore' submodules 'none'
78
79#
80# GNU Utility
81#
82
83# Set the command prefix on non-GNU systems.
84# zstyle ':prezto:module:gnu-utility' prefix 'g'
85
86#
87# History
88#
89
90# Set the file to save the history in when an interactive shell exits.
91zstyle ':prezto:module:history' histfile "${ZDOTDIR:-$HOME}/.zsh_history"
92
93# Set the maximum number of events stored in the internal history list.
94zstyle ':prezto:module:history' histsize 10000
95
96# Set the maximum number of history events to save in the history file.
97zstyle ':prezto:module:history' savehist 10000
98
99#
100# History Substring Search
101#
102
103# Set the query found color.
104# zstyle ':prezto:module:history-substring-search:color' found ''
105
106# Set the query not found color.
107# zstyle ':prezto:module:history-substring-search:color' not-found ''
108
109# Set the search globbing flags.
110# zstyle ':prezto:module:history-substring-search' globbing-flags ''
111
112# Enable search case-sensitivity.
113zstyle ':prezto:module:history-substring-search' case-sensitive 'no'
114
115# Enable search for fuzzy matches.
116zstyle ':prezto:module:history-substring-search' fuzzy 'yes'
117
118# Enable search uniqueness.
119# zstyle ':prezto:module:history-substring-search' unique 'yes'
120
121# Enable prefixed search.
122# zstyle ':prezto:module:history-substring-search' prefixed 'yes'
123
124#
125# macOS
126#
127
128# Set the keyword used by `mand` to open man pages in Dash.app
129# zstyle ':prezto:module:osx:man' dash-keyword 'manpages'
130
131#
132# Pacman
133#
134
135# Set the Pacman frontend.
136# zstyle ':prezto:module:pacman' frontend 'yaourt'
137
138#
139# Prompt
140#
141
142# Set the prompt theme to load.
143# Setting it to 'random' loads a random theme.
144# Auto set to 'off' on dumb terminals.
145zstyle ':prezto:module:prompt' theme 'powerlevel10k'
146
147# Set the working directory prompt display length.
148# By default, it is set to 'short'. Set it to 'long' (without '~' expansion)
149# for longer or 'full' (with '~' expansion) for even longer prompt display.
150zstyle ':prezto:module:prompt' pwd-length 'short'
151
152# Set the prompt to display the return code along with an indicator for non-zero
153# return codes. This is not supported by all prompts.
154zstyle ':prezto:module:prompt' show-return-val 'yes'
155
156#
157# Python
158#
159
160# Auto switch the Python virtualenv on directory change.
161zstyle ':prezto:module:python:virtualenv' auto-switch 'yes'
162
163# Automatically initialize virtualenvwrapper if pre-requisites are met.
164zstyle ':prezto:module:python:virtualenv' initialize 'yes'
165
166#
167# Ruby
168#
169
170# Auto switch the Ruby version on directory change.
171zstyle ':prezto:module:ruby:chruby' auto-switch 'yes'
172
173#
174# Screen
175#
176
177# Auto start a session when Zsh is launched in a local terminal.
178# zstyle ':prezto:module:screen:auto-start' local 'yes'
179
180# Auto start a session when Zsh is launched in a SSH connection.
181# zstyle ':prezto:module:screen:auto-start' remote 'yes'
182
183#
184# SSH
185#
186
187# Set the SSH identities to load into the agent.
188# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github'
189
190#
191# Syntax Highlighting
192#
193
194# Set syntax highlighters.
195# By default, only the main highlighter is enabled.
196zstyle ':prezto:module:syntax-highlighting' highlighters \
197 'main' \
198 'brackets' \
199 'pattern' \
200 'line' \
201 'cursor' \
202 'root'
203
204# Set syntax highlighting styles.
205# zstyle ':prezto:module:syntax-highlighting' styles \
206# 'builtin' 'bg=blue' \
207# 'command' 'bg=blue' \
208# 'function' 'bg=blue'
209#
210# Set syntax pattern styles.
211# zstyle ':prezto:module:syntax-highlighting' pattern \
212# 'rm*-rf*' 'fg=white,bold,bg=red'
213
214#
215# Terminal
216#
217
218# Auto set the tab and window titles.
219zstyle ':prezto:module:terminal' auto-title 'yes'
220
221# Set the window title format.
222# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
223
224# Set the tab title format.
225# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
226
227# Set the terminal multiplexer title format.
228# zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
229
230#
231# Tmux
232#
233
234# Auto start a session when Zsh is launched in a local terminal.
235# zstyle ':prezto:module:tmux:auto-start' local 'yes'
236
237# Auto start a session when Zsh is launched in a SSH connection.
238# zstyle ':prezto:module:tmux:auto-start' remote 'yes'
239
240# Integrate with iTerm2.
241# zstyle ':prezto:module:tmux:iterm' integrate 'yes'
242
243# Set the default session name:
244# zstyle ':prezto:module:tmux:session' name 'YOUR DEFAULT SESSION NAME'
245
246#
247# Utility
248#
249
250# Enabled safe options. This aliases cp, ln, mv and rm so that they prompt
251# before deleting or overwriting files. Set to 'no' to disable this safer
252# behavior.
253zstyle ':prezto:module:utility' safe-ops 'yes'
diff --git a/zsh/.config/zsh/.zprofile b/zsh/.config/zsh/.zprofile
deleted file mode 120000
index b085555..0000000
--- a/zsh/.config/zsh/.zprofile
+++ /dev/null
@@ -1 +0,0 @@
1.zprezto/runcoms/zprofile \ No newline at end of file
diff --git a/zsh/.config/zsh/.zshenv b/zsh/.config/zsh/.zshenv
index 2ffffef..0a89f85 120000..100644
--- a/zsh/.config/zsh/.zshenv
+++ b/zsh/.config/zsh/.zshenv
@@ -1 +1,7 @@
1.zprezto/runcoms/zshenv \ No newline at end of file 1__CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
2
3setopt ALL_EXPORT
4for f in $(echo "$__CONF_DIR"/environment.d/*.conf | sort); do
5 source "$f"
6done
7unsetopt ALL_EXPORT
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc
index 81e9c2e..7845b6f 100644
--- a/zsh/.config/zsh/.zshrc
+++ b/zsh/.config/zsh/.zshrc
@@ -5,7 +5,32 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
5 source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 5 source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
6fi 6fi
7 7
8# Source Prezto 8if [ -x "/home/linuxbrew/.linuxbrew/bin/brew" ]; then
9source ~/.config/zsh/.zprezto/runcoms/zshrc 9 eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv zsh)"
10elif [ -x "/opt/homebrew/bin/brew" ]; then
11 eval "$(/opt/homebrew/bin/brew shellenv zsh)"
12fi
13
14source ~/.config/zsh/opts.zsh
15
16source ~/.config/zsh/aliases.zsh
17source ~/.config/zsh/bracketed-paste.zsh
18source ~/.config/zsh/colors.zsh
19source ~/.config/zsh/help.zsh
20source ~/.config/zsh/history.zsh
21source ~/.config/zsh/keybinds.zsh
22source ~/.config/zsh/ssh-agent.zsh
23source ~/.config/zsh/termtitle.zsh
24
25source ~/.config/zsh/completions.zsh # Depends on colors.zsh
26
27# External stuffs :)
28
29source ~/.config/zsh/p10k/powerlevel10k.zsh-theme
30source ~/.config/zsh/.p10k.zsh # Local configuration
31
32source ~/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
10 33
11source ~/.config/zsh/.p10k.zsh 34# This should be the last thing sourced in the file:
35source ~/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
36ZSH_HIGHLIGHT_HIGHLIGHTERS+=(main brackets)
diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh
new file mode 100644
index 0000000..c0c7f79
--- /dev/null
+++ b/zsh/.config/zsh/aliases.zsh
@@ -0,0 +1,28 @@
1# Disable correction.
2alias ack='nocorrect ack'
3alias cd='nocorrect cd'
4alias ebuild='nocorrect ebuild'
5alias gcc='nocorrect gcc'
6alias gist='nocorrect gist'
7alias heroku='nocorrect heroku'
8alias man='nocorrect man'
9alias mkdir='nocorrect mkdir'
10alias mysql='nocorrect mysql'
11
12# Disable globbing.
13alias bower='noglob bower'
14alias fc='noglob fc'
15alias find='noglob find'
16alias ftp='noglob ftp'
17alias history='noglob history'
18alias locate='noglob locate'
19alias rake='noglob rake'
20alias rsync='noglob rsync'
21alias scp='noglob scp'
22alias sftp='noglob sftp'
23
24# Safe ops
25alias cp="nocorrect cp -i"
26alias ln="nocorrect ln -i"
27alias mv="nocorrect mv -i"
28alias rm="nocorrect rm -i"
diff --git a/zsh/.config/zsh/bracketed-paste.zsh b/zsh/.config/zsh/bracketed-paste.zsh
new file mode 100644
index 0000000..a6bcdd3
--- /dev/null
+++ b/zsh/.config/zsh/bracketed-paste.zsh
@@ -0,0 +1,12 @@
1autoload -Uz is-at-least
2if [[ "$ZSH_VERSION" != 5.1.1 && "$TERM" != dumb ]]; then
3 if is-at-least 5.2; then
4 autoload -Uz bracketed-paste-url-magic
5 zle -N bracketed-paste bracketed-paste-url-magic
6 elif is-at-least 5.1; then
7 autoload -Uz bracketed-paste-magic
8 zle -N bracketed-paste bracketed-paste-magic
9 fi
10 autoload -Uz url-quote-magic
11 zle -N self-insert url-quote-magic
12fi
diff --git a/zsh/.config/zsh/colors.zsh b/zsh/.config/zsh/colors.zsh
new file mode 100644
index 0000000..05645c8
--- /dev/null
+++ b/zsh/.config/zsh/colors.zsh
@@ -0,0 +1,48 @@
1#
2## grep
3#
4
5if (( ! $+GREP_COLOR )); then
6 export GREP_COLOR="37;45"
7fi
8if (( ! $+GREP_COLORS )); then
9 export GREP_COLORS="mt=$GREP_COLOR"
10fi
11
12alias grep="nocorrect ${aliases[grep]:-grep} --color=auto"
13
14#
15## less
16#
17
18export LESS_TERMCAP_mb="$terminfo[blink]"
19export LESS_TERMCAP_md="$terminfo[bold]"
20export LESS_TERMCAP_me="$terminfo[sgr0]"
21
22export LESS_TERMCAP_so="$terminfo[smso]"
23export LESS_TERMCAP_se="$terminfo[rmso]"
24
25export LESS_TERMCAP_us="$terminfo[smul]"
26export LESS_TERMCAP_ue="$terminfo[rmul]"
27
28#
29## ls
30#
31
32if (( ! $+LS_COLORS )); then
33 if is-callable "dircolors"; then
34 eval "$(dircolors --sh)"
35 else
36 export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.7z=01;31:*.ace=01;31:*.alz=01;31:*.apk=01;31:*.arc=01;31:*.arj=01;31:*.bz=01;31:*.bz2=01;31:*.cab=01;31:*.cpio=01;31:*.crate=01;31:*.deb=01;31:*.drpm=01;31:*.dwm=01;31:*.dz=01;31:*.ear=01;31:*.egg=01;31:*.esd=01;31:*.gz=01;31:*.jar=01;31:*.lha=01;31:*.lrz=01;31:*.lz=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.lzo=01;31:*.pyz=01;31:*.rar=01;31:*.rpm=01;31:*.rz=01;31:*.sar=01;31:*.swm=01;31:*.t7z=01;31:*.tar=01;31:*.taz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tgz=01;31:*.tlz=01;31:*.txz=01;31:*.tz=01;31:*.tzo=01;31:*.tzst=01;31:*.udeb=01;31:*.war=01;31:*.whl=01;31:*.wim=01;31:*.xz=01;31:*.z=01;31:*.zip=01;31:*.zoo=01;31:*.zst=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:'
37 fi
38fi
39
40if (( ! $+LSCOLORS )); then
41 export LSCOLORS="exfxcxdxbxGxDxabagacad"
42fi
43
44if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*(GNU|lsd) *} ]]; then
45 alias ls="${aliases[ls]:-ls} --group-directories-first --color=auto"
46else
47 alias ls="${aliases[ls]:-ls} -G"
48fi
diff --git a/zsh/.config/zsh/completions.zsh b/zsh/.config/zsh/completions.zsh
new file mode 100644
index 0000000..c9d7993
--- /dev/null
+++ b/zsh/.config/zsh/completions.zsh
@@ -0,0 +1,112 @@
1
2autoload -Uz compinit
3_comp_path="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/zcompdump"
4if [[ $_comp_path(#qNmh-20) ]]; then
5 compinit -C -d "$_comp_path"
6else
7 mkdir -p "$_comp_path:h"
8 compinit -i -d "$_comp_path"
9fi
10unset _comp_path
11
12# Defaults.
13zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
14zstyle ':completion:*:default' list-prompt '%S%M matches%s'
15
16# Use caching to make completion for commands such as dpkg and apt usable.
17zstyle ':completion::complete:*' use-cache on
18zstyle ':completion::complete:*' cache-path "${XDG_CACHE_HOME:-$HOME/.cache}/zsh/zcompcache"
19
20# Case insensitivity
21zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' 'm:{[:upper:]}={[:lower:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
22
23# Group matches and describe
24zstyle ':completion:*:*:*:*:*' menu select
25zstyle ':completion:*:matches' group yes
26zstyle ':completion:*:options' description yes
27zstyle ':completion:*:options' auto-description '%d'
28zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f'
29zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f'
30zstyle ':completion:*:messages' format ' %F{purple}-- %d --%f'
31zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
32zstyle ':completion:*' format ' %F{yellow}-- %d --%f'
33zstyle ':completion:*' group-name ''
34zstyle ':completion:*' verbose yes
35
36# Fuzzy match mistyped completions
37zstyle ':completion:*' completer _complete _match _approximate
38zstyle ':completion:*:match:*' original only
39zstyle ':completion:*:approximate:*' max-errors 2 numeric
40
41# Don't complete unavailable commands
42zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))'
43
44# Array completion element sorting
45zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
46
47# Directories
48zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories
49zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
50zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand'
51zstyle ':completion:*' squeeze-slashes true
52
53# History
54zstyle ':completion:*:history-words' stop yes
55zstyle ':completion:*:history-words' remove-all-dups yes
56zstyle ':completion:*:history-words' list false
57zstyle ':completion:*:history-words' menu yes
58
59# Environment Variables
60zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
61
62# Populate hostname completion. But allow ignoring custom entries from static
63# */etc/hosts* which might be uninteresting.
64zstyle -a ':prezto:module:completion:*:hosts' etc-host-ignores '_etc_host_ignores'
65
66zstyle -e ':completion:*:hosts' hosts 'reply=(
67 ${=${=${=${${(f)"$(cat {/etc/ssh/ssh_,~/.ssh/}known_hosts(|2)(N) 2> /dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ }
68 ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2> /dev/null))"}%%(\#${_etc_host_ignores:+|${(j:|:)~_etc_host_ignores}})*}
69 ${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2> /dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
70)'
71
72# Don't complete uninteresting users...
73zstyle ':completion:*:*:*:users' ignored-patterns \
74 adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
75 dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
76 hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
77 mailman mailnull mldonkey mysql nagios \
78 named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
79 operator pcap postfix postgres privoxy pulse pvm quagga radvd \
80 rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs '_*'
81
82# ... unless we really want to.
83zstyle '*' single-ignored show
84
85# Ignore multiple entries.
86zstyle ':completion:*:(rm|kill|diff):*' ignore-line other
87zstyle ':completion:*:rm:*' file-patterns '*:all-files'
88
89# Kill
90zstyle ':completion:*:*:*:*:processes' command 'ps -u $LOGNAME -o pid,user,command -w'
91zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01'
92zstyle ':completion:*:*:kill:*' menu yes select
93zstyle ':completion:*:*:kill:*' force-list always
94zstyle ':completion:*:*:kill:*' insert-ids single
95
96# Man
97zstyle ':completion:*:manuals' separate-sections true
98zstyle ':completion:*:manuals.(^1*)' insert-sections true
99
100# Media Players
101zstyle ':completion:*:*:mpg123:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
102zstyle ':completion:*:*:mpg321:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
103zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG|flac):ogg\ files *(-/):directories'
104zstyle ':completion:*:*:mocp:*' file-patterns '*.(wav|WAV|mp3|MP3|ogg|OGG|flac):ogg\ files *(-/):directories'
105
106# SSH/SCP/RSYNC
107zstyle ':completion:*:(ssh|scp|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
108zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
109zstyle ':completion:*:ssh:*' group-order users hosts-domain hosts-host users hosts-ipaddr
110zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost
111zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*'
112zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
diff --git a/zsh/.config/zsh/help.zsh b/zsh/.config/zsh/help.zsh
new file mode 100644
index 0000000..9ad4aa6
--- /dev/null
+++ b/zsh/.config/zsh/help.zsh
@@ -0,0 +1,6 @@
1# Type in a command and press M-h :)
2
3if (( $+aliases[run-help] )); then
4 unalias run-help
5fi
6autoload -Uz run-help run-help-{btrfs,git,ip,openssl,p4,sudo,svk,svn}
diff --git a/zsh/.config/zsh/history.zsh b/zsh/.config/zsh/history.zsh
new file mode 100644
index 0000000..79e2159
--- /dev/null
+++ b/zsh/.config/zsh/history.zsh
@@ -0,0 +1,3 @@
1HISTFILE="${HISTFILE:-$HOME/.config/zsh/.zsh_history}"
2HISTSIZE=20000
3SAVEHIST=10000
diff --git a/zsh/.config/zsh/keybinds.zsh b/zsh/.config/zsh/keybinds.zsh
new file mode 100644
index 0000000..d9b64f5
--- /dev/null
+++ b/zsh/.config/zsh/keybinds.zsh
@@ -0,0 +1,42 @@
1bindkey -e
2
3K_UP="$terminfo[kcuu1]"
4K_LEFT="$terminfo[kcub1]"
5K_C_LEFT=('\e[1;5D' '\e[5D' '\eOd')
6K_M_LEFT=('\e[1;3D' '\e[3D' '\e\e[D')
7K_DOWN="$terminfo[kcud1]"
8K_RIGHT="$terminfo[kcuf1]"
9K_C_RIGHT=('\e[1;5C' '\e[5C' '\eOc')
10K_M_RIGHT=('\e[1;3C' '\e[3C' '\e\e[C')
11
12K_BACKSPACE="$terminfo[kbs]"
13K_HOME="$terminfo[khome]"
14K_END="$terminfo[kend]"
15K_INSERT="$terminfo[kich1]"
16K_DELETE="$terminfo[kdch1]"
17K_PAGEUP="$terminfo[kpp]"
18K_PAGEDN="$terminfo[knp]"
19
20for key in '\M-b' '\M-B' "${(@)K_C_LEFT}" "${(@)K_M_LEFT}" '\e'"$K_LEFT"; do
21 bindkey "$key" emacs-backward-word
22done
23
24for key in '\M-f' '\M-F' "${(@)K_C_RIGHT}" "${(@)K_M_RIGHT}" '\e'"$K_RIGHT"; do
25 bindkey "$key" emacs-forward-word
26done
27
28if (( $+widgets[history-incremental-pattern-search-backward] )); then
29 bindkey '\C-r' history-incremental-pattern-search-backward
30 bindkey '\C-s' history-incremental-pattern-search-forward
31fi
32
33bindkey '\e;' pound-insert
34
35bindkey "$K_HOME" beginning-of-line
36bindkey "$K_END" end-of-line
37
38bindkey "$K_INSERT" overwrite-mode
39bindkey "$K_DELETE" delete-char
40bindkey "$K_BACKSPACE" backward-delete-char
41
42bindkey " " magic-space
diff --git a/zsh/.config/zsh/opts.zsh b/zsh/.config/zsh/opts.zsh
new file mode 100644
index 0000000..71f67c3
--- /dev/null
+++ b/zsh/.config/zsh/opts.zsh
@@ -0,0 +1,146 @@
1#
2## Changing Directories
3#
4
5# If a command is issued that can't be executed as a normal command, and the command is the name of a directory, perform
6# the cd command to that directory.
7setopt AUTO_CD
8
9# Have pushd with no arguments act like `pushd $HOME'.
10setopt PUSHD_TO_HOME
11
12#
13## Completion
14#
15
16# If a completion is performed with the cursor within a word, and a full completion is inserted, the cursor is moved to
17# the end of the word.
18setopt ALWAYS_TO_END
19
20# Prevents aliases on the command line from being internally substituted before completion is attempted.
21setopt COMPLETE_ALIASES
22
23# Completion is done from both sides of the word.
24setopt COMPLETE_IN_WORD
25
26# Try to make the completion list smaller (occupying less lines) by printing the matches in columns with different
27# widths.
28setopt LIST_PACKED
29
30#
31## Expansion and Globbing
32#
33
34# Make globbing insensitive to case.
35unsetopt CASE_GLOB
36
37# Disable =expansion.
38unsetopt EQUALS
39
40# Treat #, ~, and ^ characters as part of patterns in globbing.
41setopt EXTENDED_GLOB
42
43# No need for a leading . in a filename to match
44setopt GLOB_DOTS
45
46# Allow abbreviating **/* to ** and ***/* to ***.
47setopt GLOB_STAR_SHORT
48
49# Any characters resulting from parameter expansion are eligible for filename expansion and generation.
50setopt GLOB_SUBST
51
52# History substitutions use pattern matching instead of string matching.
53setopt HIST_SUBST_PATTERN
54
55# Expand filenames in places like wow=filename after the command.
56setopt MAGIC_EQUAL_SUBST
57
58# Sort numeric filenames numerically.
59setopt NUMERIC_GLOB_SORT
60
61# Expand foo${arr}bar where arr=(1 2 3) as foo1bar foo2bar foo3bar instead of foo1 2 3bar.
62setopt RC_EXPAND_PARAM
63
64#
65## History
66#
67
68# Using INC_APPEND_HISTORY_TIME instead.
69unsetopt APPEND_HISTORY
70
71# Print more stuff to the history file.
72setopt EXTENDED_HISTORY
73
74# When running out of space, delete oldest duplicates before unique entries.
75setopt HIST_EXPIRE_DUPS_FIRST
76
77# Use fcntl syscall to lock the history file.
78setopt HIST_FCNTL_LOCK
79
80# When searching history, ignore duplicates already seen.
81setopt HIST_FIND_NO_DUPS
82
83# Do not save duplicates that are right next to each other.
84setopt HIST_IGNORE_DUPS
85
86# Remove superfluous blanks before adding to history.
87setopt HIST_REDUCE_BLANKS
88
89# When using history expansion, don't just immediately execute it, instead expand it inline.
90setopt HIST_VERIFY
91
92# Write to history file like immediately.
93setopt INC_APPEND_HISTORY_TIME
94
95#
96## Input/Output
97#
98
99# Attempt to correct command spelling.
100setopt CORRECT
101
102# No C-s or C-q.
103unsetopt FLOW_CONTROL
104
105# Allow comments in interactive mode.
106setopt INTERACTIVE_COMMENTS
107
108# Print a warning if the mail file has been accessed.
109setopt MAIL_WARNING
110
111# Allow '' within single-quote strings to mean a single quote.
112setopt RC_QUOTES
113
114# When running `rm *` or `rm whatever/*` and prompting for confirmation, wait for 10 seconds so that brain starts
115# working before entering "yes".
116setopt RM_STAR_WAIT
117
118#
119## Job Control
120#
121
122# Auto-send CONT signal to disowned jobs.
123setopt AUTO_CONTINUE
124
125# Allow something like `ed` to resume a `ed` job in the background.
126setopt AUTO_RESUME
127
128# More verbose job notifications.
129setopt LONG_LIST_JOBS
130
131# Notify about updates in jobs only when printing a prompt.
132unsetopt NOTIFY
133
134#
135## Shell Emulation
136#
137
138# If trying to append to a non-existing file, just create it.
139setopt APPEND_CREATE
140
141#
142## Zle
143#
144
145# Assume that terminal deals with combining chars correctly.
146setopt COMBINING_CHARS
diff --git a/zsh/.config/zsh/p10k b/zsh/.config/zsh/p10k
new file mode 160000
Subproject 36f3045d69d1ba402db09d09eb12b42eebe0fa3
diff --git a/zsh/.config/zsh/ssh-agent.zsh b/zsh/.config/zsh/ssh-agent.zsh
new file mode 100644
index 0000000..69410be
--- /dev/null
+++ b/zsh/.config/zsh/ssh-agent.zsh
@@ -0,0 +1,29 @@
1if (( ! $+commands[ssh-agent] )); then
2 return
3fi
4
5_ssh_agent_env="${_ssh_agent_env:-${XDG_CACHE_HOME:-$HOME/.cache}/ssh/ssh-agent.env}"
6
7_ssh_agent_load() {
8 [ -f "$_ssh_agent_env" ] && source "$_ssh_agent_env" >/dev/null
9}
10
11_ssh_agent_start() {
12 (
13 umask 077
14 mkdir -p "${_ssh_agent_env:h}"
15 ssh-agent >"$_ssh_agent_env"
16 )
17 source "$_ssh_agent_env" >/dev/null
18}
19
20_ssh_agent_load
21
22_ssh_agent_state=$(ssh-add -l >/dev/null 2>&1; echo $?)
23
24if [ ! "$SSH_AUTH_SOCK" ] || [ $_ssh_agent_state = 2 ]; then
25 _ssh_agent_start
26 ssh-add
27elif [ "$SSH_AUTH_SOCK" ] && [ $_ssh_agent_state = 1 ]; then
28 ssh-add
29fi
diff --git a/zsh/.config/zsh/termtitle.zsh b/zsh/.config/zsh/termtitle.zsh
new file mode 100644
index 0000000..93ee9a3
--- /dev/null
+++ b/zsh/.config/zsh/termtitle.zsh
@@ -0,0 +1,12 @@
1# set-titles tab-title window-title
2function set-titles {
3 printf '\e]1;%s\a\e]2;%s\a' "$1" "$2"
4}
5
6function _precmd-title-fn {
7 local abspath="${${1:a}:-$PWD}"
8 local abbrev="${abspath/#$HOME/~}"
9 set-titles "$abbrev" "$abbrev"
10}
11
12autoload -Uz add-zsh-hook && add-zsh-hook precmd _precmd-title-fn
diff --git a/zsh/.config/zsh/zsh-autosuggestions b/zsh/.config/zsh/zsh-autosuggestions
new file mode 160000
Subproject 85919cd1ffa7d2d5412f6d3fe437ebdbeeec4fc
diff --git a/zsh/.config/zsh/zsh-syntax-highlighting b/zsh/.config/zsh/zsh-syntax-highlighting
new file mode 160000
Subproject 5eb677bb0fa9a3e60f0eff031dc13926e093df9
diff --git a/zsh/.zshenv b/zsh/.zshenv
index 508f665..9fbf4d2 100644..120000
--- a/zsh/.zshenv
+++ b/zsh/.zshenv
@@ -1,7 +1 @@
1__CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" .config/zsh/.zshenv \ No newline at end of file
2
3for f in $(echo "$__CONF_DIR"/environment.d/*.conf | sort); do
4 source "$f"
5done
6
7source "$ZDOTDIR/.zshenv"