prezto | My personal zsh settings | Command Line Interface library
kandi X-RAY | prezto Summary
kandi X-RAY | prezto Summary
Prezto is the configuration framework for [Zsh][1]; 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
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
QUESTION
I've cloned the skwp/dotfiles to use as my own dotfiles. Time to time I have been making commits to my dotfiles for the improvement purposes. Mostly these commits were made to main part of repository.
Now I need to make commit to ~/.zshrc
file. This file belongs to prezto repository which is submodule of skwp/dotfiles repository.
The question is how I can make this nested repository as part of my dotfiles? Should I change the remote url to point to my repository? Or is there a way to integrate the prezto to one big repository, and then I can make commits to repository seamlessly no matter which part of repository to push commits to.
...ANSWER
Answered 2017-Dec-23 at 15:35You can keep prezto
as a submodule, but change its URL to point to a fork of that repo that you own.
Meaning, you need to fork https://github.com/sorin-ionescu/prezto.git, and then change the URL seen in the skwp/dotfiles/.gitmodules
file: see "Changing remote repository for a git submodule".
From there, you can make any new commit you want in that submodule, add, commit and push (to your fork), then go back to the main parent repo, add, commit and push (also to your fork).
The other approach, still assuming you have forked the main dotfile repo, would be to un-submodule the prezto
submdule: see "un-submodule a git submodule".
QUESTION
I'm using zsh/prezto with syntax-highlighting
plugin. When I use the arrow keys to navigate within the terminal command, the cursor disappears in the embedded terminal and blinks/flashes every ~second.
Here is an example (gif):
It does not happen within Terminal.app or iterm. If I disable syntax-highlighting
within .zpreztorc
it works like expected. =(
ANSWER
Answered 2017-Nov-09 at 06:57I disabled the cursor highlighter and now it works!
.zpreztorc
QUESTION
I found this in prezto
source code:
ANSWER
Answered 2017-Jul-24 at 20:30It looks pretty messy at first glance, but once you break it into its parts it's quite simple. This is an example of parameter expansion and extended globbing support in ZSH. If you look higher up in the function from which this code sample is, you'll see they set:
QUESTION
I am trying to truncate a file in Red Hat 4.8.5-11. I have zsh+prezto installed on my system. I am getting error: "zsh: file exists: {file_name}"
I am running following command:
...ANSWER
Answered 2017-Feb-20 at 16:37This is caused by the no-clobbering setting which protects you from accidently overwriting a file: http://zsh.sourceforge.net/Doc/Release/Options.html#index-file-clobbering_002c-allowing
You can either force it using the pipe character:
QUESTION
I am on mac, and have set up zsh with prezto on terminal. I have a python project for which I use virtualenv wrapper. Everything is working fine, but when I install a new package using pip and wants to freeze it in already existing requirements.txt file, zsh says:
...ANSWER
Answered 2017-Jan-09 at 13:25It is likely because of your CLOBBER
option in zsh
shell
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install prezto
Install figlet and fasd: brew install figlet fasd
Launch Zsh: zsh
Clone the repository: git clone --recursive https://github.com/phillipalexander/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
Create a new Zsh configuration by copying 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
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