173 lines
4.1 KiB
Bash
173 lines
4.1 KiB
Bash
# Start configuration added by Zim install {{{
|
|
#
|
|
# User configuration sourced by interactive shells
|
|
#
|
|
|
|
# -----------------
|
|
# 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~'
|
|
|
|
#
|
|
# 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
|
|
#
|
|
|
|
# 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)
|
|
|
|
# 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'
|
|
|
|
# ------------------
|
|
# Initialize modules
|
|
# ------------------
|
|
|
|
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
|
|
|
|
#
|
|
# tmux
|
|
#
|
|
|
|
# >>> tmux initialization >>>
|
|
#
|
|
# if [[ $DISPLAY ]]; then
|
|
# # If not running interactively, do not do anything
|
|
# [[ $- != *i* ]] && return
|
|
|
|
# if [[ -z "$TMUX" ]] ;then
|
|
# ID="$( tmux ls | grep -vm1 attached | cut -d: -f1 )" # get the id of a deattached session
|
|
# if [[ -z "$ID" ]] ;then # if not available create a new one
|
|
# tmux new-session
|
|
# else
|
|
# tmux attach-session -t "$ID" # if available attach to it
|
|
# fi
|
|
# fi
|
|
# fi
|
|
# <<< tmux initialization <<<
|
|
|
|
#
|
|
# fuzzy file search
|
|
#
|
|
|
|
# >>> fzf initialization >>>
|
|
#
|
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
|
# <<< fzf initialization <<<
|
|
|
|
#
|
|
# ocaml
|
|
#
|
|
|
|
# >>> opam configuration >>>
|
|
#
|
|
test -r /home/jeff/.opam/opam-init/init.zsh && . /home/jeff/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
|
|
# <<< opam configuration <<<
|
|
|
|
#
|
|
# conda
|
|
#
|
|
|
|
# >>> conda configuration >>>
|
|
#
|
|
[ -f /home/jeff/miniconda3/etc/profile.d/conda.sh ] && source /home/jeff/miniconda3/etc/profile.d/conda.sh
|
|
# <<< conda configuration <<<
|
|
|