new: zimfw (replaed prezto)
This commit is contained in:
parent
5a8bd47acd
commit
06e1032586
4 changed files with 103 additions and 159 deletions
|
@ -1,5 +1,52 @@
|
|||
# Remove older command from the history if a duplicate is to be added.
|
||||
setopt HIST_IGNORE_ALL_DUPS
|
||||
|
||||
# Set editor default keymap to emacs (`-e`) or vi (`-v`)
|
||||
bindkey -v
|
||||
|
||||
# Remove path separator from WORDCHARS.
|
||||
WORDCHARS=${WORDCHARS//[\/]}
|
||||
|
||||
# Disable automatic widget re-binding on each precmd. This can be set when
|
||||
# zsh-users/zsh-autosuggestions is the last module in your ~/.zimrc.
|
||||
ZSH_AUTOSUGGEST_MANUAL_REBIND=1
|
||||
|
||||
# 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)
|
||||
|
||||
ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
|
||||
|
||||
# Download zimfw plugin manager if missing.
|
||||
if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
|
||||
if (( ${+commands[curl]} )); then
|
||||
curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \
|
||||
https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
|
||||
else
|
||||
mkdir -p ${ZIM_HOME} && wget -nv -O ${ZIM_HOME}/zimfw.zsh \
|
||||
https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated.
|
||||
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
|
||||
source ${ZIM_HOME}/zimfw.zsh init -q
|
||||
fi
|
||||
|
||||
# Initialize modules.
|
||||
source ${ZIM_HOME}/init.zsh
|
||||
|
||||
# zsh-history-substring-search
|
||||
zmodload -F zsh/terminfo +p:terminfo
|
||||
|
||||
# Bind ^[[A/^[[B manually so up/down works both before and after zle-line-init
|
||||
for key ('^[[A' '^P' ${terminfo[kcuu1]}) bindkey ${key} history-substring-search-up
|
||||
for key ('^[[B' '^N' ${terminfo[kcud1]}) bindkey ${key} history-substring-search-down
|
||||
for key ('k') bindkey -M vicmd ${key} history-substring-search-up
|
||||
for key ('j') bindkey -M vicmd ${key} history-substring-search-down
|
||||
unset key
|
||||
|
||||
srcs=(
|
||||
"${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
|
||||
"/opt/miniconda3/etc/profile.d/conda.sh"
|
||||
"$HOME/.cargo/env"
|
||||
{{ if eq .chezmoi.hostname "rattusrattus" -}}
|
||||
|
@ -13,11 +60,6 @@ for fp in $srcs; do
|
|||
fi
|
||||
done
|
||||
|
||||
BASE16_SHELL="$HOME/.config/base16-shell/"
|
||||
[ -n "$PS1" ] && \
|
||||
[ -s "$BASE16_SHELL/profile_helper.sh" ] && \
|
||||
source "$BASE16_SHELL/profile_helper.sh"
|
||||
|
||||
alias i="ipython3"
|
||||
|
||||
{{ if eq .chezmoi.hostname "rattusrattus" -}}
|
||||
|
@ -57,4 +99,10 @@ function brightness_min {
|
|||
}
|
||||
|
||||
# ttyscheme
|
||||
{{- else }}
|
||||
BASE16_SHELL="$HOME/.config/base16-shell/"
|
||||
[ -n "$PS1" ] && \
|
||||
[ -s "$BASE16_SHELL/profile_helper.sh" ] && \
|
||||
source "$BASE16_SHELL/profile_helper.sh"
|
||||
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue