Migrate from antigen back to zim

This commit is contained in:
Adam Goldsmith 2019-12-25 21:27:17 -05:00
parent 98f1fd6b31
commit 40c79488d4
5 changed files with 109 additions and 74 deletions

View File

@ -3,20 +3,23 @@
source $HOME/.zshenv
# Gnupg setup
## Start the gpg-agent if not already running
if hash gpg-agent 2>/dev/null
then
# 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
# 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
# Set GPG TTY
GPG_TTY=$(tty)
export GPG_TTY
## Refresh gpg-agent tty in case user switches into an X session
# Refresh gpg-agent tty in case user switches into an X session
gpg-connect-agent updatestartuptty /bye >/dev/null
fi

25
.zimrc Normal file
View 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
View File

@ -0,0 +1,7 @@
#
# User configuration sourced by login shells
#
# Initialize Zim
source ${ZIM_HOME}/login_init.zsh -q &!

14
.zshenv
View File

@ -1,20 +1,24 @@
#-*- mode: sh; -*-
# Define Zim location
ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
# Environment variables
export EDITOR="emacsclient -t"
export ALTERNATE_EDITOR=""
export VISUAL="emacsclient -c -n"
export PAGER=less
export TERMINAL=alacritty
export ARDUINO_DIR="/usr/share/arduino"
export ARDMK_DIR="$HOME/Programs/Arduino-Makefile"
export STEAMAPPS="$HOME/.local/share/Steam/steamapps/common"
export QT_STYLE_OVERRIDE=gtk2
export QT_AUTO_SCREEN_SCALE_FACTOR=true
export ALTERNATE_EDITOR=""
export TERMINAL=xfce4-terminal
export CALIBRE_USE_SYSTEM_THEME=true
export WINEDLLOVERRIDES=winemenubuilder.exe=d
export WORDCHARS=${WORDCHARS/\//}
export PAGER=less
export WINEDLLOVERRIDES=winemenubuilder.exe=d
# Add $HOME/.bin to PATH if it exists and is not already in the path
if [[ -d "$HOME/.bin" ]] && ! grep -q ":$HOME"'/\.bin\(:\|$\)' <<< "$PATH"

102
.zshrc
View File

@ -1,70 +1,59 @@
# Antigen Stuff
ADOTDIR="$HOME/.antigen"
[ ! -e "$ADOTDIR" ] && git clone https://github.com/zsh-users/antigen.git "$ADOTDIR"
source "$ADOTDIR/antigen.zsh"
if [ ! -d "$HOME/.zim" ]
then
git clone https://github.com/zimfw/zimfw $HOME/.zim -b develop
source ~/.zim/zimfw.zsh install
fi
# Temporary, hopefully remove later when antigen correctly fails to shallow clone from http
[ ! -e "$ADOTDIR/bundles/zsh/fred-prompt" ] && git clone https://adamgoldsmith.name/cgit/zsh/fred-prompt.git/ $ADOTDIR/bundles/zsh/fred-prompt
# Remove older command from the history if a duplicate is to be added.
setopt HIST_IGNORE_ALL_DUPS
unsetopt SHARE_HISTORY
setopt INC_APPEND_HISTORY
antigen bundles <<EOBUNDLES
https://adamgoldsmith.name/cgit/zsh/fred-prompt.git prompt_fred_setup
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-history-substring-search
Eriner/zim modules/directory
Eriner/zim modules/git
Eriner/zim modules/history
Eriner/zim modules/input
Eriner/zim modules/utility
Eriner/zim modules/completion
EOBUNDLES
antigen apply
# Set editor default keymap to emacs
bindkey -e
stty -ixon #disable XON/XOFF, which breaks C-s
# Prompt for spelling correction of commands.
setopt CORRECT
CORRECT_IGNORE="_*" # don't suggest completion functions
# Customize spelling correction prompt.
SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '
# 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 $HOME/.aliases/general
# Various Options
setopt EXTENDED_GLOB
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
unsetopt NOMATCH # turn off "no matches found" on glob failure
# rehashes on bin change, might cause performance issues
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)
bindkey '^[[5~' history-substring-search-up
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.
function prepend-sudo() {
if [[ "$BUFFER" != su(do|)\ * ]]; then
@ -78,3 +67,10 @@ bindkey "^X^S" prepend-sudo
# Control-Backspace and Control-Delete
bindkey '^H' backward-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