diff --git a/.gitmodules b/.gitmodules index f26f5db..696b396 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "oh-my-zsh"] - path = oh-my-zsh - url = https://github.com/robbyrussell/oh-my-zsh.git -[submodule "fast-syntax-highlighting"] - path = fast-syntax-highlighting - url = https://github.com/zdharma/fast-syntax-highlighting.git +[submodule "zgen"] + path = zgen + url = https://github.com/tarjoilija/zgen.git diff --git a/fast-syntax-highlighting b/fast-syntax-highlighting deleted file mode 160000 index 8ac992d..0000000 --- a/fast-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8ac992d99c5da68fe729cb6fb365622d36c9e957 diff --git a/lib/oh-my-zsh.zsh b/lib/oh-my-zsh.zsh deleted file mode 100644 index 67ffe31..0000000 --- a/lib/oh-my-zsh.zsh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env zsh - -configure_oh_my_zsh() { - export ZSH="$DOTFILES_PATH/oh-my-zsh" - - # see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes - export ZSH_THEME="agnoster" - - # use hyphen-insensitive completion (makes `_` and `-` interchangeable) - export HYPHEN_INSENSITIVE="true" - - # enable command auto-correction - export ENABLE_CORRECTION="true" - - # display red dots while waiting for completion - export COMPLETION_WAITING_DOTS="true" - - # disable marking untracked files under VCS as dirty (this makes repository - # status check for large repositories faster) - export DISABLE_UNTRACKED_FILES_DIRTY="true" - - # command execution time stamp shown in the history - export HIST_STAMPS="mm/dd/yyyy" - - # https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins - plugins=( - git - common-aliases - extract - ) - - if is_linux; then - plugins+=(command-not-found) - fi -} - -configure_oh_my_zsh -source "$ZSH/oh-my-zsh.sh" diff --git a/lib/theme.zsh b/lib/theme.zsh index a999611..63996b6 100644 --- a/lib/theme.zsh +++ b/lib/theme.zsh @@ -1,11 +1,5 @@ #!/usr/bin/env zsh -configure_syntax_highlighting() { - # set directory for compiled theme files - FAST_WORK_DIR="$DOTFILES_PATH/cache" - source "$DOTFILES_PATH/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" -} - configure_dircolors() { [[ -f ~/.dircolors ]] && eval "$(dircolors ~/.dircolors)" [[ -z "$LS_COLORS" ]] && eval "$(dircolors -b)" @@ -13,5 +7,4 @@ configure_dircolors() { zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" } -configure_syntax_highlighting configure_dircolors diff --git a/lib/zgen.zsh b/lib/zgen.zsh new file mode 100644 index 0000000..c728813 --- /dev/null +++ b/lib/zgen.zsh @@ -0,0 +1,44 @@ +#!/usr/bin/env zsh + +configure_oh_my_zsh() { + # use hyphen-insensitive completion (makes `_` and `-` interchangeable) + HYPHEN_INSENSITIVE="true" + + # enable command auto-correction + ENABLE_CORRECTION="true" + + # display red dots while waiting for completion + COMPLETION_WAITING_DOTS="true" + + # disable marking untracked files under VCS as dirty (this makes repository + # status check for large repositories faster) + DISABLE_UNTRACKED_FILES_DIRTY="true" + + # command execution time stamp shown in the history + HIST_STAMPS="mm/dd/yyyy" +} + +configure_syntax_highlighting() { + FAST_WORK_DIR="$DOTFILES_PATH/cache" +} + +configure_oh_my_zsh +configure_syntax_highlighting + +source "$DOTFILES_PATH/zgen/zgen.zsh" + +if ! zgen saved; then + zgen oh-my-zsh + + zgen oh-my-zsh plugins/git + zgen oh-my-zsh plugins/common-aliases + zgen oh-my-zsh plugins/extract + zgen oh-my-zsh plugins/fasd + is_linux && zgen oh-my-zsh plugins/command-not-found + + zgen load zdharma/fast-syntax-highlighting + + zgen oh-my-zsh themes/agnoster + + zgen save +fi diff --git a/oh-my-zsh b/oh-my-zsh deleted file mode 160000 index 05b6170..0000000 --- a/oh-my-zsh +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 05b617066ba5a37ef0c533385efd6e232a387b8f diff --git a/zgen b/zgen new file mode 160000 index 0000000..0b669d2 --- /dev/null +++ b/zgen @@ -0,0 +1 @@ +Subproject commit 0b669d2d0dcf788b4c81a7a30b4fa41dfbf7d1a7 diff --git a/zshrc b/zshrc index 745964a..97cfbf3 100755 --- a/zshrc +++ b/zshrc @@ -2,7 +2,7 @@ DOTFILES_PATH="${0:h}" -for script in oh-my-zsh aliases widgets theme; do +for script in zgen aliases widgets theme; do source "$DOTFILES_PATH/lib/$script.zsh" source_if_exists "$DOTFILES_PATH/custom/$script.zsh" done