diff --git a/.gitmodules b/.gitmodules index 0403ca0..f348de8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule ".zprezto"] - path = .zprezto - url = http://adamgoldsmith.name/cgit/prezto.git +[submodule ".zim"] + path = .zim + url = http://adamgoldsmith.name/cgit/zim.git diff --git a/.zim b/.zim new file mode 160000 index 0000000..a51d94b --- /dev/null +++ b/.zim @@ -0,0 +1 @@ +Subproject commit a51d94b91d52cc25503ed6d1c0f685d0ff71c0b3 diff --git a/.zimrc b/.zimrc new file mode 100644 index 0000000..0bd7f49 --- /dev/null +++ b/.zimrc @@ -0,0 +1,27 @@ +#-*- mode: sh; -*- +## Zim settings + +# Select what modules you would like enabled. +# The second line of modules may depend on options set by modules in the first line. +# These dependencies are noted on the respective module's README.md. +zmodules=(directory environment git history input utility custom \ + syntax-highlighting prompt git completion) + +## Prompt +# Set your desired prompt here +zprompt_theme='fred' + +## Utility +# Uncomment to enable command correction prompts; 'setopt CORRECT' +# See: http://zsh.sourceforge.net/Doc/Release/Options.html#Input_002fOutput +zcorrection='true' + +## Syntax-Highlighting +# This determines what highlighters will be used with the completion module. +# Documentation of the highlighters can be found here: +# https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md +zhighlighters=(main brackets) + +## SSH +# Load these ssh identities with the ssh module +zssh_ids=(id_rsa) diff --git a/.zlogin b/.zlogin new file mode 100644 index 0000000..e1d96f2 --- /dev/null +++ b/.zlogin @@ -0,0 +1,47 @@ +#-*- mode: sh; -*- +# startup file read in interactive login shells + +# The following code helps us by optimizing the existing framework. +# This includes zcompile, zcompdump, etc. + +( + # Function to determine the need of a zcompile. If the .zwc file + # does not exist, or the base file is newer, we need to compile. + # These jobs are asynchronous, and will not impact the interactive shell + zcompare() { + if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then + zcompile ${1} + fi + } + + zim_mods=${ZDOTDIR:-${HOME}}/.zim/modules + setopt EXTENDED_GLOB + + # zcompile the completion cache; siginificant speedup. + zcompare ${ZDOTDIR:-${HOME}}/.zcompdump + + # zcompile .zshrc + zcompare ${ZDOTDIR:-${HOME}}/.zshrc + + # zcompile some light module init scripts + zcompare ${zim_mods}/git/init.zsh + zcompare ${zim_mods}/utility/init.zsh + zcompare ${zim_mods}/pacman/init.zsh + zcompare ${zim_mods}/spectrum/init.zsh + zcompare ${zim_mods}/completion/init.zsh + + # zcompile all .zsh files in the custom module + for file in ${zim_mods}/custom/**/*.zsh; do + zcompare ${file} + done + + # syntax-highlighting + for file in ${zim_mods}/syntax-highlighting/external/highlighters/**/*.zsh; do + zcompare ${file} + done + zcompare ${zim_mods}/syntax-highlighting/external/zsh-syntax-highlighting.zsh + + # zsh-histery-substring-search + zcompare ${zim_mods}/history-substring-search/external/zsh-history-substring-search.zsh + +) &! diff --git a/.zprezto b/.zprezto deleted file mode 160000 index 702f659..0000000 --- a/.zprezto +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 702f6593734afae7c219b78b3db15a11f109f10b diff --git a/.zshenv b/.zshenv new file mode 100644 index 0000000..456e40b --- /dev/null +++ b/.zshenv @@ -0,0 +1,9 @@ +#-*- mode: sh; -*- +# Environment variables +export ARDUINO_DIR="/usr/share/arduino" +export ARDMK_DIR="$HOME/Programs/Arduino-Makefile" +export STEAMAPPS="$HOME/.local/share/Steam/steamapps/common" +export SCHOOL="$HOME/Documents/WPI" +export QT_STYLE_OVERRIDE=gtk +export ALTERNATE_EDITOR="" +export TERMINAL=roxterm diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..ac460ec --- /dev/null +++ b/.zshrc @@ -0,0 +1,44 @@ +#-*- mode: sh; -*- +# User configuration sourced by interactive shells + +# Source zim +if [[ -s ${ZDOTDIR:-${HOME}}/.zim/init.zsh ]]; then + source ${ZDOTDIR:-${HOME}}/.zim/init.zsh +fi + +# Command Specific Aliases +for i in $HOME/.aliases/command-specific/* +do + if hash $(basename $i) 2>/dev/null + then + source $i + fi +done + +# General Aliases +source $HOME/.aliases/general + +# Various Options +CORRECT_IGNORE="_*" +stty -ixon #disable XON/XOFF, which breaks C-s + +# Keybindings +my-backward-kill-word () { + local WORDCHARS=${WORDCHARS/\//} + zle backward-kill-word +} +zle -N my-backward-kill-word +bindkey '^H' my-backward-kill-word + +# Inserts 'sudo ' at the beginning of the line. +function prepend-sudo() { + if [[ "$BUFFER" != su(do|)\ * ]]; then + BUFFER="sudo $BUFFER" + (( CURSOR += 5 )) + fi +} +zle -N prepend-sudo +bindkey "^X^S" prepend-sudo + +#load fasd if it exists +hash fasd 2>/dev/null && eval "$(fasd --init auto)"