2020-02-27 17:27:52 -05:00
|
|
|
# Start configuration added by Zim install {{{
|
2018-12-23 11:20:18 -05:00
|
|
|
#
|
|
|
|
# User configuration sourced by interactive shells
|
|
|
|
#
|
|
|
|
|
2020-02-27 17:27:52 -05:00
|
|
|
# -----------------
|
|
|
|
# Zsh configuration
|
|
|
|
# -----------------
|
|
|
|
|
|
|
|
#
|
|
|
|
# History
|
|
|
|
#
|
|
|
|
|
|
|
|
# Remove older command from the history if a duplicate is to be added.
|
|
|
|
setopt HIST_IGNORE_ALL_DUPS
|
|
|
|
|
|
|
|
#
|
|
|
|
# Input/output
|
|
|
|
#
|
|
|
|
|
|
|
|
# Set editor default keymap to emacs (`-e`) or vi (`-v`)
|
|
|
|
bindkey -e
|
|
|
|
|
|
|
|
# Prompt for spelling correction of commands.
|
|
|
|
#setopt CORRECT
|
|
|
|
|
|
|
|
# Customize spelling correction prompt.
|
|
|
|
#SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '
|
|
|
|
|
|
|
|
# Remove path separator from WORDCHARS.
|
|
|
|
WORDCHARS=${WORDCHARS//[\/]}
|
|
|
|
|
|
|
|
|
|
|
|
# --------------------
|
|
|
|
# Module configuration
|
|
|
|
# --------------------
|
|
|
|
|
|
|
|
#
|
|
|
|
# completion
|
|
|
|
#
|
|
|
|
|
|
|
|
# Set a custom path for the completion dump file.
|
|
|
|
# If none is provided, the default ${ZDOTDIR:-${HOME}}/.zcompdump is used.
|
|
|
|
#zstyle ':zim:completion' dumpfile "${ZDOTDIR:-${HOME}}/.zcompdump-${ZSH_VERSION}"
|
|
|
|
|
|
|
|
#
|
|
|
|
# git
|
|
|
|
#
|
|
|
|
|
|
|
|
# Set a custom prefix for the generated aliases. The default prefix is 'G'.
|
|
|
|
#zstyle ':zim:git' aliases-prefix 'g'
|
|
|
|
|
|
|
|
#
|
|
|
|
# input
|
|
|
|
#
|
|
|
|
|
|
|
|
# Append `../` to your input for each `.` you type after an initial `..`
|
|
|
|
#zstyle ':zim:input' double-dot-expand yes
|
|
|
|
|
|
|
|
#
|
|
|
|
# termtitle
|
|
|
|
#
|
|
|
|
|
|
|
|
# Set a custom terminal title format using prompt expansion escape sequences.
|
|
|
|
# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
|
|
|
|
# If none is provided, the default '%n@%m: %~' is used.
|
|
|
|
#zstyle ':zim:termtitle' format '%1~'
|
2018-12-23 11:20:18 -05:00
|
|
|
|
2020-02-27 17:27:52 -05:00
|
|
|
#
|
|
|
|
# zsh-autosuggestions
|
|
|
|
#
|
|
|
|
|
|
|
|
# Customize the style that the suggestions are shown with.
|
|
|
|
# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style
|
|
|
|
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
|
|
|
|
|
|
|
|
#
|
|
|
|
# zsh-syntax-highlighting
|
|
|
|
#
|
2018-12-23 11:20:18 -05:00
|
|
|
|
2020-02-27 17:27:52 -05:00
|
|
|
# Set what highlighters will be used.
|
|
|
|
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
|
|
|
|
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
|
2018-12-23 11:20:18 -05:00
|
|
|
|
2020-02-27 17:27:52 -05:00
|
|
|
# Customize the main highlighter styles.
|
|
|
|
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md#how-to-tweak-it
|
|
|
|
#typeset -A ZSH_HIGHLIGHT_STYLES
|
|
|
|
#ZSH_HIGHLIGHT_STYLES[comment]='fg=10'
|
2018-12-23 11:20:18 -05:00
|
|
|
|
2020-02-27 17:27:52 -05:00
|
|
|
# ------------------
|
|
|
|
# Initialize modules
|
|
|
|
# ------------------
|
2018-12-23 11:20:18 -05:00
|
|
|
|
2020-02-27 17:27:52 -05:00
|
|
|
if [[ ${ZIM_HOME}/init.zsh -ot ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
|
|
|
|
# Update static initialization script if it's outdated, before sourcing it
|
|
|
|
source ${ZIM_HOME}/zimfw.zsh init -q
|
|
|
|
fi
|
|
|
|
source ${ZIM_HOME}/init.zsh
|
|
|
|
|
|
|
|
# ------------------------------
|
|
|
|
# Post-init module configuration
|
|
|
|
# ------------------------------
|
|
|
|
|
|
|
|
#
|
|
|
|
# zsh-history-substring-search
|
|
|
|
#
|
|
|
|
|
|
|
|
# Bind ^[[A/^[[B manually so up/down works both before and after zle-line-init
|
|
|
|
bindkey '^[[A' history-substring-search-up
|
|
|
|
bindkey '^[[B' history-substring-search-down
|
|
|
|
|
|
|
|
# Bind up and down keys
|
|
|
|
zmodload -F zsh/terminfo +p:terminfo
|
|
|
|
if [[ -n ${terminfo[kcuu1]} && -n ${terminfo[kcud1]} ]]; then
|
|
|
|
bindkey ${terminfo[kcuu1]} history-substring-search-up
|
|
|
|
bindkey ${terminfo[kcud1]} history-substring-search-down
|
|
|
|
fi
|
|
|
|
|
|
|
|
bindkey '^P' history-substring-search-up
|
|
|
|
bindkey '^N' history-substring-search-down
|
|
|
|
bindkey -M vicmd 'k' history-substring-search-up
|
|
|
|
bindkey -M vicmd 'j' history-substring-search-down
|
|
|
|
# }}} End configuration added by Zim install
|
|
|
|
|
2021-12-30 13:04:21 -05:00
|
|
|
# Homebrew
|
2022-06-26 09:51:44 -04:00
|
|
|
if [[ -d "/home/linuxbrew/.linuxbrew" ]]; then
|
|
|
|
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
|
|
|
fi
|
2020-02-27 17:27:52 -05:00
|
|
|
|
|
|
|
# Set Path:
|
|
|
|
typeset -U PATH
|
|
|
|
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
|
|
|
|
export PATH
|
2018-12-23 11:20:18 -05:00
|
|
|
|
2020-03-01 19:38:51 -05:00
|
|
|
# Portable alternative to readlink -f
|
|
|
|
zpath() { cd -P . || return
|
|
|
|
_out() { printf "%s$_zdlm\n" "$PWD/${1##*/}"; }
|
|
|
|
_cd() { cd -P "$1" ; } >/dev/null 2>&1
|
|
|
|
while [ $# -gt 0 ] && _cd .
|
|
|
|
do if _cd "$1"
|
|
|
|
then _out
|
|
|
|
elif ! [ -L "$1" ] && [ -e "$1" ]
|
|
|
|
then _cd "${1%/*}"; _out "$1"
|
|
|
|
elif [ -L "$1" ]
|
|
|
|
then ( while set -- "${1%?/}"; _cd "${1%/*}"; [ -L "${1##*/}" ]
|
|
|
|
do set " $1" "$(_cd -; ls -nd -- "$1"; echo /)"
|
|
|
|
set -- "${2#*"$1" -> }"
|
|
|
|
done; _out "$1"
|
|
|
|
); else ( PS4=ERR:\ NO_SUCH_PATH; set -x; : "$1" )
|
|
|
|
fi; _cd -; shift; done
|
|
|
|
unset -f _out _cd; unset -v _zdlm
|
|
|
|
}
|
|
|
|
|
2018-12-23 11:20:18 -05:00
|
|
|
# Include local functions/aliases/environments:
|
|
|
|
while read f
|
|
|
|
do
|
2022-07-24 19:44:07 -04:00
|
|
|
#if [[ -f "$(zpath "$f")" ]]; then
|
|
|
|
# source "$f"
|
|
|
|
#fi
|
|
|
|
source "$f"
|
|
|
|
done < <(find "${HOME}/.local/dotfiles/" \( -type l -o -type f \) -name '*.zsh')
|
2018-12-23 11:20:18 -05:00
|
|
|
|
2019-01-06 18:20:40 -05:00
|
|
|
# Disable Ctrl+S Scroll-Locking
|
|
|
|
stty -ixon
|
|
|
|
|
2022-06-26 09:54:17 -04:00
|
|
|
# iTerm2 Shell Integration
|
|
|
|
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
|
|
|
|
|