1
0
Fork 0
mirror of synced 2024-12-25 23:43:20 -05:00

Stop supporting themes that require prompinit

Only 5% (18/342) of the themes listed under [unixorn/awesome-zsh-plugins]
are actually compatible with prompinit. Of these, [clean] also allows
being sourced directly. On the other hand, 3 others are prezto themes.

promptinit would be useful for who wants to try many themes without the
need to restart their shell session. And must be many many, so
"brute-force" starting a new shell to experiment each new theme would be
a burden! Even the cleanup feature of promptinit is still incomplete, so
you eventually get a messy prompt after trying many with it. And that's
not even a everyday use case of the average Zsh user.

So prompinit it not widely supported out there, and also not very useful
for the everyday let-me-use-my-beloved-and-carefully-customized-prompt-during-the-whole-shell-session-pleasee
scenario. It's also faster and simpler to directly just source the prompt
theme to be used, not even having to autoload promptinit and let it scan
all the others themes in fpath that won't be used.
And the Zim "philosophy" is to use fast and simple solutions.
So here we go.

Fixes #325

[unixorn/awesome-zsh-plugins]: e226f3de04/README.md (themes)
[clean]: https://github.com/BrandonRoehl/zsh-clean
This commit is contained in:
Eric Nielsen 2019-01-19 19:43:37 -05:00
parent 536d7b7890
commit 27508e363c
No known key found for this signature in database
GPG key ID: 47D1DBFA0765A1FB
3 changed files with 8 additions and 31 deletions

View file

@ -89,21 +89,6 @@ configured as a module called `async`:
because it has an async.zsh initialization file. Then to be enabled, `async` must
be added to the modules style.
### Prompt theme
Prompt themes are enabled in one of two different ways, depending on how the
specific theme you want works:
1. If it has a prompt_<em>module</em>_setup file: it is enabled with Zim's
`prompt` module. See [the instructions
here](https://github.com/zimfw/prompt/blob/master/README.md#settings). All
[Zim themes](https://github.com/zimfw/zimfw/wiki/Themes) work this way.
The advantage of these themes is that you can customize them with
additional parameters.
2. If it has one of the initialization files listed above: it is enabled when
it's sourced, not with Zim's `prompt` module. The last sourced prompt
overrides any previous ones.
Updating
--------

View file

@ -1,5 +1,5 @@
autoload -Uz is-at-least && if ! is-at-least 5.2; then
print "init: error starting Zim: You're using Zsh version ${ZSH_VERSION} and versions < 5.2 are not supported. Update your Zsh." >&2
print -u2 "init: error starting Zim: You're using Zsh version ${ZSH_VERSION} and versions < 5.2 are not supported. Update your Zsh."
return 1
fi
@ -38,11 +38,9 @@ fi
for zmodule in ${zmodules}; do
zdir=${ZIM_HOME}/modules/${zmodule}
if [[ ! -d ${zdir} ]]; then
print "init: module ${zmodule} not installed" >&2
elif [[ -f ${zdir}/prompt_${zmodule}_setup ]]; then
fpath=(${zdir} ${fpath}) # Will be loaded by promptinit
print -u2 "init: module ${zmodule} not installed"
else
for zfile in ${zdir}/init.zsh ${zdir}/${zmodule}.{zsh,plugin.zsh,zsh-theme,sh}; do
for zfile in ${zdir}/{init.zsh,${zmodule}.{zsh,plugin.zsh,zsh-theme,sh}}; do
if [[ -f ${zfile} ]]; then
source ${zfile}
break
@ -74,7 +72,7 @@ _zimfw_compile() {
done
# Compile enabled modules' scripts
for zfile in ${ZIM_HOME}/modules/${^zmodules}/(^*test*/)#{*.zsh{,-theme},prompt_*_setup}(.NLk+1); do
for zfile in ${ZIM_HOME}/modules/${^zmodules}/(^*test*/)#*.zsh{,-theme}(.NLk+1); do
zrecompile -p ${1} ${zfile}
done

View file

@ -8,11 +8,12 @@
# Select what modules you would like enabled. Modules are sourced in the order given.
zstyle ':zim' modules \
directory environment git git-info history input utility \
eriner gitster magicmace s1ck94 steeef prompt \
zsh-completions completion zsh-autosuggestions zsh-syntax-highlighting history-substring-search
steeef \
zsh-completions completion \
zsh-autosuggestions zsh-syntax-highlighting history-substring-search
# Modules setup configuration.
# See ...
# See https://github.com/zimfw/zimfw/blob/develop/README.md#module-customization
zstyle ':zim:module' zsh-completions 'url' 'zsh-users/zsh-completions'
zstyle ':zim:module' zsh-autosuggestions 'url' 'zsh-users/zsh-autosuggestions'
zstyle ':zim:module' zsh-syntax-highlighting 'url' 'zsh-users/zsh-syntax-highlighting'
@ -66,13 +67,6 @@ zstyle ':zim:module' zsh-syntax-highlighting 'url' 'zsh-users/zsh-syntax-highlig
# Load any helper scripts as defined here.
#zstyle ':zim:pacman' helpers 'aur'
#
# prompt
#
# Set your desired prompt theme.
zstyle ':zim:prompt' theme 'steeef'
#
# ssh
#