Changes:
- nodenv and nvm now honors (and prioritizes) `$XDG_CONFIG_HOME` over
`$HOME` to lookup local nodenv/nvm installation.
- Make `nvm` loading lazy (via `--no-use` argument).
- Remove redundant NODENV_ROOT or NVM_DIR, respective script already
set them up.
- Adhere to more idiomatic Zsh operation and minimize external command
usage (like `sed`).
Set `LS_COLORS` if not already available so that it is available as
standard style `list-colors`.
This needs to be explicitly set in completion module to ensure that the
variable is available even if 'utility' module is not loaded earlier.
`get` alias now supports `aria2c` via optional `zstyle`.
To configure `aria2c` to be used for `get`, use:
zstyle -s ':prezto:module:utility:download' helper 'aria2c'
Note that we still fall back to `curl` when the desired download helper
isn't available.
Skip additional call to `grep` and use Zsh native mechanism to detect
GNU version of `du`.
Further, Remove redundant `function` clause as per Prezto convention.
Use `git` fallback (if present) even when color is off and `wdiff` is
not present.
Further, remove redundant `function` clause as per Prezto convention.
Zsh and Prezto files don't always reside in `~/`. Instead, they have
a more spec compliant location (`${ZDOTDIR:-$HOME}/`). Make them
unambiguous in the documentation. Likewise, for `$GNUPGHOME`.
Further, add instruction for optionally setting up Prezto in
`$XDG_CONFIG_HOME`.
While at this, also add clarification on relative ordering of some of
the modules, apply more formatting tweaks and doc improvements.
Detect `ls` provided by GNU Core Utilities upfront before applying
the relevant settings and aliases.
The revised logic takes the following aspects into consideration:
- `is-callable 'dircolors'` is not a sufficient test for verifying if
the `ls` in scope is _also_ provided by GNU Core Utilities. `ls` can
continue to be the one provided by BSD Core Utilities because of its
precedence in `$path`.
- The `ls` in scope anyway can be either GNU Utils provided or BSD Utils
provided depending on either `$path` precedence, soft link (via
`ln -s`), or wrapper function (via 'gnu-utility' module).
- So instead of '_guessing_' the possible one, just detect if it is from
GNU Utils and apply the relevant settings and aliases.
- Note that GNU prefixed `ls` (`gls`) is intentionally not honored in
this case to avoid possible conflict/shadowing with other `gls`
callable (can happen if 'git' module is used, for example).
Besides, honoring `gls` would imply we honor other commands (like
`mv`, `rm` etc.) to be consistent. We have a module 'gnu-utils'
dedicated for that after all.
We need to accommodate cases where a submodule local path (or remote)
URL can change. Accordingly, update instruction and `zprezto-update`
function to synchronizes submodules' remote URL configuration setting
to the updated value automatically.
WARNING: This will require synchronizing submodules' remote URL
configuration setting to the value specified in `.gitmodules` by doing:
`git submodule sync --recursive` in your Prezto location.
Signed-off-by: Indrajit Raychaudhuri <irc@indrajit.com>
General purpose reformating and rewording in (a few places). This should
also make markdown linting happier.
Prefer back-ticks wherever useful and use `console` for code blocks to
be executed on terminal.
Also, update references links wherever possible (including update from
'http://' to 'https://').
Remove `--protect-decmpfs` by default since hfs-compression specific
changes have been marked by upstream as broken since 3.1.3 and there is
little likelihood of that changing.
As curl bundled with macOS does not include `_curl` definitions, one
way to make `_curl` available is to install curl from Homebrew.
However, since curl from Hombrew is _keg-only_, its function path needs
to be explicitly included.
Change default `HISTFILE` path from `~/.zhistory` to more conventional
`~/.zsh_history`. This aligns better with Debian variants, macOS and
Oh My Zsh.
This would provide an easier onboarding experience to users coming to
Prezto from standard (framework free) zsh or from Oh My Zsh.
For existing Prezto users, we attempt to automatically rename old
`HISTFILE` to new one iff the old one exists and the new one doesn't.
However, if both old and new `HISTFILE` exist and the old one is more
recent, we just alert the user about what changed with a suggested way
to accommodate the change.
Add guard to check for presence of 'run-help' in `aliases` hash before evicting.
In some systems (like Debian) '/etc/zshrc' might have already done it.
I think this should have been removed as part of 0a07ba27a2.
Currently I'm seeing this warning after updating to `master`:
```
Couldn't read file /Users/jeffwidman/.zprezto/modules/prompt/functions/prompt_powerlevel9k_setup containing theme powerlevel9k.
```
`compinit -i` doesn't always change zcompdump, which means that the
`compinit -C` condition fails to run until the completions change.
When we `compinit -i`, we should touch the file too to solve this.
Now that 'command-not-found' helper loading has been significantly
simplified and the startup time improved in the official Homebrew tap,
the workaround for script detection (and caching) can be removed.
Allow loading more specific 'run-help' function from $fpath. This
allows automatically looking up specific sub-command helper if
available instead of the static default ('man').
See: ccc9cff9e2/Functions/Misc/run-help (L3-L8)
> The {query} has to be percent-escaped in macOS 11.
Just replace `:` to `%3A` work fine.
But add function like this one I find on stackoverflow to encode the entire query string would be more robust.
```bash
urldecode() {
# urldecode <string>
local url_encoded="${1//+/ }"
printf '%b' "${url_encoded//%/\\x}"
}
```