This commit is contained in:
Eric Nielsen 2021-11-06 17:04:47 -05:00
parent 4259e64d22
commit d7229bb6bc
No known key found for this signature in database
GPG Key ID: 47D1DBFA0765A1FB
6 changed files with 62 additions and 11 deletions

View File

@ -7,12 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
_No unreleased changes._
## [1.6.0] - 2021-11-06
### Added
- `list` action. Using it with `-v` also shows the current details for all
modules.
### Changed
- Be quieter and don't output warnings when `-q` is provided.
- Be more verbose when `-v` is provided: show skipped external and frozen
modules with the install and update actions.
- Show warning instead of error when module was not installed with the tool
currently in use.
- Manually setting any `zmodule` initialization option will disable all the
default values from the other initialization options, so only user-provided
values are used in this case. I.e. it's either all automatic, or all manual.
@ -206,7 +214,8 @@ Take your time to review the updated [README.md] and the changes listed below.
[termtitle]: https://github.com/zimfw/termtitle
[s1ck94]: https://github.com/zimfw/s1ck94
[Unreleased]: https://github.com/zimfw/zimfw/compare/v1.5.0...HEAD
[Unreleased]: https://github.com/zimfw/zimfw/compare/v1.6.0...HEAD
[1.6.0]: https://github.com/zimfw/zimfw/compare/v1.5.0...v1.6.0
[1.5.0]: https://github.com/zimfw/zimfw/compare/v1.4.3...v1.5.0
[1.4.3]: https://github.com/zimfw/zimfw/compare/v1.4.2...v1.4.3
[1.4.2]: https://github.com/zimfw/zimfw/compare/v1.4.1...v1.4.2

View File

