diff --git a/README.md b/README.md index d0fcac4..a4e4205 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ This prompt has been tested on numerous Linux and BSD distributions, as well as
Here are the latest features and updates. +- v3.10.0 + + The prompt is now fully compatible with ZSH's `promptinit` function. - v3.9.0 - The characters used to signify path abbreviation with `AGKOZAK_PROMPT_DIRTRIM` (`...` by default) can now be overridden with `AGKOZAK_PROMPT_DIRTRIM_STRING`. - v3.8.1 (November 23, 2020) @@ -125,6 +127,15 @@ And add the following to your `.zshrc` file: source /path/to/agkozak-zsh-prompt.plugin.zsh +### For [`promptinit`](https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#Prompt-Themes) users + +ZSH comes with a built-in way of handling prompts, the `promptinit` function. You can load the agkozak ZSH prompt by running + + fpath+=( /path/to/agkozak-zsh-prompt ) # The directory where the prompt's + # files are kept + autoload promptinit; promptinit + prompt agkozak-zsh-prompt + ### For [antigen](https://github.com/zsh-users/antigen) users Add the line @@ -163,6 +174,14 @@ The prompt now supports `zinit`'s `unload` feature; you may restore the shell to zinit unload agkozak/agkozak-zsh-prompt +### For [Znap](https://github.com/marlonrichert/zsh-snap) users + +Simply put + + znap prompt agkozak/agkozak-zsh-prompt + +in your `.zshrc` somewhere after you source `znap.zsh`. + ### For [zplug](https://github.com/zplug/zplug) users Add the line diff --git a/agkozak-zsh-prompt.plugin.zsh b/agkozak-zsh-prompt.plugin.zsh index 65d1f90..5e9ba6c 100644 --- a/agkozak-zsh-prompt.plugin.zsh +++ b/agkozak-zsh-prompt.plugin.zsh @@ -980,14 +980,11 @@ _agkozak_prompt_strings() { # AGKOZAK_PROMPT_DIRTRIM ############################################################ prompt_agkozak-zsh-prompt_setup() { - # promptinit compatibility - # TODO: rewrite function carefully now that emulate -L zsh has been removed + # `emulate -L zsh' has been removed for promptinit + # compatibility prompt_opts=( percent subst ) setopt NO_PROMPT_{BANG,CR,PERCENT,SUBST} "PROMPT_${^prompt_opts[@]}" - # emulate -L zsh - # (( AGKOZAK_PROMPT_DEBUG )) && setopt LOCAL_OPTIONS WARN_CREATE_GLOBAL - _agkozak_async_init case ${AGKOZAK[ASYNC_METHOD]} in @@ -1049,8 +1046,7 @@ prompt_agkozak-zsh-prompt_setup ############################################################ prompt_agkozak-zsh-prompt_preview() { - # TODO: Write a real preview function if possible - print "No preview available. Try \`prompt agkozak-zsh-prompt\'." + print "No preview available. Try \`prompt agkozak-zsh-prompt'." } ############################################################