Commit Graph

22 Commits

Author SHA1 Message Date
Eric Nielsen 8dc3e43a0d
Add a plugin mechanism \o/
This is a major change, where Zsh modules/plugins are not git submodules
in the Zim repo anymore, but customized and installed separately as
individual repositories. The discussion about this started more than 2
years ago in #88. Closes #299.

This will allow contributors' modules to live in their own repositories.
See #33, #138, #262, #281, #324.

The current code has what, up to this point, I considered to be the best
balance between simplicity, execution speed and number of files.

One measured decision was to make the initialization of modules depend
only on the `':zim' modules` style, keeping it as fast as possible.
The `':zim:module' module` style is used to install, update and clean
the modules, all operations that happen after the user got his
as-blazing-fast-possible shell prompt.

Even though I didn't care much about making install or update fast,
`xargs` has a nice feature of allowing commands to be executed in
parallel with `-P`. I took advantage of that.

I've also worked on making the `zimfw` utility give the user some nice
(while still minimalistic) output. Also I'm suggesting this as the new
name for the `zmanage` tool, since `zimfw` does not shadow the `zim`
wiki tool.
2020-01-02 12:58:00 -05:00
Eric Nielsen a05890e8b4
Use cat to concatenate files in installation
Update installation instructions in README.md to use cat. Also add blank
lines at the end (instead of beginning) of template files, since they're
prepended (not appended) to existing files.

See difference of output between print and cat (zlogin having a blank
like at the end):

    % print -rn "$(<zlogin)$(<test)"
    #
    # User configuration sourced by login shells
    #

    # Initialize zim
    [[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh# Hello world
    % cat zlogin test
    #
    # User configuration sourced by login shells
    #

    # Initialize zim
    [[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh

    # Hello world

Fixes #94. Fixes #280. Closes #300
2018-11-21 11:58:30 -05:00
Eric Nielsen a8244a555a [template] Add new templates/zlogin
that sources `login_init.zsh`.

Also refactor templates/zshrc to use a one-liner instead of if/then/fi.

Closes #218
2017-11-24 19:08:29 -05:00
Eric Nielsen fc84b645e9 [template] Move templates/zlogin to login_init.zsh
so it's not a template anymore and can be under version control, instead
of being manually updated by the user, as currently is the case with
`~/.zlogin` and `${ZIM_HOME}/templates/zlogin`.

Closes #218
2017-11-24 19:08:25 -05:00
Eric Nielsen 55df5a4755 [template] Use zrecompile and create digest file
for the autoloaded functions. According to the `zshbuiltins`
documentation:

    Files containing multiple compiled functions are called `digest'
    files,  and are intended to be used as elements of the FPATH/fpath
    special array.

Compile all module init files, instead of some selected ones.
This didn't impact performance much (time to run async block in zlogin
when from 0.22s to 0.25s on my machine).

Also refactor the zim `init.zsh` script, and do not unset `zmodules`
anymore because we need it in zlogin.

Didn't manage to make adding the prompt `prompt_*_setup` functions to
the digest file work, so kept these separate.

Fixes #86. Closes #218.
2017-11-24 19:08:11 -05:00
Eric Nielsen a4f6b757be [template] Add zcompile of git-info to zlogin
and declare `zim_mods` as a local variable.
Also minor formatting changes.

Closes #215
2017-09-26 15:23:30 +02:00
Eric Nielsen 2a9a003271 [template] don't compile highlighters test-data
for syntax-highlighting submodule. See discussion on
https://github.com/zsh-users/zsh-syntax-highlighting/pull/443

Fixes #205
2017-09-11 14:27:12 -05:00
Thiago Kenji Okada f6bb75579f Allow arbitrary ZIM location with ZIM_HOME
This change allow arbitrary Zim location path by setting a new
environment variable, ZIM_HOME. If the user does not set it, Zim falls
back to the old "${ZDOTDIR:-${HOME}}/.zim" location.

Closes #203
2017-09-04 17:25:01 -05:00
Matt Hamilton 40cbc82ac3 [install] ignore escapes in user configs
closes issue #45
2016-05-15 09:01:03 -07:00
Matt Hamilton 4ac66646c4 [completion] add ${zcompdump_file} option
This commit assumes that the user-provided variable for the filename
will start with '.zcomp'. This is used in the .zlogin for zcompiling the
completion file. Sourcing the .zimrc file within the .zlogin file is
something I'd rather not do, and this seems like a good compromise. If
this becomes an issue, the file can be sourced an the var can be used
instead.

Closes #42
2016-04-16 14:56:53 -07:00
Matt Hamilton 03f15c4495 [fasd] add initial fasd support
[zlogin] zcompare fasd and all functions

[fasd] trim non-zsh options

[fasd] merge PR #75 from clvv/fasd

[fasd] partial merge PR #77 from clvv/fasd

This closes #24
2016-03-27 18:45:05 -04:00
Matt Hamilton 0fdfdef502 [zlogin] zcompare functions in custom/functions/* 2016-02-08 22:16:19 -05:00
Matt Hamilton bf10ce72c5 cleanup zlogin 2016-01-04 19:15:43 -05:00
Matt Hamilton ef8e4bd3be remove zcompare's return
No need to make returns for tests that we aren't making success/failure
checks for; the function itself deals with what needs to be zcompiled.
2015-12-31 11:09:08 -05:00
Matt Hamilton fb7defa729 cleanup of zlogin
Change the scope of the job: {} to (); removes need for unfunction

Because we changed the job scope, we no longer need the anonymous
function/local var.
2015-12-28 03:11:39 -05:00
ishitatsuyuki 3ddc1703af Fix zlogin typos 2015-12-27 18:14:35 +09:00
Matt Hamilton 7d8601089a zcompile custom init.zsh; this may become large 2015-12-22 06:26:54 -05:00
Matt Hamilton b0bf9d2ebc load-time optimizations 2015-12-20 20:42:48 -05:00
Matt Hamilton a1a56ac63f use consistent variable style 2015-12-19 09:48:29 -05:00
Matt Hamilton 3633ffa7d1 fix history-sustring-search typo 2015-12-17 12:28:27 -05:00
Matt Hamilton f448c6663e zcompile .zshrc 2015-12-16 02:23:18 -05:00
Matt Hamilton 3a62391e0e initial commit 2015-12-15 00:12:17 -05:00