@ -33,7 +33,7 @@ To preview some of the available themes, check the [themes page][themes].
### Degit
Install modules without requiring `git` using our degit tool. It's faster and
lighter. See the [zmodule](#zmodule) usage below.
lighter than `git`. See the [zmodule](#zmodule-usage) usage below.
Installation
------------
@ -78,8 +78,41 @@ you can add to your `~/.zimrc`.
Usage
-----
Add `zmodule` calls to your `~/.zimrc` file to define the modules to be
initialized, then run `zimfw install` to install them.
### zmodule
Below are some usage examples.
A module from the [zimfw] organization: `zmodule archive`
A module from another GitHub organization: `zmodule StackExchange/blackbox`
A module not from GitHub: `zmodule https://gitlab.com/Spriithy/basher.git`
A module at an absolute path, that is already installed:
`zmodule /usr/local/share/zsh-autosuggestions`
A module with a custom fpath: `zmodule zsh-users/zsh-completions --fpath src`
A module with a custom initialization file name:
`zmodule spaceship-prompt/spaceship-prompt --source spaceship.zsh` or
`zmodule spaceship-prompt/spaceship-prompt --name spaceship`
A module with two custom initialization files:
`zmodule sindresorhus/pure --source async.zsh --source pure.zsh`
A module with custom initialization commands:
`zmodule skywind3000/z.lua --cmd 'export _ZL_HYPHEN=1' --cmd 'eval "$(lua {}/z.lua --init zsh enhanced once)"'`
A module with a big git repository: `zmodule romkatv/powerlevel10k --use degit`
<!-- As of 2021-11-06, the complete repo had 83M and took 1m59s to be cloned,
and the degit'ed module had 2.9M and took 3s to be installed. -->
<details id="zmodule-usage">
<summary>Want help with the complete <code>zmodule</code> usage?</summary>
<pre>Usage: <b>zmodule</b> &lt;url&gt; [<b>-n</b>|<b>--name</b> &lt;module_name&gt;] [options]
Add <b>zmodule</b> calls to your <b>~/.zimrc</b> file to define the modules to be initialized. The modules are
@ -118,8 +151,14 @@ Initialization options:
command are substituted by the module root directory path.
I.e., <b>-s &apos;script.zsh&apos;</b> and <b>-c &apos;source {}/script.zsh&apos;</b> are equivalent.
<b>-d</b>|<b>--disabled</b> Don&apos;t initialize or uninstall the module.
Setting any initialization option above will disable all the default values from the other ini-
tialization options, so only your provided values are used. I.e. these values are either all
automatic, or all manual.
</pre>
</details>
### zimfw
Added new modules to `~/.zimrc`? Run `zimfw install`.
@ -155,3 +194,4 @@ remove the initialization lines from your `~/.zshenv`, `~/.zshrc` and `~/.zlogin
[blazing speed]: https://github.com/zimfw/zimfw/wiki/Speed
[modules]: https://zimfw.sh/docs/modules/
[themes]: https://zimfw.sh/docs/themes/
[zimfw]: https://github.com/zimfw

View File

@ -11,9 +11,11 @@ Actions:
%Bhelp%b Print this help.
%Binfo%b Print Zim and system info.
%Blist%b List all modules. Use %B-v%b to also see the current details for all modules.
%Binstall%b Install new modules. Also does %Bbuild%b, %Bcompile%b. Use %B-v%b to also see their output.
%Binstall%b Install new modules. Also does %Bbuild%b and %Bcompile%b. Use %B-v%b to also see their
output, and see skipped modules.
%Buninstall%b Delete unused modules. Prompts for confirmation. Use %B-q%b to uninstall quietly.
%Bupdate%b Update current modules. Also does %Bbuild%b, %Bcompile%b. Use %B-v%b to see their output.
%Bupdate%b Update current modules. Also does %Bbuild%b and %Bcompile%b. Use %B-v%b to see their
output, and see skipped modules.
%Bupgrade%b Upgrade zimfw. Also does %Bcompile%b. Use %B-v%b to also see its output.
%Bversion%b Print zimfw version.

View File

@ -110,7 +110,6 @@ case ${ACTION} in
}
;;
update)
if [[ -r ${DIR}/.zim_degit_info ]] command mv -f ${DIR}/.zim_degit_info ${INFO_TARGET}
if [[ ! -r ${INFO_TARGET} ]]; then
if (( PRINTLEVEL > 0 )); then
print -u2 -PR <%= clear_line %>"%F{yellow}<%= warn %>%B${MODULE}:%b Module was not installed using Zim's degit. Will not try to update. You can disable this with the zmodule option -z|--frozen.%f"

View File

@ -4,7 +4,7 @@ class Zim
:clear_line, :ellipsis, :okay, :warn, :error, :done, :failed
def initialize
@version = "1.6.0-SNAPSHOT"
@version = "1.6.0"
@home = "${ZDOTDIR:-${HOME}}"
@min_zsh_version = "5.2"
@startup_files_glob = ".z(shenv|profile|shrc|login|logout)"

View File

@ -373,7 +373,7 @@ _zimfw_compile() {
}
_zimfw_info() {
print -R 'zimfw version: '${_zversion}' (built at 2021-10-26 15:35:30 UTC, previous commit is a86f69a)'
print -R 'zimfw version: '${_zversion}' (built at 2021-11-06 21:22:50 UTC, previous commit is 4259e64)'
print -R 'ZIM_HOME: '${ZIM_HOME}
print -R 'Zsh version: '${ZSH_VERSION}
print -R 'System info: '$(command uname -a)
@ -594,7 +594,6 @@ case \${ACTION} in
}
;;
update)
if [[ -r \${DIR}/.zim_degit_info ]] command mv -f \${DIR}/.zim_degit_info \${INFO_TARGET}
if [[ ! -r \${INFO_TARGET} ]]; then
if (( PRINTLEVEL > 0 )); then
print -u2 -PR $'\E[2K\r'\"%F{yellow}! %B\${MODULE}:%b Module was not installed using Zim's degit. Will not try to update. You can disable this with the zmodule option -z|--frozen.%f\"
@ -717,7 +716,7 @@ esac
}
zimfw() {
local -r _zversion='1.6.0-SNAPSHOT' zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
local -r _zversion='1.6.0' zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
Actions:
%Bbuild%b Build %B${ZIM_HOME}/init.zsh%b and %B${ZIM_HOME}/login_init.zsh%b.
@ -729,9 +728,11 @@ Actions:
%Bhelp%b Print this help.
%Binfo%b Print Zim and system info.
%Blist%b List all modules. Use %B-v%b to also see the current details for all modules.
%Binstall%b Install new modules. Also does %Bbuild%b, %Bcompile%b. Use %B-v%b to also see their output.
%Binstall%b Install new modules. Also does %Bbuild%b and %Bcompile%b. Use %B-v%b to also see their
output, and see skipped modules.
%Buninstall%b Delete unused modules. Prompts for confirmation. Use %B-q%b to uninstall quietly.
%Bupdate%b Update current modules. Also does %Bbuild%b, %Bcompile%b. Use %B-v%b to see their output.
%Bupdate%b Update current modules. Also does %Bbuild%b and %Bcompile%b. Use %B-v%b to see their
output, and see skipped modules.
%Bupgrade%b Upgrade zimfw. Also does %Bcompile%b. Use %B-v%b to also see its output.
%Bversion%b Print zimfw version.