From a7340886b35251d582744af8e8fbd96f4309864a Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 28 Mar 2012 12:41:39 -0400 Subject: [PATCH] [#23] Rename plugins to modules --- .gitignore | 2 +- .gitmodules | 8 +-- README.md | 6 +- init.zsh | 46 ++++++------- .../archive/completions/_extract | 0 .../archive/completions/_ls-archive | 0 .../archive/functions/extract | 0 .../archive/functions/ls-archive | 0 .../command-not-found/README.md | 2 +- .../command-not-found/init.zsh | 0 {plugins => modules}/compleat/init.zsh | 0 modules/completion/completions | 1 + {plugins => modules}/dpkg/functions/apt-copy | 0 .../dpkg/functions/apt-history | 0 {plugins => modules}/dpkg/functions/dbb-build | 0 {plugins => modules}/dpkg/init.zsh | 0 {plugins => modules}/git/.gitignore | 0 {plugins => modules}/git/alias.zsh | 0 {plugins => modules}/git/completions/_git-hub | 0 .../git/completions/_git-hub-short-url | 0 .../git/completions/_git-info | 0 .../git/functions/git-current-branch | 0 {plugins => modules}/git/functions/git-hub | 0 .../git/functions/git-hub-short-url | 0 {plugins => modules}/git/functions/git-info | 36 +++++------ {plugins => modules}/git/functions/git-root | 0 {plugins => modules}/git/hub.zsh | 0 {plugins => modules}/git/init.zsh | 2 +- modules/git/style.zsh | 64 +++++++++++++++++++ {plugins => modules}/gnu-utils/README.md | 4 +- {plugins => modules}/gnu-utils/init.zsh | 2 +- {plugins => modules}/gpg-agent/init.zsh | 0 .../history-substring-search/README.md | 10 +-- .../history-substring-search/external | 0 .../history-substring-search/init.zsh | 4 +- {plugins => modules}/macports/init.zsh | 0 {plugins => modules}/node/functions/node-doc | 0 {plugins => modules}/node/init.zsh | 0 {plugins => modules}/osx/README.md | 2 +- {plugins => modules}/osx/functions/manb | 0 {plugins => modules}/osx/functions/manp | 0 {plugins => modules}/osx/functions/pfd | 0 {plugins => modules}/osx/functions/pfs | 0 {plugins => modules}/osx/functions/tab | 0 {plugins => modules}/osx/functions/trash | 0 {plugins => modules}/osx/init.zsh | 0 .../pacman/functions/pacdisowned | 0 {plugins => modules}/pacman/functions/paclist | 0 {plugins => modules}/pacman/init.zsh | 0 {plugins => modules}/perl/completions/_prep | 0 {plugins => modules}/perl/completions/_psub | 0 {plugins => modules}/perl/functions/prep | 0 {plugins => modules}/perl/functions/psub | 0 {plugins => modules}/perl/init.zsh | 0 {plugins => modules}/python/init.zsh | 0 {plugins => modules}/rails/init.zsh | 0 {plugins => modules}/rsync/init.zsh | 0 {plugins => modules}/ruby/init.zsh | 0 {plugins => modules}/screen/README.md | 4 +- {plugins => modules}/screen/init.zsh | 2 +- {plugins => modules}/ssh-agent/init.zsh | 8 +-- .../syntax-highlighting/external | 0 .../syntax-highlighting/init.zsh | 2 +- {plugins => modules}/tmux/README.md | 6 +- {plugins => modules}/tmux/init.zsh | 2 +- {plugins => modules}/wakeonlan/README | 2 +- .../wakeonlan/completions/_wake | 0 {plugins => modules}/wakeonlan/functions/wake | 0 {plugins => modules}/yum/init.zsh | 0 {plugins => modules}/z/init.zsh | 0 plugins/git/style.zsh | 64 ------------------- templates/zshrc | 8 +-- themes/sorin/prompt_sorin_setup | 31 +++++---- 73 files changed, 159 insertions(+), 159 deletions(-) rename {plugins => modules}/archive/completions/_extract (100%) rename {plugins => modules}/archive/completions/_ls-archive (100%) rename {plugins => modules}/archive/functions/extract (100%) rename {plugins => modules}/archive/functions/ls-archive (100%) rename {plugins => modules}/command-not-found/README.md (77%) rename {plugins => modules}/command-not-found/init.zsh (100%) rename {plugins => modules}/compleat/init.zsh (100%) create mode 160000 modules/completion/completions rename {plugins => modules}/dpkg/functions/apt-copy (100%) rename {plugins => modules}/dpkg/functions/apt-history (100%) rename {plugins => modules}/dpkg/functions/dbb-build (100%) rename {plugins => modules}/dpkg/init.zsh (100%) rename {plugins => modules}/git/.gitignore (100%) rename {plugins => modules}/git/alias.zsh (100%) rename {plugins => modules}/git/completions/_git-hub (100%) rename {plugins => modules}/git/completions/_git-hub-short-url (100%) rename {plugins => modules}/git/completions/_git-info (100%) rename {plugins => modules}/git/functions/git-current-branch (100%) rename {plugins => modules}/git/functions/git-hub (100%) rename {plugins => modules}/git/functions/git-hub-short-url (100%) rename {plugins => modules}/git/functions/git-info (88%) rename {plugins => modules}/git/functions/git-root (100%) rename {plugins => modules}/git/hub.zsh (100%) rename {plugins => modules}/git/init.zsh (88%) create mode 100644 modules/git/style.zsh rename {plugins => modules}/gnu-utils/README.md (85%) rename {plugins => modules}/gnu-utils/init.zsh (97%) rename {plugins => modules}/gpg-agent/init.zsh (100%) rename {plugins => modules}/history-substring-search/README.md (64%) rename {plugins => modules}/history-substring-search/external (100%) rename {plugins => modules}/history-substring-search/init.zsh (82%) rename {plugins => modules}/macports/init.zsh (100%) rename {plugins => modules}/node/functions/node-doc (100%) rename {plugins => modules}/node/init.zsh (100%) rename {plugins => modules}/osx/README.md (92%) rename {plugins => modules}/osx/functions/manb (100%) rename {plugins => modules}/osx/functions/manp (100%) rename {plugins => modules}/osx/functions/pfd (100%) rename {plugins => modules}/osx/functions/pfs (100%) rename {plugins => modules}/osx/functions/tab (100%) rename {plugins => modules}/osx/functions/trash (100%) rename {plugins => modules}/osx/init.zsh (100%) rename {plugins => modules}/pacman/functions/pacdisowned (100%) rename {plugins => modules}/pacman/functions/paclist (100%) rename {plugins => modules}/pacman/init.zsh (100%) rename {plugins => modules}/perl/completions/_prep (100%) rename {plugins => modules}/perl/completions/_psub (100%) rename {plugins => modules}/perl/functions/prep (100%) rename {plugins => modules}/perl/functions/psub (100%) rename {plugins => modules}/perl/init.zsh (100%) rename {plugins => modules}/python/init.zsh (100%) rename {plugins => modules}/rails/init.zsh (100%) rename {plugins => modules}/rsync/init.zsh (100%) rename {plugins => modules}/ruby/init.zsh (100%) rename {plugins => modules}/screen/README.md (81%) rename {plugins => modules}/screen/init.zsh (88%) rename {plugins => modules}/ssh-agent/init.zsh (86%) rename {plugins => modules}/syntax-highlighting/external (100%) rename {plugins => modules}/syntax-highlighting/init.zsh (79%) rename {plugins => modules}/tmux/README.md (82%) rename {plugins => modules}/tmux/init.zsh (93%) rename {plugins => modules}/wakeonlan/README (93%) rename {plugins => modules}/wakeonlan/completions/_wake (100%) rename {plugins => modules}/wakeonlan/functions/wake (100%) rename {plugins => modules}/yum/init.zsh (100%) rename {plugins => modules}/z/init.zsh (100%) delete mode 100644 plugins/git/style.zsh diff --git a/.gitignore b/.gitignore index fb1de5b..e05465f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ *.zwc *.zwc.old -plugins/*/cache.zsh +modules/*/cache.zsh diff --git a/.gitmodules b/.gitmodules index 5091b22..e192b3f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "completions"] path = completions url = https://github.com/zsh-users/zsh-completions.git -[submodule "plugins/history-substring-search/external"] - path = plugins/history-substring-search/external +[submodule "modules/history-substring-search/external"] + path = modules/history-substring-search/external url = https://github.com/zsh-users/zsh-history-substring-search.git -[submodule "plugins/syntax-highlighting/external"] - path = plugins/syntax-highlighting/external +[submodule "modules/syntax-highlighting/external"] + path = modules/syntax-highlighting/external url = https://github.com/zsh-users/zsh-syntax-highlighting.git diff --git a/README.md b/README.md index b9db9d6..c26912a 100644 --- a/README.md +++ b/README.md @@ -44,10 +44,10 @@ window or tab. Oh My Zsh has many features disabled by default. Read the source code and accompanying README files to learn of what is available. -### Plugins +### Modules -1. Browse `plugins/` to see what is available. -2. Load the plugins you need in `~/.zshrc` then open a new Zsh terminal window +1. Browse `modules/` to see what is available. +2. Load the modules you need in `~/.zshrc` then open a new Zsh terminal window or tab. ### Themes diff --git a/init.zsh b/init.zsh index 83f37bd..c886ccb 100644 --- a/init.zsh +++ b/init.zsh @@ -19,30 +19,30 @@ if [[ "$TERM" == 'dumb' ]]; then zstyle ':omz:prompt' theme 'off' fi -# Get enabled plugins. -zstyle -a ':omz:load' plugin 'plugins' +# Get enabled OMZ modules. +zstyle -a ':omz:load' omodule 'omodules' # Add functions to fpath. fpath=( ${0:h}/themes/*(/FN) - ${plugins:+${0:h}/plugins/${^plugins}/{functions,completions}(/FN)} + ${omodules:+${0:h}/modules/${^omodules}/{functions,completions}(/FN)} ${0:h}/{functions,completions}(/FN) $fpath ) -# Autoload Zsh modules. -zstyle -a ':omz:load' module 'zsh_modules' -for zsh_module in "$zsh_modules[@]"; do - zmodload "${(z)zsh_module}" +# Load Zsh modules. +zstyle -a ':omz:load' module 'zmodules' +for zmodule in "$zmodules[@]"; do + zmodload "${(z)zmodule}" done -unset zsh_modules zsh_module +unset zmodules zmodule # Autoload Zsh functions. -zstyle -a ':omz:load' function 'zsh_functions' -for zsh_function in "$zsh_functions[@]"; do - autoload -Uz "$zsh_function" +zstyle -a ':omz:load' function 'zfunctions' +for zfunction in "$zfunctions[@]"; do + autoload -Uz "$zfunction" done -unset zsh_functions zsh_function +unset zfunctions zfunction # Load and initialize the completion system ignoring insecure directories. autoload -Uz compinit && compinit -i @@ -59,31 +59,31 @@ source "${0:h}/spectrum.zsh" source "${0:h}/alias.zsh" source "${0:h}/utility.zsh" -# Source plugins defined in ~/.zshrc. -for plugin in "$plugins[@]"; do - if [[ ! -d "${0:h}/plugins/$plugin" ]]; then - print "omz: no such plugin: $plugin" >&2 +# Source modules defined in ~/.zshrc. +for omodule in "$omodules[@]"; do + if [[ ! -d "${0:h}/modules/$omodule" ]]; then + print "omz: no such module: $omodule" >&2 fi - if [[ -f "${0:h}/plugins/$plugin/init.zsh" ]]; then - source "${0:h}/plugins/$plugin/init.zsh" + if [[ -f "${0:h}/modules/$omodule/init.zsh" ]]; then + source "${0:h}/modules/$omodule/init.zsh" fi if (( $? == 0 )); then - zstyle ":omz:plugin:$plugin" loaded 'yes' + zstyle ":omz:module:$omodule" loaded 'yes' fi done -unset plugin plugins +unset omodule omodules # Autoload Oh My Zsh functions. for fdir in "$fpath[@]"; do if [[ "$fdir" == ${0:h}/(|*/)functions ]]; then - for omz_function in $fdir/[^_.]*(N.:t); do - autoload -Uz "$omz_function" + for ofunction in $fdir/[^_.]*(N.:t); do + autoload -Uz "$ofunction" done fi done -unset fdir omz_function +unset fdir ofunction # Set environment variables for launchd processes. if [[ "$OSTYPE" == darwin* ]]; then diff --git a/plugins/archive/completions/_extract b/modules/archive/completions/_extract similarity index 100% rename from plugins/archive/completions/_extract rename to modules/archive/completions/_extract diff --git a/plugins/archive/completions/_ls-archive b/modules/archive/completions/_ls-archive similarity index 100% rename from plugins/archive/completions/_ls-archive rename to modules/archive/completions/_ls-archive diff --git a/plugins/archive/functions/extract b/modules/archive/functions/extract similarity index 100% rename from plugins/archive/functions/extract rename to modules/archive/functions/extract diff --git a/plugins/archive/functions/ls-archive b/modules/archive/functions/ls-archive similarity index 100% rename from plugins/archive/functions/ls-archive rename to modules/archive/functions/ls-archive diff --git a/plugins/command-not-found/README.md b/modules/command-not-found/README.md similarity index 77% rename from plugins/command-not-found/README.md rename to modules/command-not-found/README.md index 2b73182..c580dbb 100644 --- a/plugins/command-not-found/README.md +++ b/modules/command-not-found/README.md @@ -6,7 +6,7 @@ Loads the [command-not-found][1] tool on Debian-based distributions. Authors ------- -*The authors of this plugin should be contacted via the GitHub issue tracker.* +*The authors of this module should be contacted via the GitHub issue tracker.* - [Joseph Booker](/sargas) diff --git a/plugins/command-not-found/init.zsh b/modules/command-not-found/init.zsh similarity index 100% rename from plugins/command-not-found/init.zsh rename to modules/command-not-found/init.zsh diff --git a/plugins/compleat/init.zsh b/modules/compleat/init.zsh similarity index 100% rename from plugins/compleat/init.zsh rename to modules/compleat/init.zsh diff --git a/modules/completion/completions b/modules/completion/completions new file mode 160000 index 0000000..b877df4 --- /dev/null +++ b/modules/completion/completions @@ -0,0 +1 @@ +Subproject commit b877df4e7090c9a45da6a4c5f25d8ad172ed2639 diff --git a/plugins/dpkg/functions/apt-copy b/modules/dpkg/functions/apt-copy similarity index 100% rename from plugins/dpkg/functions/apt-copy rename to modules/dpkg/functions/apt-copy diff --git a/plugins/dpkg/functions/apt-history b/modules/dpkg/functions/apt-history similarity index 100% rename from plugins/dpkg/functions/apt-history rename to modules/dpkg/functions/apt-history diff --git a/plugins/dpkg/functions/dbb-build b/modules/dpkg/functions/dbb-build similarity index 100% rename from plugins/dpkg/functions/dbb-build rename to modules/dpkg/functions/dbb-build diff --git a/plugins/dpkg/init.zsh b/modules/dpkg/init.zsh similarity index 100% rename from plugins/dpkg/init.zsh rename to modules/dpkg/init.zsh diff --git a/plugins/git/.gitignore b/modules/git/.gitignore similarity index 100% rename from plugins/git/.gitignore rename to modules/git/.gitignore diff --git a/plugins/git/alias.zsh b/modules/git/alias.zsh similarity index 100% rename from plugins/git/alias.zsh rename to modules/git/alias.zsh diff --git a/plugins/git/completions/_git-hub b/modules/git/completions/_git-hub similarity index 100% rename from plugins/git/completions/_git-hub rename to modules/git/completions/_git-hub diff --git a/plugins/git/completions/_git-hub-short-url b/modules/git/completions/_git-hub-short-url similarity index 100% rename from plugins/git/completions/_git-hub-short-url rename to modules/git/completions/_git-hub-short-url diff --git a/plugins/git/completions/_git-info b/modules/git/completions/_git-info similarity index 100% rename from plugins/git/completions/_git-info rename to modules/git/completions/_git-info diff --git a/plugins/git/functions/git-current-branch b/modules/git/functions/git-current-branch similarity index 100% rename from plugins/git/functions/git-current-branch rename to modules/git/functions/git-current-branch diff --git a/plugins/git/functions/git-hub b/modules/git/functions/git-hub similarity index 100% rename from plugins/git/functions/git-hub rename to modules/git/functions/git-hub diff --git a/plugins/git/functions/git-hub-short-url b/modules/git/functions/git-hub-short-url similarity index 100% rename from plugins/git/functions/git-hub-short-url rename to modules/git/functions/git-hub-short-url diff --git a/plugins/git/functions/git-info b/modules/git/functions/git-info similarity index 88% rename from plugins/git/functions/git-info rename to modules/git/functions/git-info index b5cfd33..5874bec 100644 --- a/plugins/git/functions/git-info +++ b/modules/git/functions/git-info @@ -206,9 +206,9 @@ function git-info { # Ignore submodule status. zstyle -b \ - ':omz:plugin:git:prompt:ignore' submodule 'ignore_submodule' + ':omz:module:git:prompt:ignore' submodule 'ignore_submodule' zstyle -s \ - ':omz:plugin:git:prompt:ignore:submodule' when 'ignore_submodule_when' + ':omz:module:git:prompt:ignore:submodule' when 'ignore_submodule_when' if is-true "$ignore_submodule"; then status_cmd+=" --ignore-submodules=${ignore_submodule_when:-all}" fi @@ -216,21 +216,21 @@ function git-info { # Format commit. commit="$(git rev-parse HEAD 2> /dev/null)" if [[ -n "$commit" ]]; then - zstyle -s ':omz:plugin:git:prompt' commit 'commit_format' + zstyle -s ':omz:module:git:prompt' commit 'commit_format' zformat -f commit_formatted "$commit_format" "c:$commit" fi # Format stashed. if [[ -f "$(_git-dir)/refs/stash" ]]; then stashed="$(git stash list 2> /dev/null | wc -l)" - zstyle -s ':omz:plugin:git:prompt' stashed 'stashed_format' + zstyle -s ':omz:module:git:prompt' stashed 'stashed_format' zformat -f stashed_formatted "$stashed_format" "S:$stashed" fi # Format action. action="$(_git-action)" if [[ -n "$action" ]]; then - zstyle -s ':omz:plugin:git:prompt' action 'action_format' + zstyle -s ':omz:module:git:prompt' action 'action_format' zformat -f action_formatted "$action_format" "s:$action" fi @@ -251,13 +251,13 @@ function git-info { # Format branch. branch="${$(git symbolic-ref -q HEAD)##refs/heads/}" if [[ -n "$branch" ]]; then - zstyle -s ':omz:plugin:git:prompt' branch 'branch_format' + zstyle -s ':omz:module:git:prompt' branch 'branch_format' zformat -f branch_formatted "$branch_format" "b:$branch" # Format remote. remote="${$(${(z)remote_cmd} 2> /dev/null)##refs/remotes/}" if [[ -n "$remote" ]]; then - zstyle -s ':omz:plugin:git:prompt' remote 'remote_format' + zstyle -s ':omz:module:git:prompt' remote 'remote_format' zformat -f remote_formatted "$remote_format" "R:$remote" # Get ahead and behind counts. @@ -266,14 +266,14 @@ function git-info { # Format ahead. ahead="$ahead_and_behind[(w)1]" if (( $ahead > 0 )); then - zstyle -s ':omz:plugin:git:prompt' ahead 'ahead_format' + zstyle -s ':omz:module:git:prompt' ahead 'ahead_format' zformat -f ahead_formatted "$ahead_format" "A:$ahead" fi # Format behind. behind="$ahead_and_behind[(w)2]" if (( $behind > 0 )); then - zstyle -s ':omz:plugin:git:prompt' behind 'behind_format' + zstyle -s ':omz:module:git:prompt' behind 'behind_format' zformat -f behind_formatted "$behind_format" "B:$behind" fi fi @@ -288,49 +288,49 @@ function git-info { # Format added. if (( $added > 0 )); then - zstyle -s ':omz:plugin:git:prompt' added 'added_format' + zstyle -s ':omz:module:git:prompt' added 'added_format' zformat -f added_formatted "$added_format" "a:$added_format" fi # Format deleted. if (( $deleted > 0 )); then - zstyle -s ':omz:plugin:git:prompt' deleted 'deleted_format' + zstyle -s ':omz:module:git:prompt' deleted 'deleted_format' zformat -f deleted_formatted "$deleted_format" "d:$deleted_format" fi # Format modified. if (( $modified > 0 )); then - zstyle -s ':omz:plugin:git:prompt' modified 'modified_format' + zstyle -s ':omz:module:git:prompt' modified 'modified_format' zformat -f modified_formatted "$modified_format" "m:$modified" fi # Format renamed. if (( $renamed > 0 )); then - zstyle -s ':omz:plugin:git:prompt' renamed 'renamed_format' + zstyle -s ':omz:module:git:prompt' renamed 'renamed_format' zformat -f renamed_formatted "$renamed_format" "r:$renamed" fi # Format unmerged. if (( $unmerged > 0 )); then - zstyle -s ':omz:plugin:git:prompt' unmerged 'unmerged_format' + zstyle -s ':omz:module:git:prompt' unmerged 'unmerged_format' zformat -f unmerged_formatted "$unmerged_format" "U:$unmerged" fi # Format untracked. if (( $untracked > 0 )); then - zstyle -s ':omz:plugin:git:prompt' untracked 'untracked_format' + zstyle -s ':omz:module:git:prompt' untracked 'untracked_format' zformat -f untracked_formatted "$untracked_format" "u:$untracked" fi # Format dirty. if (( $dirty > 0 )); then - zstyle -s ':omz:plugin:git:prompt' dirty 'dirty_format' + zstyle -s ':omz:module:git:prompt' dirty 'dirty_format' zformat -f dirty_formatted "$dirty_format" "D:$dirty" fi # Format prompts. - zstyle -s ':omz:plugin:git:prompt' prompt 'prompt_format' - zstyle -s ':omz:plugin:git:prompt' rprompt 'rprompt_format' + zstyle -s ':omz:module:git:prompt' prompt 'prompt_format' + zstyle -s ':omz:module:git:prompt' rprompt 'rprompt_format' git_info_vars=( git_prompt_info "$prompt_format" diff --git a/plugins/git/functions/git-root b/modules/git/functions/git-root similarity index 100% rename from plugins/git/functions/git-root rename to modules/git/functions/git-root diff --git a/plugins/git/hub.zsh b/modules/git/hub.zsh similarity index 100% rename from plugins/git/hub.zsh rename to modules/git/hub.zsh diff --git a/plugins/git/init.zsh b/modules/git/init.zsh similarity index 88% rename from plugins/git/init.zsh rename to modules/git/init.zsh index f8a6781..819422f 100644 --- a/plugins/git/init.zsh +++ b/modules/git/init.zsh @@ -5,7 +5,7 @@ # Sorin Ionescu # -# Source plugin files. +# Source module files. source "${0:h}/alias.zsh" source "${0:h}/hub.zsh" source "${0:h}/style.zsh" diff --git a/modules/git/style.zsh b/modules/git/style.zsh new file mode 100644 index 0000000..902dae2 --- /dev/null +++ b/modules/git/style.zsh @@ -0,0 +1,64 @@ +# +# Defines Git information display styles. +# +# Authors: +# Sorin Ionescu +# + +# %s - Special action name (am, merge, rebase). +zstyle ':omz:module:git:prompt' action 'action:%s' + +# %a - Indicator to notify of added files. +zstyle ':omz:module:git:prompt' added 'added:%a' + +# %A - Indicator to notify of ahead branch. +zstyle ':omz:module:git:prompt' ahead 'ahead:%A' + +# %B - Indicator to notify of behind branch. +zstyle ':omz:module:git:prompt' behind 'behind:%B' + +# %b - Branch name. +zstyle ':omz:module:git:prompt' branch 'branch:%b' + +# %c - SHA-1 hash. +zstyle ':omz:module:git:prompt' commit 'commit:%c' + +# %d - Indicator to notify of deleted files. +zstyle ':omz:module:git:prompt' deleted 'deleted:%d' + +# %D - Indicator to notify of dirty files. +zstyle ':omz:module:git:prompt' dirty 'dirty:%D' + +# %m - Indicator to notify of modified files. +zstyle ':omz:module:git:prompt' modified 'modified:%m' + +# %p - HEAD position in relation to the nearest branch, remote, tag. +zstyle ':omz:module:git:prompt' position 'position:%p' + +# %R - Remote name. +zstyle ':omz:module:git:prompt' remote 'remote:%R' + +# %r - Indicator to notify of renamed files. +zstyle ':omz:module:git:prompt' renamed 'renamed:%r' + +# %S - Indicator to notify of stashed files. +zstyle ':omz:module:git:prompt' stashed 'stashed:%S' + +# %U - Indicator to notify of unmerged files. +zstyle ':omz:module:git:prompt' unmerged 'unmerged:%U' + +# %u - Indicator to notify of untracked files. +zstyle ':omz:module:git:prompt' untracked 'untracked:%u' + +# Left prompt. +zstyle ':omz:module:git:prompt' prompt ' git:(%b %D)' + +# Right prompt. +zstyle ':omz:module:git:prompt' rprompt '' + +# Ignore submodule. +zstyle ':omz:module:git:prompt:ignore' submodule 'no' + +# Ignore submodule when it is 'dirty', 'untracked', 'all', or 'none'. +zstyle ':omz:module:git:prompt:ignore:submodule' when 'all' + diff --git a/plugins/gnu-utils/README.md b/modules/gnu-utils/README.md similarity index 85% rename from plugins/gnu-utils/README.md rename to modules/gnu-utils/README.md index 747f4bf..06f2cb9 100644 --- a/plugins/gnu-utils/README.md +++ b/modules/gnu-utils/README.md @@ -18,12 +18,12 @@ Settings To use a different prefix, add the following to *zshrc*, and replace 'g' with the desired prefix: - zstyle ':omz:plugin:gnu-utils' prefix 'g' + zstyle ':omz:module:gnu-utils' prefix 'g' Authors ------- -*The authors of this plugin should be contacted via the GitHub issue tracker.* +*The authors of this module should be contacted via the GitHub issue tracker.* - [Sorin Ionescu](/sorin-ionescu) diff --git a/plugins/gnu-utils/init.zsh b/modules/gnu-utils/init.zsh similarity index 97% rename from plugins/gnu-utils/init.zsh rename to modules/gnu-utils/init.zsh index 62e8850..a3ee3a3 100644 --- a/plugins/gnu-utils/init.zsh +++ b/modules/gnu-utils/init.zsh @@ -6,7 +6,7 @@ # # Get the prefix or use the default. -zstyle -s ':omz:plugin:gnu-utils' prefix '_gnu_utils_prefix' || +zstyle -s ':omz:module:gnu-utils' prefix '_gnu_utils_prefix' || _gnu_utils_prefix='g' # Check for the presence of GNU Core Utilities. diff --git a/plugins/gpg-agent/init.zsh b/modules/gpg-agent/init.zsh similarity index 100% rename from plugins/gpg-agent/init.zsh rename to modules/gpg-agent/init.zsh diff --git a/plugins/history-substring-search/README.md b/modules/history-substring-search/README.md similarity index 64% rename from plugins/history-substring-search/README.md rename to modules/history-substring-search/README.md index e851653..1e1356e 100644 --- a/plugins/history-substring-search/README.md +++ b/modules/history-substring-search/README.md @@ -10,24 +10,24 @@ Settings ### Case Sensitivity -To enable case-sensitivity for this plugin only, add the following line to +To enable case-sensitivity for this module only, add the following line to *zshrc*: - zstyle ':omz:plugin:history-substring-search' case-sensitive 'yes' + zstyle ':omz:module:history-substring-search' case-sensitive 'yes' ### Highlighting If colors are enabled, _history-substring-search_ will automatically highlight positive results. -To enable highlighting for this plugin only, and the following line to *zshrc*: +To enable highlighting for this module only, and the following line to *zshrc*: - zstyle -t ':omz:plugin:history-substring-search' color 'yes' + zstyle -t ':omz:module:history-substring-search' color 'yes' Authors ------- -*The authors of this plugin should be contacted via the GitHub issue tracker.* +*The authors of this module should be contacted via the GitHub issue tracker.* - [Sorin Ionescu](/sorin-ionescu) - [Suraj N. Kurapati](/sunaku) diff --git a/plugins/history-substring-search/external b/modules/history-substring-search/external similarity index 100% rename from plugins/history-substring-search/external rename to modules/history-substring-search/external diff --git a/plugins/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh similarity index 82% rename from plugins/history-substring-search/init.zsh rename to modules/history-substring-search/init.zsh index 196f2db..370cac3 100644 --- a/plugins/history-substring-search/init.zsh +++ b/modules/history-substring-search/init.zsh @@ -8,11 +8,11 @@ source "${0:h}/external/zsh-history-substring-search.zsh" -if zstyle -t ':omz:plugin:history-substring-search' case-sensitive; then +if zstyle -t ':omz:module:history-substring-search' case-sensitive; then unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS fi -if ! zstyle -t ':omz:plugin:history-substring-search' color; then +if ! zstyle -t ':omz:module:history-substring-search' color; then unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND fi diff --git a/plugins/macports/init.zsh b/modules/macports/init.zsh similarity index 100% rename from plugins/macports/init.zsh rename to modules/macports/init.zsh diff --git a/plugins/node/functions/node-doc b/modules/node/functions/node-doc similarity index 100% rename from plugins/node/functions/node-doc rename to modules/node/functions/node-doc diff --git a/plugins/node/init.zsh b/modules/node/init.zsh similarity index 100% rename from plugins/node/init.zsh rename to modules/node/init.zsh diff --git a/plugins/osx/README.md b/modules/osx/README.md similarity index 92% rename from plugins/osx/README.md rename to modules/osx/README.md index c0b22be..8b69e8f 100644 --- a/plugins/osx/README.md +++ b/modules/osx/README.md @@ -22,7 +22,7 @@ Functions Authors ------- -*The authors of this plugin should be contacted via the GitHub issue tracker.* +*The authors of this module should be contacted via the GitHub issue tracker.* - [Sorin Ionescu](/sorin-ionescu) diff --git a/plugins/osx/functions/manb b/modules/osx/functions/manb similarity index 100% rename from plugins/osx/functions/manb rename to modules/osx/functions/manb diff --git a/plugins/osx/functions/manp b/modules/osx/functions/manp similarity index 100% rename from plugins/osx/functions/manp rename to modules/osx/functions/manp diff --git a/plugins/osx/functions/pfd b/modules/osx/functions/pfd similarity index 100% rename from plugins/osx/functions/pfd rename to modules/osx/functions/pfd diff --git a/plugins/osx/functions/pfs b/modules/osx/functions/pfs similarity index 100% rename from plugins/osx/functions/pfs rename to modules/osx/functions/pfs diff --git a/plugins/osx/functions/tab b/modules/osx/functions/tab similarity index 100% rename from plugins/osx/functions/tab rename to modules/osx/functions/tab diff --git a/plugins/osx/functions/trash b/modules/osx/functions/trash similarity index 100% rename from plugins/osx/functions/trash rename to modules/osx/functions/trash diff --git a/plugins/osx/init.zsh b/modules/osx/init.zsh similarity index 100% rename from plugins/osx/init.zsh rename to modules/osx/init.zsh diff --git a/plugins/pacman/functions/pacdisowned b/modules/pacman/functions/pacdisowned similarity index 100% rename from plugins/pacman/functions/pacdisowned rename to modules/pacman/functions/pacdisowned diff --git a/plugins/pacman/functions/paclist b/modules/pacman/functions/paclist similarity index 100% rename from plugins/pacman/functions/paclist rename to modules/pacman/functions/paclist diff --git a/plugins/pacman/init.zsh b/modules/pacman/init.zsh similarity index 100% rename from plugins/pacman/init.zsh rename to modules/pacman/init.zsh diff --git a/plugins/perl/completions/_prep b/modules/perl/completions/_prep similarity index 100% rename from plugins/perl/completions/_prep rename to modules/perl/completions/_prep diff --git a/plugins/perl/completions/_psub b/modules/perl/completions/_psub similarity index 100% rename from plugins/perl/completions/_psub rename to modules/perl/completions/_psub diff --git a/plugins/perl/functions/prep b/modules/perl/functions/prep similarity index 100% rename from plugins/perl/functions/prep rename to modules/perl/functions/prep diff --git a/plugins/perl/functions/psub b/modules/perl/functions/psub similarity index 100% rename from plugins/perl/functions/psub rename to modules/perl/functions/psub diff --git a/plugins/perl/init.zsh b/modules/perl/init.zsh similarity index 100% rename from plugins/perl/init.zsh rename to modules/perl/init.zsh diff --git a/plugins/python/init.zsh b/modules/python/init.zsh similarity index 100% rename from plugins/python/init.zsh rename to modules/python/init.zsh diff --git a/plugins/rails/init.zsh b/modules/rails/init.zsh similarity index 100% rename from plugins/rails/init.zsh rename to modules/rails/init.zsh diff --git a/plugins/rsync/init.zsh b/modules/rsync/init.zsh similarity index 100% rename from plugins/rsync/init.zsh rename to modules/rsync/init.zsh diff --git a/plugins/ruby/init.zsh b/modules/ruby/init.zsh similarity index 100% rename from plugins/ruby/init.zsh rename to modules/ruby/init.zsh diff --git a/plugins/screen/README.md b/modules/screen/README.md similarity index 81% rename from plugins/screen/README.md rename to modules/screen/README.md index 00dfd9f..11e9573 100644 --- a/plugins/screen/README.md +++ b/modules/screen/README.md @@ -19,12 +19,12 @@ Start a Screen session automatically when Zsh is launched. To enable this feature, add the following line to *zshrc*: - zstyle ':omz:plugin:screen' auto-start 'yes' + zstyle ':omz:module:screen' auto-start 'yes' Authors ------- -*The authors of this plugin should be contacted via the GitHub issue tracker.* +*The authors of this module should be contacted via the GitHub issue tracker.* - [Sorin Ionescu](/sorin-ionescu) diff --git a/plugins/screen/init.zsh b/modules/screen/init.zsh similarity index 88% rename from plugins/screen/init.zsh rename to modules/screen/init.zsh index 2a789bc..8c0f1d5 100644 --- a/plugins/screen/init.zsh +++ b/modules/screen/init.zsh @@ -11,7 +11,7 @@ alias sn="screen -U -S" alias sr="screen -a -A -U -D -R" # Auto Start -if [[ -z "$STY" ]] && zstyle -t ':omz:plugin:screen' auto-start; then +if [[ -z "$STY" ]] && zstyle -t ':omz:module:screen' auto-start; then session="$( screen -list 2> /dev/null \ | sed '1d;$d' \ diff --git a/plugins/ssh-agent/init.zsh b/modules/ssh-agent/init.zsh similarity index 86% rename from plugins/ssh-agent/init.zsh rename to modules/ssh-agent/init.zsh index 8d9daf7..abc29c8 100644 --- a/plugins/ssh-agent/init.zsh +++ b/modules/ssh-agent/init.zsh @@ -13,11 +13,11 @@ # Usage: # To enable agent forwarding, add the following to your .zshrc: # -# zstyle ':omz:plugin:ssh-agent' forwarding 'yes' +# zstyle ':omz:module:ssh-agent' forwarding 'yes' # # To load multiple identities, add the following to your .zshrc: # -# zstyle ':omz:plugin:ssh-agent' identities 'id_rsa' 'id_rsa2' 'id_github' +# zstyle ':omz:module:ssh-agent' identities 'id_rsa' 'id_rsa2' 'id_github' # if (( ! $+commands[ssh-agent] )); then @@ -37,7 +37,7 @@ function _ssh-agent-start { source "${_ssh_agent_env}" > /dev/null # Load identities. - zstyle -a ':omz:plugin:ssh-agent' identities 'identities' + zstyle -a ':omz:module:ssh-agent' identities 'identities' if (( ${#identities} > 0 )); then ssh-add "${HOME}/.ssh/${^identities[@]}" @@ -47,7 +47,7 @@ function _ssh-agent-start { } # Test if agent-forwarding is enabled. -zstyle -b ':omz:plugin:ssh-agent' forwarding '_ssh_agent_forwarding' +zstyle -b ':omz:module:ssh-agent' forwarding '_ssh_agent_forwarding' if is-true "${_ssh_agent_forwarding}" && [[ -n "$SSH_AUTH_SOCK" ]]; then # Add a nifty symlink for screen/tmux if agent forwarding. [[ -L "$SSH_AUTH_SOCK" ]] || ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USER-screen diff --git a/plugins/syntax-highlighting/external b/modules/syntax-highlighting/external similarity index 100% rename from plugins/syntax-highlighting/external rename to modules/syntax-highlighting/external diff --git a/plugins/syntax-highlighting/init.zsh b/modules/syntax-highlighting/init.zsh similarity index 79% rename from plugins/syntax-highlighting/init.zsh rename to modules/syntax-highlighting/init.zsh index 5b8e751..bb77931 100644 --- a/plugins/syntax-highlighting/init.zsh +++ b/modules/syntax-highlighting/init.zsh @@ -5,7 +5,7 @@ # Sorin Ionescu # -if zstyle -t ':omz:plugin:syntax-highlighting' color; then +if zstyle -t ':omz:module:syntax-highlighting' color; then source "${0:h}/external/zsh-syntax-highlighting.zsh" ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor) fi diff --git a/plugins/tmux/README.md b/modules/tmux/README.md similarity index 82% rename from plugins/tmux/README.md rename to modules/tmux/README.md index 1590490..7738508 100644 --- a/plugins/tmux/README.md +++ b/modules/tmux/README.md @@ -18,12 +18,12 @@ Start a tmux session automatically when Zsh is launched. To enable this feature, add the following line to *zshrc*: - zstyle ':omz:plugin:tmux' auto-start 'yes' + zstyle ':omz:module:tmux' auto-start 'yes' It will create a background session named _#OMZ_ and attach every new shell to it. -To avoid keeping open sessions, this plugin sets `destroy-unattached off` on +To avoid keeping open sessions, this module sets `destroy-unattached off` on the background session and `destroy-unattached on` on every other session (global setting). @@ -36,7 +36,7 @@ OMZ has already been opened [here][2]. Authors ------- -*The authors of this plugin should be contacted via the github bug tracker.* +*The authors of this module should be contacted via the github bug tracker.* - [Sorin Ionescu](/sorin-ionescu) - [Colin Hebert](/ColinHebert) diff --git a/plugins/tmux/init.zsh b/modules/tmux/init.zsh similarity index 93% rename from plugins/tmux/init.zsh rename to modules/tmux/init.zsh index 9711ec6..c066ea9 100644 --- a/plugins/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -11,7 +11,7 @@ alias ta="tmux attach-session" alias tl="tmux list-sessions" # Auto Start -if [[ -z "$TMUX" ]] && zstyle -t ':omz:plugin:tmux' auto-start; then +if [[ -z "$TMUX" ]] && zstyle -t ':omz:module:tmux' auto-start; then tmux_session='#OMZ' if ! tmux has-session -t "$tmux_session" 2> /dev/null; then diff --git a/plugins/wakeonlan/README b/modules/wakeonlan/README similarity index 93% rename from plugins/wakeonlan/README rename to modules/wakeonlan/README index c728aea..66748da 100644 --- a/plugins/wakeonlan/README +++ b/modules/wakeonlan/README @@ -1,4 +1,4 @@ -This plugin provides a wrapper around the "wakeonlan" tool available from most +This module provides a wrapper around the "wakeonlan" tool available from most distributions' package repositories, or from the following website: http://gsd.di.uminho.pt/jpo/software/wakeonlan/ diff --git a/plugins/wakeonlan/completions/_wake b/modules/wakeonlan/completions/_wake similarity index 100% rename from plugins/wakeonlan/completions/_wake rename to modules/wakeonlan/completions/_wake diff --git a/plugins/wakeonlan/functions/wake b/modules/wakeonlan/functions/wake similarity index 100% rename from plugins/wakeonlan/functions/wake rename to modules/wakeonlan/functions/wake diff --git a/plugins/yum/init.zsh b/modules/yum/init.zsh similarity index 100% rename from plugins/yum/init.zsh rename to modules/yum/init.zsh diff --git a/plugins/z/init.zsh b/modules/z/init.zsh similarity index 100% rename from plugins/z/init.zsh rename to modules/z/init.zsh diff --git a/plugins/git/style.zsh b/plugins/git/style.zsh deleted file mode 100644 index 9a61e53..0000000 --- a/plugins/git/style.zsh +++ /dev/null @@ -1,64 +0,0 @@ -# -# Defines Git information display styles. -# -# Authors: -# Sorin Ionescu -# - -# %s - Special action name (am, merge, rebase). -zstyle ':omz:plugin:git:prompt' action 'action:%s' - -# %a - Indicator to notify of added files. -zstyle ':omz:plugin:git:prompt' added 'added:%a' - -# %A - Indicator to notify of ahead branch. -zstyle ':omz:plugin:git:prompt' ahead 'ahead:%A' - -# %B - Indicator to notify of behind branch. -zstyle ':omz:plugin:git:prompt' behind 'behind:%B' - -# %b - Branch name. -zstyle ':omz:plugin:git:prompt' branch 'branch:%b' - -# %c - SHA-1 hash. -zstyle ':omz:plugin:git:prompt' commit 'commit:%c' - -# %d - Indicator to notify of deleted files. -zstyle ':omz:plugin:git:prompt' deleted 'deleted:%d' - -# %D - Indicator to notify of dirty files. -zstyle ':omz:plugin:git:prompt' dirty 'dirty:%D' - -# %m - Indicator to notify of modified files. -zstyle ':omz:plugin:git:prompt' modified 'modified:%m' - -# %p - HEAD position in relation to the nearest branch, remote, tag. -zstyle ':omz:plugin:git:prompt' position 'position:%p' - -# %R - Remote name. -zstyle ':omz:plugin:git:prompt' remote 'remote:%R' - -# %r - Indicator to notify of renamed files. -zstyle ':omz:plugin:git:prompt' renamed 'renamed:%r' - -# %S - Indicator to notify of stashed files. -zstyle ':omz:plugin:git:prompt' stashed 'stashed:%S' - -# %U - Indicator to notify of unmerged files. -zstyle ':omz:plugin:git:prompt' unmerged 'unmerged:%U' - -# %u - Indicator to notify of untracked files. -zstyle ':omz:plugin:git:prompt' untracked 'untracked:%u' - -# Left prompt. -zstyle ':omz:plugin:git:prompt' prompt ' git:(%b %D)' - -# Right prompt. -zstyle ':omz:plugin:git:prompt' rprompt '' - -# Ignore submodule. -zstyle ':omz:plugin:git:prompt:ignore' submodule 'no' - -# Ignore submodule when it is 'dirty', 'untracked', 'all', or 'none'. -zstyle ':omz:plugin:git:prompt:ignore:submodule' when 'all' - diff --git a/templates/zshrc b/templates/zshrc index 22deb61..16528df 100644 --- a/templates/zshrc +++ b/templates/zshrc @@ -21,13 +21,13 @@ zstyle ':omz:*:*' color 'yes' zstyle ':omz:terminal' auto-title 'yes' # Set the Zsh modules to load (man zshmodules). -# zstyle ':omz:load' module 'attr' 'stat' +# zstyle ':omz:load' zmodule 'attr' 'stat' # Set the Zsh functions to load (man zshcontrib). -# zstyle ':omz:load' function 'zargs' 'zmv' +# zstyle ':omz:load' zfunction 'zargs' 'zmv' -# Set the plugins to load (browse plugins). -zstyle ':omz:load' plugin 'archive' 'git' +# Set the Oh My Zsh modules to load (browse modules). +zstyle ':omz:load' omodule 'archive' 'git' # Set the prompt theme to load. # Setting it to 'random' loads a random theme. diff --git a/themes/sorin/prompt_sorin_setup b/themes/sorin/prompt_sorin_setup index 7565cbd..7d48852 100644 --- a/themes/sorin/prompt_sorin_setup +++ b/themes/sorin/prompt_sorin_setup @@ -28,21 +28,21 @@ function prompt_sorin_setup { zstyle ':omz:editor' completing '%B%F{red}...%f%b' zstyle ':omz:prompt:vi' insert '' zstyle ':omz:prompt:vi' command ' %F{yellow}❮%f%B%F{red}❮%f%b%F{red}❮%f' - zstyle ':omz:plugin:git:prompt' action ':%%B%F{yellow}%s%f%%b' - zstyle ':omz:plugin:git:prompt' added ' %%B%F{green}✚%f%%b' - zstyle ':omz:plugin:git:prompt' ahead ' %%B%F{yellow}⬆%f%%b' - zstyle ':omz:plugin:git:prompt' behind ' %%B%F{yellow}⬇%f%%b' - zstyle ':omz:plugin:git:prompt' branch ':%F{red}%b%f' - zstyle ':omz:plugin:git:prompt' commit ':%F{green}%.7c%f' - zstyle ':omz:plugin:git:prompt' deleted ' %%B%F{red}✖%f%%b' - zstyle ':omz:plugin:git:prompt' modified ' %%B%F{blue}✱%f%%b' - zstyle ':omz:plugin:git:prompt' position ':%F{green}%p%f' - zstyle ':omz:plugin:git:prompt' renamed ' %%B%F{magenta}➜%f%%b' - zstyle ':omz:plugin:git:prompt' stashed ' %%B%F{cyan}✭%f%%b' - zstyle ':omz:plugin:git:prompt' unmerged ' %%B%F{yellow}═%f%%b' - zstyle ':omz:plugin:git:prompt' untracked ' %%B%F{white}◼%f%%b' - zstyle ':omz:plugin:git:prompt' prompt ' %F{blue}git%f$(coalesce "%b" "%p" "%c")%s' - zstyle ':omz:plugin:git:prompt' rprompt '%A%B%S%a%d%m%r%U%u' + zstyle ':omz:module:git:prompt' action ':%%B%F{yellow}%s%f%%b' + zstyle ':omz:module:git:prompt' added ' %%B%F{green}✚%f%%b' + zstyle ':omz:module:git:prompt' ahead ' %%B%F{yellow}⬆%f%%b' + zstyle ':omz:module:git:prompt' behind ' %%B%F{yellow}⬇%f%%b' + zstyle ':omz:module:git:prompt' branch ':%F{red}%b%f' + zstyle ':omz:module:git:prompt' commit ':%F{green}%.7c%f' + zstyle ':omz:module:git:prompt' deleted ' %%B%F{red}✖%f%%b' + zstyle ':omz:module:git:prompt' modified ' %%B%F{blue}✱%f%%b' + zstyle ':omz:module:git:prompt' position ':%F{green}%p%f' + zstyle ':omz:module:git:prompt' renamed ' %%B%F{magenta}➜%f%%b' + zstyle ':omz:module:git:prompt' stashed ' %%B%F{cyan}✭%f%%b' + zstyle ':omz:module:git:prompt' unmerged ' %%B%F{yellow}═%f%%b' + zstyle ':omz:module:git:prompt' untracked ' %%B%F{white}◼%f%%b' + zstyle ':omz:module:git:prompt' prompt ' %F{blue}git%f$(coalesce "%b" "%p" "%c")%s' + zstyle ':omz:module:git:prompt' rprompt '%A%B%S%a%d%m%r%U%u' PROMPT='%F{cyan}%1~%f${(e)git_prompt_info} %(!.%B%F{red}#%f%b.%B%F{green}❯%f%b) ' RPROMPT='${vi_prompt_info}%(?:: %F{red}⏎%f)${VIM:+" %B%F{green}V%f%b"}${git_rprompt_info}' @@ -50,4 +50,3 @@ function prompt_sorin_setup { } prompt_sorin_setup "$@" -