diff --git a/README.md b/README.md index 966dbac48..a28efb5f6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,60 @@ + + +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* + +- [Zinit](#zinita-namezinita) + - [Zinit Wiki](#zinit-wikia-namezinit-wikia) + - [Install](#installa-nameinstalla) + - [Automatic](#automatica-nameautomatica) + - [Manual](#manuala-namemanuala) + - [Usage](#usagea-nameusagea) + - [Introduction](#introductiona-nameintroductiona) + - [Plugins and snippets](#plugins-and-snippetsa-nameplugins-and-snippetsa) + - [Upgrade Zinit and plugins](#upgrade-zinit-and-pluginsa-nameupgrade-zinit-and-pluginsa) + - [Turbo and lucid](#turbo-and-lucida-nameturbo-and-lucida) + - [Migration](#migrationa-namemigrationa) + - [Frequently Asked Questions](#frequently-asked-questionsa-namefrequently-asked-questionsa) + - [Use `zi ice svn` if a plugin/snippet requires an entire subdirectory](#use-zi-ice-svn-if-a-pluginsnippet-requires-an-entire-subdirectorya-nameuse-zi-ice-svn-if-a-pluginsnippet-requires-an-entire-subdirectorya) + - [Use `zi ice as'completion'` to directly add single file completion snippets](#use-zi-ice-ascompletion-to-directly-add-single-file-completion-snippetsa-nameuse-zi-ice-ascompletion-to-directly-add-single-file-completion-snippetsa) + - [More Examples](#more-examplesa-namemore-examplesa) +- [How to Use](#how-to-usea-namehow-to-usea) + - [Ice Modifiers](#ice-modifiersa-nameice-modifiersa) + - [Cloning Options](#cloning-optionsa-namecloning-optionsa) + - [Selection of Files (To Source, …)](#selection-of-files-to-source-a-nameselection-of-files-to-source-a) + - [Conditional Loading](#conditional-loadinga-nameconditional-loadinga) + - [Plugin Output](#plugin-outputa-nameplugin-outputa) + - [Completions](#completionsa-namecompletionsa) + - [Command Execution After Cloning, Updating or Loading](#command-execution-after-cloning-updating-or-loadinga-namecommand-execution-after-cloning-updating-or-loadinga) + - [Sticky-Emulation Of Other Shells](#sticky-emulation-of-other-shellsa-namesticky-emulation-of-other-shellsa) + - [Others](#othersa-nameothersa) + - [Order of Execution](#order-of-executiona-nameorder-of-executiona) + - [Zinit Commands](#zinit-commandsa-namezinit-commandsa) + - [Help](#helpa-namehelpa) + - [Loading and Unloading](#loading-and-unloadinga-nameloading-and-unloadinga) + - [Completions](#completionsa-namecompletions-1a) + - [Tracking of the Active Session](#tracking-of-the-active-sessiona-nametracking-of-the-active-sessiona) + - [Reports and Statistics](#reports-and-statisticsa-namereports-and-statisticsa) + - [Compiling](#compilinga-namecompilinga) + - [Other](#othera-nameothera) + - [An embedded TAGS browser](#an-embedded-tags-browser) + - [Updating Zinit and Plugins](#updating-zinit-and-pluginsa-nameupdating-zinit-and-pluginsa) + - [Completions](#completionsa-namecompletions-2a) + - [Calling `compinit` Without Turbo Mode](#calling-compinit-without-turbo-modea-namecalling-compinit-without-turbo-modea) + - [Calling `compinit` With Turbo Mode](#calling-compinit-with-turbo-modea-namecalling-compinit-with-turbo-modea) + - [Ignoring Compdefs](#ignoring-compdefsa-nameignoring-compdefsa) + - [Disabling System-Wide `compinit` Call (Ubuntu)](#disabling-system-wide-compinit-call-ubuntua-namedisabling-system-wide-compinit-call-ubuntua) + - [Zinit Module](#zinit-modulea-namezinit-modulea) + - [Hints and Tips](#hints-and-tipsa-namehints-and-tipsa) + - [Customizing Paths](#customizing-pathsa-namecustomizing-pathsa) + - [Non-GitHub (Local) Plugins](#non-github-local-pluginsa-namenon-github-local-pluginsa) + - [Extending Git](#extending-gita-nameextending-gita) + - [Use named directories for plugin dirs](#use-named-directories-for-plugin-dirs) + - [Changelog](#changeloga-namechangeloga) + - [Support](#supporta-namesupporta) + - [Getting Help and Community](#getting-help-and-communitya-namegetting-help-and-communitya) + + +
@@ -783,6 +840,7 @@ You may safely assume a given ice works with both plugins and snippets unless ex
| `trackbinds` | Shadow but only `bindkey` calls even with `zinit light ...`, i.e. even with investigating disabled (fast loading), to allow `bindmap` to remap the key-binds. The same effect has `zinit light -b ...`, i.e. additional `-b` option to the `light`-subcommand. **Does not work with snippets.** |
| `wrap-track` | Takes a `;`-separated list of function names that are to be investigated (meaning gathering report and unload data) **once** during execution. It works by wrapping the functions with a investigating-enabling and disabling snippet of code. In summary, `wrap-track` allows to extend the investigating beyond the moment of loading of a plugin. Example use is to `wrap-track` a precmd function of a prompt (like `_p9k_precmd()` of powerlevel10k) or other plugin that _postpones its initialization till the first prompt_ (like e.g.: zsh-autosuggestions). **Does not work with snippets.** |
| `reset-prompt` | Reset the prompt after loading the plugin/snippet (by issuing `zle .reset-prompt`). Note: normally it's sufficient to precede the value of `wait''` ice with `!`. |
+| `param` | Creates parameters (variables) for the time of loading a plugin only. The variables are separated from their values via `->` or `→`, e.g.:`param'CMD_COMMAND_PATH → ~/cmds; CMD_DIR → $HOME'`. Multiple vars can be created either via separating them by `;` or via multiple `param''` ices. |
### Order of Execution
@@ -878,6 +936,13 @@ Following commands are passed to `zinit ...` to obtain described effects.
| `update [-q] [-r] {plg-spec}\|URL\|--all` | Git update plugin or snippet.
`--all` – update all plugins and snippets.
`-q` – quiet.
`-r` \| `--reset` – run `git reset --hard` / `svn revert` before pulling changes. |
| `add-fpath\|fpath` `[-f\|--front]` `{plg-spec}` `[subdirectory]` | Adds given plugin (not yet snippet) directory to `$fpath`. If the second argument is given, it is appended to the directory path. If the option `-f`/`--front` is given, the directory path is prepended instead of appended to `$fpath`. The `{plg-spec}` can be absolute path, i.e.: it's possible to also add regular directories. |
+## An embedded TAGS browser
+
+Zinit comes via an embedded Ctags browser. Just create a `TAGS` file
+via e.g.: `ctags -e -R .` and then press `Alt-Shift-q` to open the
+browser. You can test the feature by generating TAGS for Zinit, via:
+`cd $ZINIT[BIN_DIR]; make tags-emacs` and then opening the browser.
+
## Updating Zinit and Plugins
To update Zinit issue `zinit self-update` in the command line.
diff --git a/zi-browse-symbol b/zi-browse-symbol
index b33ab32b0..2a1da41f5 100644
--- a/zi-browse-symbol
+++ b/zi-browse-symbol
@@ -102,6 +102,8 @@ _tfind_error_msg()
if [[ -z $TAG[repo-dir] || $TAG[repo-dir] == . ]]; then
POSTDISPLAY=$'\n'"Symbol index NOT found, NO DATA to show, sleeping…"
local search_buffer=
+ elif [[ $#__tfind_spe_found -eq 0 ]]; then
+ POSTDISPLAY=$'\n'"Didn't found any symbol."
elif [[ $#__tfind_tag_data -eq 0 ]]; then
POSTDISPLAY=$'\n'"The index file contains NO symbol data, forced sleeping..."
local search_buffer=
@@ -170,16 +172,15 @@ _tfind_main() {
done
fi
- if [[ $#__tfind_spe_found -eq 0 ]]; then
- _tfind_error_msg && return
+ if (( $#__tfind_spe_found == 0 )); then
+ _tfind_error_msg; return
fi
-
#
# Pagination, index value guards
#
integer page_size=$__tfind_page_size
- integer max_index="$#__tfind_spe_found"
+ integer max_index=$#__tfind_spe_found
[[ $page_size -gt $max_index ]] && page_size=$max_index
[[ $__tfind_spe_index -le 0 ]] && __tfind_spe_index=$max_index
[[ $__tfind_spe_index -gt $max_index ]] && __tfind_spe_index=1