-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-arrange Zsh configs to be more modular
- Loading branch information
Showing
5 changed files
with
92 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Zsh completion settings | ||
autoload -Uz compinit && compinit | ||
zinit cdreplay -q | ||
# Completion matcher list: | ||
# - try case-insensitive matching if nothing matches | ||
# - partially match typed words (i.e. bar<tab> would match foobar) | ||
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' | ||
# Highlight selected item in the menu | ||
zstyle ':completion:*' menu select | ||
# Colored completion (different colors for dirs/files/etc) | ||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" | ||
# automatically find new executables in path | ||
zstyle ':completion:*' rehash true | ||
# Speed up completions | ||
zstyle ':completion:*' accept-exact '*(N)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Zsh history settings | ||
|
||
HISTFILE="$ZDOTDIR/.zhistory" | ||
HISTSIZE=10000 | ||
SAVEHIST=$HISTSIZE | ||
|
||
# Save timestamps in history file | ||
setopt extended_history | ||
# Persistent history file | ||
setopt append_history | ||
# Write to the history file upon running each command, not upon exiting shell | ||
setopt inc_append_history | ||
# Delete the older event if a new event is a duplicate of it | ||
setopt hist_ignore_all_dups | ||
# Don't write to history if the command starts with a space | ||
setopt hist_ignore_space | ||
|
||
# Search history using already-typed text with up/down arrows | ||
zinit load 'zsh-users/zsh-history-substring-search' | ||
zinit ice wait atload'_history_substring_search_config' | ||
# Key bindings for using zsh-history-substring-search via up/down arrows | ||
bindkey '^[[A' history-substring-search-up | ||
bindkey '^[[B' history-substring-search-down | ||
# Colors for matching and non-matching search terms | ||
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='fg=blue' | ||
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='fg=red' | ||
# Only match commands that start the same as the search term | ||
HISTORY_SUBSTRING_SEARCH_PREFIXED='foo' # it just needs to be non-empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Visual/style settings | ||
|
||
# Color for autosuggestions | ||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6' | ||
|
||
# Load dircolors | ||
source $ZDOTDIR/dircolors.zsh | ||
|
||
# Colors for fzf | ||
# https://github.com/junegunn/fzf/wiki/Color-schemes#alternate-solarized-lightdark-theme | ||
_gen_fzf_default_opts() { | ||
local base03 = "#002b36" | ||
local base02 = "#073642" | ||
local base01 = "#586e75" | ||
local base00 = "#657b83" | ||
local base0 = "#839496" | ||
local base1 = "#93a1a1" | ||
local base2 = "#eee8d5" | ||
local base3 = "#fdf6e3" | ||
local yellow = "#b58900" | ||
local orange = "#cb4b16" | ||
local red = "#dc322f" | ||
local magenta = "#d33682" | ||
local violet = "#6c71c4" | ||
local blue = "#268bd2" | ||
local cyan = "#2aa198" | ||
local green = "#859900" | ||
|
||
export FZF_DEFAULT_OPTS=" | ||
--color fg:-1,bg:-1,hl:$blue,fg+:$base2,bg+:$base02,hl+:$blue | ||
--color info:$yellow,prompt:$yellow,pointer:$base3,marker:$base3,spinner:$yellow | ||
" | ||
} | ||
_gen_fzf_default_opts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
zinit ice depth=1; zinit light romkatv/powerlevel10k | ||
zinit light zdharma-continuum/fast-syntax-highlighting | ||
zinit light zsh-users/zsh-completions | ||
zinit light zsh-users/zsh-autosuggestions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters