prezto | The configuration framework for Zsh | Command Line Interface library
kandi X-RAY | prezto Summary
kandi X-RAY | prezto Summary
Prezto is the configuration framework for Zsh; it enriches the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of prezto
prezto Key Features
prezto Examples and Code Snippets
Community Discussions
Trending Discussions on prezto
QUESTION
In Oh My Zsh, by default, the history feature matches prefixes.
Typing ls
and hitting Up Arrow will scroll through commands that start with what you typed: matching ls
and ls -l
but not echo ls
.
In Prezto, by default, the history feature matches anywhere in the string.
Typing ls
and hitting Up Arrow will scroll through commands that contain what you typed: matching ls
and ls -l
and also echo ls
.
Is there a way to set Prezto to match prefixes only, like the Oh My Zsh default behaviour?
(According to the history-substring-search
documentation, setting HISTORY_SUBSTRING_SEARCH_PREFIXED=1
will do this, but I have this set in .zshrc
and it still matches anywhere in the string.)
ANSWER
Answered 2022-Mar-21 at 14:21I have now found that instead of using whatever plugin comes with Prezto, it is possible to use built-in zsh features instead.
Add the following to the end of ~/.zshrc
:
QUESTION
I am a Mac user on osx 10.15.7 (Catalina). I recently updated brew and upgraded formulas with it. Since then, my terminal has become erratic and prints out these errors:
...ANSWER
Answered 2022-Jan-31 at 22:17prezto: old shell detected, minimum required: 4.3.17
Check your zsh version
QUESTION
I have written a script for use internally in my job (it's not much use to anyone outside of my work). I've got a decent zsh completion script for it now which works great.
I'd like to make a --install-zsh-completions
option on the script, which sets up completions automatically.
I see that there are a variety of different ways that zsh can be set up, depending on whether you use oh-my-zsh, prezto or your own configuration. For example, in oh-my-zsh
, you can just put completion scripts in ~/.oh-my-zsh/completions
and they are loaded.
Is there a standard place or way in zsh to install zsh custom completion scripts? For example, should I just modify the .zshrc and add to the fpath
?
ANSWER
Answered 2021-May-29 at 07:25Is there a standard place or way in zsh to install zsh custom completion scripts?
Yes, there is: Just create a symlink in /usr/local/share/zsh/site-functions
that points to your completion function. That's all there is to it.
This dir is by default in every user's $fpath
. So, when they (or whatever framework they're using) calls compinit
, it will be picked up automatically.
QUESTION
I'm having a strange issue, and I really can't tell whether it's caused by something related to my Git install or my shell, or something else entirely. If I'm in a Git repository with plenty of branches and commits, and I try to list branches:
...ANSWER
Answered 2020-Nov-13 at 18:27When running in a regular terminal, unless you capture or redirect git's output with $(git ...)
or git ... | otherprogram
, isatty(1)
is true, so git automatically invokes a pager to let users read content too long to fit on one screen.
See if the problem goes away without a pager.
- Does
git --no-pager branch
still have issues?
- Does
Check which pager is in use.
declare -p GIT_PAGER
will show a pager configured only forgit
via the environment.git config core.pager
will show a pager configured only forgit
via its config files.declare -p PAGER
will show a pager configured to be used by your OS in general.
Check how that pager is configured, and try clearing or simplifying that configuration.
- If your pager is
LESS
,declare -p LESS
will show options configured for it via the environment, andunset LESS
will temporarily clear those options. - If your pager is
MORE
,declare -p MORE
will show options configured for it via the environment, andunset MORE
will temporarily clear those options. - For another pager, consider reading its manual.
- If your pager is
The OP had LESS='-F -g -i -M -R -S -z-4'
export
ed in their environment. The -F
argument to less
instructs it to exit if there's less than one page of content to be displayed.
On the OP's (MacOS) system, the stock version of less
, when called with -F
, exited before emitting the original content to stdout; this could be repaired either by removing that flag, or by installing a newer version of less
.
QUESTION
I recently switched from bash to zsh and am using Prezto for basic setup. For a long time I've used this function:
...ANSWER
Answered 2020-Jul-30 at 17:42Add this to your ~/.zshrc
QUESTION
I came across this snippet of code in the prezto repo, and im really stumped.
It appears to rebuild zsh comp every 20 hours, but I can't figure out how.
(Nm-20)
seems to be calling into a subshell, but Nm-20
itself is not a program.
($BLAH/zcompdump)
should be a file, but it shouldn't be executable, so why is it surrounded by ()
?
Lastly, if (( $#_comp_files ))
seems to be that the outer()
is a test to see if ( $#_comp_files )
is true or not, but what is $#_comp_files
?
ANSWER
Answered 2020-May-20 at 10:31The magic is the use of Glob Qualifiers.
At the end of a filename, you can add parenthesis with filters.
.zcompdump(Nm-20))
will select this file only if modified less than 20 days ago.
The N says to not display an error (NULL_GLOB).
It's missing a h
to have Nmh-20
to get it if modified less than 20 h ago.
man zshexpn
then search for Glob Qualifiers.
Try it yourself with
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install prezto
Launch Zsh: zsh
Clone the repository: git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" Optional: Installing in $XDG_CONFIG_HOME Optionally, if you already have $XDG_CONFIG_HOME configured (usually as $HOME/.config by default) and intend to install Prezto under $XDG_CONFIG_HOME/zsh instead, you can clone the repository there and configure $ZDOTDIR separately if not already configured. Clone the repository: git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-${XDG_CONFIG_HOME:-$HOME/.config}/zsh}/.zprezto" Configure $XDG_CONFIG_HOME and $ZDOTDIR in ${$HOME}/.zshenv: export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}" export ZDOTDIR="${ZDOTDIR:=$XDG_CONFIG_HOME/zsh}" source "$ZDOTDIR/.zshenv"
Create a new Zsh configuration by copying/linking the Zsh configuration files provided: setopt EXTENDED_GLOB for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" done Note: If you already have any of the given configuration files, ln in the above operation will cause an error. In simple cases, you can load Prezto by adding the line source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" to the bottom of your ${ZDOTDIR:-$HOME}/.zshrc and keep the rest of your Zsh configuration intact. For more complicated setups, we recommend that you back up your original configs and replace them with the provided Prezto runcoms.
Set Zsh as your default shell: chsh -s /bin/zsh
Open a new Zsh terminal window or tab.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page