instead of a big single `functions.zwc` file containing functions from
all the `functions` subdirectories.
Having a big single digest file did reduce the number of OS file
descriptors to 1, instead of:
* as many functions as are declared in enabled modules, what we had
before commit 55df5a4
* as many enabled modules, as we have implemented in this commit
but it also raised bigger and still unsolved issues as #231, #232, and
#234.
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`
A relevant change in this approach is also having individual entries
back in `fpath` for the `functions` subdirectory of each enabled module
(as was the case before commit 55df5a4). With this back, we don't need
to worry anymore about being absolutely sure that all functions are
zcompiled, thanks to the autoloading mechanism described above.
Fixes#231. Fixes#232. Closes#234.
Since some terminal colour schemes have a too dark blue color that does
not go well with a black background. And since some people actually use
such colour schemes! :- )
Fixes#225
Since some terminal colour schemes have a too dark blue color that does
not go well with a black background. And since some people actually use
such colour schemes! :- )
Fixes#228
They were only being applied to BSD. Also, GNU uses `LS_COLORS`, and BSD
only uses `LSCOLORS`. Keeping these consistent, with same color scheme,
in both GNU and BSD.
Simplify arithmetic command expression without using `${var}`
substitution, but `var` instead. The second construct does not fail if
`var` is not defined, but defaults its value to `0` in that case.
This reverts commit 6022fe46c5.
Current code only works in a GNU with coreutils installed for `ls`, and
only with a `grep` that supports colors (not a Busybox one, for example)
Fixes#230
and refactor code, inlining auxiliary functions inside
`prompt_eriner_main`.
Theme colors are now customizable with parameters. Also, it works better
with light backgrounds by using `%Sstandout%s` for the segments which
were originally using black as foreground color (intended for dark
backgrounds).
The help explains the parameters, and the preview shows one color
variation.
Fixes#169. Closes#226.
The following was introduced in zsh 5.0:
> %F, %K, %f, %k allow colouring of prompts both using ANSI colour names
and values supported by individual terminal emulators.
making this submodule obsolete.
See http://zsh.sourceforge.net/releases.htmlCloses#224
Now that we have a general digest file that can contain all the
functions from all active modules, we can add functions to any of them
without the need to update the `fpath`.
and GNU uses LS_COLORS and GREP_COLORS. So change logic to only set
these environment variables for each OSTYPE.
Also original code was setting the `ls` alias with `-G` instead of
`--color=auto` if in a GNU without `dircolors`. Fix that too.
Simplify arithmetic command expression without using `${var}`, but
`var` instead. The second construct does not fail if `var` is not
defined, but defaults its value to `0` in that case.
Closes#225
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
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
Consider the `zcompdump_file` variable, that could be defined in
`.zimrc`, when cleaning the cache.
A custom zcompdump_file would not be cleaned from the cache without this
correction.
Also remove *.zwc.old files from cache, as zrecompile also generates
these.
Closes#218
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.
in our custom themes.
With zsh starting at version 5.4, when using the `prompt_opts` array,
`nopromptsp` will be set unless the array contains a `sp`. This was
introduced in zsh at
43e55a9bcd (diff-bb10d67e7a8561b66a53a805f3c77a40R233)Fixes#209
While normally it's a good thing that zsh doesn't auto-expand on spaces,
in this case we want to split on spaces into distinct words, that way
the values are passed to `prompt` in multiple params.
Fixes#178
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
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
instead of `remote update`. Both behave the same way, fetching from all
configured remotes. The `fetch --all` is shorter, and probably more
familiar. See https://stackoverflow.com/a/17512004/2654518
Also change `;` to `&&`, so merge is only called after fetch succeeded.
Closes#196
truncating at character 60. First 10 chars are used for `*`, commit
hash and spaces.
The 50 char limit is based on
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Also changed aliases to use the `--long-option` format when available,
so aliases are clearer for those unfamiliar with the options.
Closes#196