Migrate from antigen back to zim
This commit is contained in:
parent
98f1fd6b31
commit
40c79488d4
35
.profile
35
.profile
@ -3,20 +3,23 @@
|
|||||||
source $HOME/.zshenv
|
source $HOME/.zshenv
|
||||||
|
|
||||||
# Gnupg setup
|
# Gnupg setup
|
||||||
## Start the gpg-agent if not already running
|
if hash gpg-agent 2>/dev/null
|
||||||
if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
|
then
|
||||||
gpg-connect-agent /bye >/dev/null 2>&1
|
# Start the gpg-agent if not already running
|
||||||
|
if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
|
||||||
|
gpg-connect-agent /bye >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set SSH to use gpg-agent
|
||||||
|
unset SSH_AGENT_PID
|
||||||
|
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
|
||||||
|
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set GPG TTY
|
||||||
|
GPG_TTY=$(tty)
|
||||||
|
export GPG_TTY
|
||||||
|
|
||||||
|
# Refresh gpg-agent tty in case user switches into an X session
|
||||||
|
gpg-connect-agent updatestartuptty /bye >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Set SSH to use gpg-agent
|
|
||||||
unset SSH_AGENT_PID
|
|
||||||
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
|
|
||||||
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Set GPG TTY
|
|
||||||
GPG_TTY=$(tty)
|
|
||||||
export GPG_TTY
|
|
||||||
|
|
||||||
## Refresh gpg-agent tty in case user switches into an X session
|
|
||||||
gpg-connect-agent updatestartuptty /bye >/dev/null
|
|
||||||
|
25
.zimrc
Normal file
25
.zimrc
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# -*- mode: sh; -*-
|
||||||
|
|
||||||
|
#
|
||||||
|
# Modules
|
||||||
|
#
|
||||||
|
|
||||||
|
zmodule environment
|
||||||
|
zmodule git
|
||||||
|
zmodule input
|
||||||
|
zmodule fasd
|
||||||
|
zmodule termtitle
|
||||||
|
zmodule utility
|
||||||
|
|
||||||
|
# Prompt
|
||||||
|
zmodule git-info
|
||||||
|
zmodule https://adamgoldsmith.name/cgit/zsh/fred-prompt.git
|
||||||
|
|
||||||
|
zmodule zsh-users/zsh-completions
|
||||||
|
# completion must be sourced after zsh-users/zsh-completions
|
||||||
|
zmodule completion
|
||||||
|
zmodule zsh-users/zsh-autosuggestions
|
||||||
|
# zsh-users/zsh-syntax-highlighting must be sourced after completion
|
||||||
|
zmodule zsh-users/zsh-syntax-highlighting
|
||||||
|
# zsh-users/zsh-history-substring-search must be sourced after zsh-users/zsh-syntax-highlighting
|
||||||
|
zmodule zsh-users/zsh-history-substring-search
|
7
.zlogin
Normal file
7
.zlogin
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#
|
||||||
|
# User configuration sourced by login shells
|
||||||
|
#
|
||||||
|
|
||||||
|
# Initialize Zim
|
||||||
|
source ${ZIM_HOME}/login_init.zsh -q &!
|
||||||
|
|
14
.zshenv
14
.zshenv
@ -1,20 +1,24 @@
|
|||||||
#-*- mode: sh; -*-
|
#-*- mode: sh; -*-
|
||||||
|
|
||||||
|
# Define Zim location
|
||||||
|
ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
export EDITOR="emacsclient -t"
|
export EDITOR="emacsclient -t"
|
||||||
|
export ALTERNATE_EDITOR=""
|
||||||
export VISUAL="emacsclient -c -n"
|
export VISUAL="emacsclient -c -n"
|
||||||
|
export PAGER=less
|
||||||
|
export TERMINAL=alacritty
|
||||||
|
|
||||||
export ARDUINO_DIR="/usr/share/arduino"
|
export ARDUINO_DIR="/usr/share/arduino"
|
||||||
export ARDMK_DIR="$HOME/Programs/Arduino-Makefile"
|
export ARDMK_DIR="$HOME/Programs/Arduino-Makefile"
|
||||||
export STEAMAPPS="$HOME/.local/share/Steam/steamapps/common"
|
export STEAMAPPS="$HOME/.local/share/Steam/steamapps/common"
|
||||||
|
|
||||||
export QT_STYLE_OVERRIDE=gtk2
|
export QT_STYLE_OVERRIDE=gtk2
|
||||||
export QT_AUTO_SCREEN_SCALE_FACTOR=true
|
export QT_AUTO_SCREEN_SCALE_FACTOR=true
|
||||||
export ALTERNATE_EDITOR=""
|
|
||||||
export TERMINAL=xfce4-terminal
|
|
||||||
export CALIBRE_USE_SYSTEM_THEME=true
|
export CALIBRE_USE_SYSTEM_THEME=true
|
||||||
export WINEDLLOVERRIDES=winemenubuilder.exe=d
|
|
||||||
|
|
||||||
export WORDCHARS=${WORDCHARS/\//}
|
export WINEDLLOVERRIDES=winemenubuilder.exe=d
|
||||||
export PAGER=less
|
|
||||||
|
|
||||||
# Add $HOME/.bin to PATH if it exists and is not already in the path
|
# Add $HOME/.bin to PATH if it exists and is not already in the path
|
||||||
if [[ -d "$HOME/.bin" ]] && ! grep -q ":$HOME"'/\.bin\(:\|$\)' <<< "$PATH"
|
if [[ -d "$HOME/.bin" ]] && ! grep -q ":$HOME"'/\.bin\(:\|$\)' <<< "$PATH"
|
||||||
|
102
.zshrc
102
.zshrc
@ -1,70 +1,59 @@
|
|||||||
# Antigen Stuff
|
if [ ! -d "$HOME/.zim" ]
|
||||||
ADOTDIR="$HOME/.antigen"
|
then
|
||||||
[ ! -e "$ADOTDIR" ] && git clone https://github.com/zsh-users/antigen.git "$ADOTDIR"
|
git clone https://github.com/zimfw/zimfw $HOME/.zim -b develop
|
||||||
source "$ADOTDIR/antigen.zsh"
|
source ~/.zim/zimfw.zsh install
|
||||||
|
fi
|
||||||
|
|
||||||
# Temporary, hopefully remove later when antigen correctly fails to shallow clone from http
|
# Remove older command from the history if a duplicate is to be added.
|
||||||
[ ! -e "$ADOTDIR/bundles/zsh/fred-prompt" ] && git clone https://adamgoldsmith.name/cgit/zsh/fred-prompt.git/ $ADOTDIR/bundles/zsh/fred-prompt
|
setopt HIST_IGNORE_ALL_DUPS
|
||||||
|
unsetopt SHARE_HISTORY
|
||||||
|
setopt INC_APPEND_HISTORY
|
||||||
|
|
||||||
antigen bundles <<EOBUNDLES
|
# Set editor default keymap to emacs
|
||||||
https://adamgoldsmith.name/cgit/zsh/fred-prompt.git prompt_fred_setup
|
bindkey -e
|
||||||
zsh-users/zsh-syntax-highlighting
|
stty -ixon #disable XON/XOFF, which breaks C-s
|
||||||
zsh-users/zsh-history-substring-search
|
|
||||||
Eriner/zim modules/directory
|
# Prompt for spelling correction of commands.
|
||||||
Eriner/zim modules/git
|
setopt CORRECT
|
||||||
Eriner/zim modules/history
|
CORRECT_IGNORE="_*" # don't suggest completion functions
|
||||||
Eriner/zim modules/input
|
|
||||||
Eriner/zim modules/utility
|
# Customize spelling correction prompt.
|
||||||
Eriner/zim modules/completion
|
SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '
|
||||||
EOBUNDLES
|
|
||||||
antigen apply
|
# Remove path separator from WORDCHARS.
|
||||||
|
WORDCHARS=${WORDCHARS//[\/]}
|
||||||
|
|
||||||
|
# Set window title format
|
||||||
|
zstyle ':zim:termtitle' format '%~:zsh'
|
||||||
|
|
||||||
|
# Append `../` to your input for each `.` you type after an initial `..`
|
||||||
|
zstyle ':zim:input' double-dot-expand yes
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
|
||||||
|
# Initialize Zim 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
|
||||||
|
|
||||||
# Source aliases
|
# Source aliases
|
||||||
source $HOME/.aliases/general
|
source $HOME/.aliases/general
|
||||||
|
|
||||||
# Various Options
|
# Various Options
|
||||||
setopt EXTENDED_GLOB
|
unsetopt NOMATCH # turn off "no matches found" on glob failure
|
||||||
unsetopt NOMATCH
|
|
||||||
setopt CORRECT
|
|
||||||
CORRECT_IGNORE="_*"
|
|
||||||
zhighlighters=(main brackets)
|
|
||||||
stty -ixon #disable XON/XOFF, which breaks C-s
|
|
||||||
unsetopt SHARE_HISTORY
|
|
||||||
setopt INC_APPEND_HISTORY
|
|
||||||
# rehashes on bin change, might cause performance issues
|
# rehashes on bin change, might cause performance issues
|
||||||
zstyle ':completion:*' rehash true
|
zstyle ':completion:*' rehash true
|
||||||
|
|
||||||
#load fasd if it exists
|
|
||||||
hash fasd 2>/dev/null && eval "$(fasd --init auto)"
|
|
||||||
|
|
||||||
# Load run-help
|
|
||||||
unalias run-help
|
|
||||||
autoload run-help
|
|
||||||
|
|
||||||
# Auto start tmux if a remote connection
|
|
||||||
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -n "$SSH_TTY" ]]
|
|
||||||
then
|
|
||||||
# Attach only to the 'auto' session
|
|
||||||
exec tmux new-session -A -s 'auto'
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# History Substring Search bindings (PageUp and PageDown)
|
# History Substring Search bindings (PageUp and PageDown)
|
||||||
bindkey '^[[5~' history-substring-search-up
|
bindkey '^[[5~' history-substring-search-up
|
||||||
bindkey '^[[6~' history-substring-search-down
|
bindkey '^[[6~' history-substring-search-down
|
||||||
|
|
||||||
# Expands ... to ../..
|
|
||||||
function expand-dot-to-parent-directory-path {
|
|
||||||
if [[ $LBUFFER = *.. ]]; then
|
|
||||||
LBUFFER+='/..'
|
|
||||||
else
|
|
||||||
LBUFFER+='.'
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
zle -N expand-dot-to-parent-directory-path
|
|
||||||
bindkey -M emacs "." expand-dot-to-parent-directory-path
|
|
||||||
bindkey -M isearch "." self-insert
|
|
||||||
|
|
||||||
# Inserts 'sudo ' at the beginning of the line.
|
# Inserts 'sudo ' at the beginning of the line.
|
||||||
function prepend-sudo() {
|
function prepend-sudo() {
|
||||||
if [[ "$BUFFER" != su(do|)\ * ]]; then
|
if [[ "$BUFFER" != su(do|)\ * ]]; then
|
||||||
@ -78,3 +67,10 @@ bindkey "^X^S" prepend-sudo
|
|||||||
# Control-Backspace and Control-Delete
|
# Control-Backspace and Control-Delete
|
||||||
bindkey '^H' backward-kill-word
|
bindkey '^H' backward-kill-word
|
||||||
bindkey '5~' kill-word
|
bindkey '5~' kill-word
|
||||||
|
|
||||||
|
# Auto start tmux if a remote connection
|
||||||
|
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -n "$SSH_TTY" ]]
|
||||||
|
then
|
||||||
|
# Attach only to the 'auto' session
|
||||||
|
exec tmux new-session -A -s 'auto'
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user