Commit Graph

627 Commits

Author SHA1 Message Date
Eric Nielsen 3959a7f4e0
Add `--if` option to `zmodule`
Fixes #355
2022-10-06 19:52:57 -05:00
Eric Nielsen 8a9d63c522
Fix quoting string in glob
so it does not get expanded as a glob itself, if it contains special
characters.
2022-09-28 19:42:05 -05:00
Eric Nielsen 3351dc6dac
Update CHANGELOG.md 2022-09-27 17:50:52 -05:00
Eric Nielsen 238da94b54
v1.10.0 2022-09-27 17:45:16 -05:00
Eric Nielsen 05b8e0cdf2
Add `--root` option to `zmodule`
which makes it straighforward to use repositories that contain multiple
modules, like sorin-ionescu/prezto or ohmyzsh/ohmyzsh.
2022-09-26 20:33:49 -05:00
Eric Nielsen 887bfd6a03
Update info action output and update README.md
Show the value of some relevant environment variables instead of calling
uname, which might show private information like the host name.

Other minor fixes regarding output.
2022-08-02 12:49:09 -05:00
Eric Nielsen b5703f9e17
Update CHANGELOG.md 2022-05-24 16:29:36 -05:00
Eric Nielsen a620953556
v1.9.1 2022-05-24 16:25:32 -05:00
Eric Nielsen 5bcfb8cc9f
Override repository options along zmodule calls
for the same module name. Other minor fixes:
* Show skipping already installed modules with install action and `-v`.
* Consider external module dirs when calling compile action directly, by
  making sure _zimfw_source_zimrc is called first.
* Ignore return value from `zargs` with `-P`, as it's oddly returning
  123 since Zsh 5.9. Maybe related to these changes:
  67f932e7c5
2022-05-17 18:43:59 -05:00
Eric Nielsen d6b4aa6ff4
v1.9.0 2022-05-09 18:36:03 -05:00
Eric Nielsen 741bb78a04
Add `--on-pull` option to `zmodule`
Fixes #456
2022-05-07 16:31:08 -05:00
Eric Nielsen e0fe8ef9c9
Update README.md with one more .zimrc example
and hopefully make it clear that the completion module is optional, and
just for users that prefer our predefined configuration instead of their
own set up calling compinit directly.
2022-03-18 22:43:01 -05:00
Eric Nielsen 98fd5fa4da
Update README.md 2022-03-06 17:28:23 -05:00
Eric Nielsen 8b8938f414
Update CHANGELOG.md 2022-03-04 09:17:30 -05:00
RayZ0rr 97133502fd
Update README.md with badges, ToC, sample rc files
Closes #453

Co-authored-by: Eric Nielsen <eric@amalgamar.com.br>
2022-03-03 21:19:40 -05:00
Eric Nielsen 4fe7c66e07
v1.8.0 2022-01-25 17:19:34 -05:00
Eric Nielsen 72fe20c5bd
Update LICENSE 2022-01-25 17:14:27 -05:00
Eric Nielsen 27dcd4832e
Add `--no-submodules` option to `zmodule`
Fixes #409
2022-01-25 09:32:50 -05:00
Eric Nielsen 016e498bd6
Also work when _zim_fpath is not set
when doing `zimfw check-dumpfile`, otherwise it won't work until init.zsh
is rebuilt, because it's a newly introduced variable.
2022-01-24 18:58:28 -05:00
Eric Nielsen ac2843d8c8
Simplify check-dumpfile to do the same as compinit
first because simpler is usually better, and second because we cannot
always guarantee that the .latest_comp file, which was holding the list
of all completion functions, is consistently in sync with the dumpfile
that is generated afterwards.
2022-01-18 20:51:11 -05:00
Eric Nielsen 35e1d2ea48
Add check-dumpfile action
that removes the dumpfile if it's outdated, so it will get dumped again
when the shell starts next time. We're not using comdump because wrapped
ZLE widgets cannot or should not be identified by compdump when they
have a different name than the original one.
See https://github.com/zsh-users/zsh-syntax-highlighting/issues/851
2022-01-18 20:34:36 -05:00
Eric Nielsen bd765df785
Update README.md 2022-01-11 23:03:46 -05:00
Eric Nielsen afd35f6590
v1.7.0 2022-01-11 22:51:06 -05:00
Eric Nielsen 92bfa96993
Further clean up and simplify code
@startup_files_glob is not used anymore.
2022-01-11 11:29:47 -05:00
Eric Nielsen 2491856a7b
Clean up and simplify code
No need to set zscriptglob in _zimfw_build_login_init anymore.
Use _zimfw_print in _zimfw_compile.
And other minor simplifications.
2022-01-10 20:41:50 -05:00
Eric Nielsen cfc955c9fd
Deprecate compile in background via login_init.zsh
Changes are:
  * Don't compile in the background anymore, only via the `zimfw` tool
    after actions where scripts can change (build, install, update)
  * Move compilation of the completion dumpfile to the completion module:
    9386a76eac/init.zsh (L10-L11)
  * Don't compile users startup scripts anymore (.zshenv, .zshrc, etc.)
  * Make output of `zimfw init` friendlier for the terminal startup
    screen when called without `-q`.

See https://github.com/romkatv/zsh-bench/pull/11#issuecomment-994979683
and https://github.com/romkatv/zsh-bench#cutting-corners

Regarding not compiling users startup scripts anymore, I'm choosing to
only compile the modules' scripts at least for the reason that compile
won't happen so ofter anymore -- it will only happen when the user calls
the `zimfw` build, install or update actions. So it makes more sense to
only compile the files that `zimfw` has control over changes...

