1
0
Fork 0
mirror of synced 2024-10-31 15:28:57 -04:00
Commit graph

14 commits

Author SHA1 Message Date
Eric Nielsen
ae133abca9 Compile functions.zwc for each functions directory
instead of a big single `functions.zwc` file containing functions from
all the `functions` subdirectories.

This solution here better suits the functions autoloading mechanism in
zsh, as documented in
http://zsh.sourceforge.net/Doc/Release/Functions.html#index-autoloading-functions

Given `~/.zim/modules/foo/functions` is in the `fpath`, autoload looks
for functions in the following files, picking the **newest one** in this
order:
* `~/.zim/modules/foo/functions.zwc`, which should contain all
  functions in the directory named `functions`
* `~/.zim/modules/foo/functions/function.zwc`
* `~/.zim/modules/foo/functions/function`

With this approach, we're also having individual entries back in `fpath`
for the `functions` subdirectory of each enabled module (as was the case
before commit 55df5a4).

This is also probably closest to the original plan at #86. The current
code was not compiling "*all* files in a folder into a single digest",
but instead compiling *all* files in *all* the functions folders into a
single digest, which was a bad idea. This commit fixes this.

Fixes #231. Fixes #232. Closes #234.

Closes #239
2018-01-08 11:56:18 -05:00
Eric Nielsen
3c96d0b8e1 Revert "Also zrecompile functions starting with _"
This reverts commit 07d32caaae.

Now I get the intention of not zcompiling or autoloading functions whose
names start with `_` or `.`: these are indented to be used by the com-
pletion system and dumped into the `.zcompdump ` file.

See
http://zsh.sourceforge.net/Doc/Release/Completion-System.html#index-compinit
2018-01-03 11:48:52 -05:00
Eric Nielsen
07d32caaae Also zrecompile functions starting with _
This was causing issues with https://github.com/jocelynmallon/zshmarks,
that has a `functions/_jump_showmarks_deletemarks` file.

Fixes #231
2018-01-02 12:27:05 -05:00
Eric Nielsen
e0a7c679e0 [meta] Move zmanage to function in init.zsh
and delete the meta module altogether.

Also refactor `tools/zim_issue` to use `tools/zim_info`, use local
variables, and print the output directly without the need of the
intermediate `issue_md` array.

Closes #218
2017-11-24 19:08:39 -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
Chet Gurevitch
9eaba9a3a3 [meta] Use ZIM_HOME in zmanage
And fix init.zhs to export ZIM_HOME. The zmanage script invokes a new
shell for the sub commands, and those would fail as there would be no
value for ZIM_HOME.

Closes #203
2017-09-04 17:29:34 -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
Eric Nielsen
537f076603 Don't load zim if zsh < 5.2
and show an error message, as discussed in #184.

Code in modules/environment/init.zsh is also simplified to only support
zsh >= 5.2

Closes #200
2017-08-03 09:18:39 -05:00
Eric Nielsen
ff32968ba9 Warning message for zsh < 5.2
as discussed in #184. We'll first give users this warning message. A
future update will replace this by an error.

Also, starting at that update, a new branch will be created for users
that still want to stick with zsh < 5.2.

Closes #194
2017-06-28 21:52:20 -05:00
Matt Hamilton
a0706e0f46 slight init refactor
Removing argv removes the need to pass the arrays arround. Better to
just reference them directly.
2015-12-30 10:14:10 -05:00
Matt Hamilton
e9a1018c25 unfunction loaders after use 2015-12-29 01:28:24 -05:00
Matt Hamilton
a1a56ac63f use consistent variable style 2015-12-19 09:48:29 -05:00
Matt Hamilton
2f9b8437e2 It is probably better to prepend ranther than append 2015-12-16 14:56:54 -05:00
Matt Hamilton
3a62391e0e initial commit 2015-12-15 00:12:17 -05:00