Closes #450
2022-01-10 09:29:32 -05:00
Eric Nielsen 90de91ab4f
v1.6.2 2021-11-21 14:41:25 -05:00
Eric Nielsen a5fb148ccf
Force local zsh emulation options
so the code is not broken by unexpected option changes, like

    setopt RC_EXPAND_PARAM

which breaks

    print -R 'fpath=('${${_zfpaths#${~zpre}}:A}' ${fpath})'

in the _zimfw_build_init function, for example.

See #444.
2021-11-21 14:39:20 -05:00
Eric Nielsen de685e8ef3
Minor text updates in warnings, errors, and usages 2021-11-15 19:37:40 -05:00
Eric Nielsen e060934a9e
.git can be either a directory or a file
Git submodules usually have .git as file, actually. Zim modules should
not be git submodules, but we don't want Zim to be too smart here either.
See https://git-scm.com/docs/gitrepository-layout#_description
2021-11-11 13:46:28 -05:00
Eric Nielsen cd71c8d228
Use git -C instead of changing to the module dir
when doing update using the git tool.
2021-11-10 22:50:17 -05:00
Eric Nielsen 6e7c6a269d
Update README.md formatting
to be closer to the one used in https://zimfw.sh/docs/commands/
2021-11-08 20:27:14 -05:00
Eric Nielsen ab613bf398
Narrow zmodule help text again
to avoid the horizontal scroll in the https://github.com/zimfw/zimfw
GitHub homepage, as GitHub made the width of the pre block further
narrower. (It's 94 characters now, was 97 before)
2021-11-08 20:05:32 -05:00
Eric Nielsen 503f2daf4c
v1.6.1 2021-11-08 12:03:49 -05:00
Eric Nielsen 811616cc60
Add missing `-l` in git tool print_okay
This fixes a regression introduced in commit b1edcf34d0.

Also don't use any option after `-R` just to be safe. The zshbuiltins(1)
manual states:

> Only the -e and -n flags are recognized after -R; all other arguments
> and options are printed.
2021-11-08 11:38:56 -05:00
Enno a292ca40ac
Update README.md
The new zshrc template will download the zimfw script if missing.
See 023e13f042/src/templates/zshrc (L100-L108)

Similar to https://github-wiki-see.page/m/junegunn/vim-plug/wiki/tips

Useful if the ZIM_HOME folder is not version tracked in a dotfiles repo.

Closes #440
2021-11-06 17:36:48 -05:00
Eric Nielsen d7229bb6bc
v1.6.0 2021-11-06 17:04:47 -05:00
Eric Nielsen 4259e64d22
Update init action to also install new modules
so users don't get a "Not installed" error when they add a new module to
.zimrc and forget to run `zimfw install` after that.

See #440
2021-10-26 11:15:40 -05:00
Eric Nielsen a86f69a2f1
Warn when module isn't installed with current tool
instead of showing it as an error. This change allow the message to be
omitted with `-q`.
2021-10-19 08:36:51 -05:00
Eric Nielsen de7d2b131f
More verbose output in install and update actions
listing modules that are frozen or exernal.

Also be less colorful. And some other minor fixes: allow autoloading a
function name that starts with `-`, and add required quotes around
command subsitution (otherwise words are split).
2021-09-29 21:22:28 -05:00
Eric Nielsen 1d5c0c18d1
Initalization options are all auto or all manual
in `zmodule`, since there's no way to unset a default value to "nothing".
2021-09-26 19:47:44 -05:00
Eric Nielsen b1edcf34d0
Use `print -l` to print multiple lines
and also remove extra quotes. Still only leave redundant quotes in

    zstyle -s 'context' style 'name'

as that's kind of a convention already.
2021-09-23 14:29:40 -05:00
Eric Nielsen 6ca4690edc
Further improve handling of external modules
Fix computing the list of unused modules by using the full `_zdirs`
instead of just the `_zmodules` names. The fixed code was even simpler
and cleaner, which makes it even more satisfying.  :- )

Show "not found" instead of "not installed" error when an external
module dir does not exist, since we don't install external modules.
2021-09-23 11:44:31 -05:00
Eric Nielsen 92e6d6b74b
Don't output warnings in quiet mode
For sake of simplicity, and also to distinguish warnings from errors.
So now we have:
  * errors: output to stderr, are **not** silenced with `-q`
  * warnings: output to stderr, are silenced with `-q`
  * info: output to stdout, are silenced with `-q`
  * solicited output (like help, info, or list): output to stdout, does
    not make sense to be silenced with `-q`

We also only have warning in 3 situations so far...  :- )
2021-09-21 16:47:04 -05:00
Eric Nielsen 9a67adfe3b
Update zimfw help text to be more detailed
and add more comments to the code to also hopefully make it clearer.
2021-09-21 08:27:56 -05:00
Eric Nielsen 7deda9c7f4
Show a more informative error when running zmodule
from the shell. This means getting

    zmodule: Must be called from ${ZDOTDIR:-${HOME}}/.zimrc

and the full zmodule usage, instead of getting

    zsh: command not found: zmodule

Fixes #430
2021-09-20 21:21:27 -05:00
Eric Nielsen b3b282f0f6
Move .github and CODE_OF_CONDUCT.md to .github repo
See
https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file
2021-09-20 16:12:55 -05:00
Eric Nielsen e097e6bf71
Add list action, don't run tool on external module
Using the `list` action with `-v` shows all current details for the
existing modules.
Don't try to install or update external modules, since they have an
absolute path instead of a valid URL.
2021-09-19 13:37:13 -05:00
Eric Nielsen 3e1a89ae4b
Update issue templates
The config.yml does not support markdown yet.  :- (
2021-09-02 08:49:14 -05:00
Eric Nielsen aaaa754115
Update issue templates 2021-09-02 08:48:12 -05:00