53
votes
Accepted
zsh compinit: insecure directories, run compaudit for list
You can list those insecure folders by:
compaudit
The root cause of "insecure" is these folders are group writable.
There's a one line solution to fix that:
compaudit | xargs chmod g-w
Please see ...
40
votes
Accepted
oh-my-zsh's prompt is slow: how to fix this
I don't know what oh-my-zsh puts in the prompt by default. Maybe it tries to identify the version control status, that's a very popular prompt component which might be time-consuming.
To see what's ...
31
votes
Why do I lose my ZSH history?
ZSH
History file can be truncated/lost/cleaned for multiple reasons those can be:
Corruption of the zsh history file (because of a power-cut/system-fail while a shell is opened, in this case fsck ...
29
votes
26
votes
Accepted
`time echo` got no output
In zsh, the time keyword has no effect on builtins (or other similar shell-internal constructs). From this mailing list post:
Additional note: The time builtin applied to any construct that is
...
25
votes
After installing oh-my-zsh: ... /.zshrc:source:34: no such file or directory ... /.oh-my-zsh/oh-my-zsh.sh
Installing zsh doesn't install Oh My Zsh, which might explain if you don't have an oh-my-zsh.sh file at all (this was the case for me).
You can install Oh My Zsh by running
sh -c "$(curl -fsSL ...
22
votes
Accepted
Changing cursor style based on mode in both zsh and vim
I think it's better to use precmd() instead of preexec():
# .zshrc
_fix_cursor() {
echo -ne '\e[5 q'
}
precmd_functions+=(_fix_cursor)
This way:
you don't have to change .vimrc
cursor is fixed ...
20
votes
oh-my-zsh's prompt is slow: how to fix this
Checking if git dir is dirty seems to be causing the delay.
To speed up shell response, disable checking if dir is dirty by running in your terminal :
git config --add oh-my-zsh.hide-dirty 1
Remember ...
19
votes
First characters of the command repeated in the display when completing
I had the same problem and found my solution here: https://github.com/robbyrussell/oh-my-zsh/issues/5157#issuecomment-226031519. Simply put the following into your ~/.zshrc.
export LC_CTYPE=en_US.UTF-...
18
votes
How do you "disable" oh-my-zsh (and zsh) without uninstalling it?
chsh -s /bin/bash
To manually set a new default shell, do chsh -s /my/
new/shell, eg chsh -s /bin/bash. Then simply reopen your shells.
17
votes
oh-my-zsh's prompt is slow: how to fix this
I had the same issue with it, and it was also the git_prompt_info which causes the shell to slow down.
Be aware, that some oh-my-zsh themes use the git plugin sort of "hard coded" in their ...
17
votes
Accepted
How to overwrite aliases in my shell (Oh My Zsh)?
The alias command overrides a previous alias by the same name. So generally, if you want your aliases to override the ones defined by a zsh framework, put them at the end of your .zshrc. The same goes ...
16
votes
Accepted
How to auto-update custom plugins in Oh My Zsh?
Oh My Zsh upgrades are handled by the $ZSH/tools/upgrade.sh script. To update any custom plugins (assuming those are Git clones), you can add these lines to the end of the script before the exit ...
16
votes
Accepted
Prevent completion of files for 'make' command in zsh shell
You can ask zsh to only display targets tag for the make command completion with
zstyle ':completion:*:*:make:*' tag-order 'targets'
Add above code somewhere after the line
autoload -U compinit &...
15
votes
How do you "disable" oh-my-zsh (and zsh) without uninstalling it?
As it's a bit hidden in @Gilles answer the quick way to load zsh without any config e.g. .zshrc .zshenv etc
zsh -f
This is useful when you want to test if anything in your config is preventing some ...
15
votes
Why do I lose my ZSH history?
I don't think any zsh option is going to save your precious .zsh_history.
My .zsh_history has been randomly truncated over the years, and I still don't know why. I've tried every option I could find ...
12
votes
Accepted
Zsh icons broke in urxvt
First of all, there is a significant difference between the terminals types rxvt and unicode-rxvt (often abbreviated to urxvt). You have indicated that the terminal you are using is "URXVT Version 9....
12
votes
Changing cursor style based on mode in both zsh and vim
This works perfectly for me, it's taken from here: https://gist.github.com/LukeSmithxyz/e62f26e55ea8b0ed41a65912fbebbe52
# vi mode
bindkey -v
export KEYTIMEOUT=1
# Change cursor shape for different ...
11
votes
paste url into terminal(urxvt, zsh) failed, some characters get escaped
This is a Z Shell module known as "url-quote-magic" in action. It is trying to ensure that you end up with what you intended even though you completely ignored shell metacharacters and quoting. It ...
11
votes
Accepted
Remove colors from zsh tab-completion
With pure zsh:
zstyle ':completion:*' list-colors
Conversely, to use the same colors as the ls command:
eval "$(dircolors)"
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
This should work ...
11
votes
Accepted
How to get asterisk '*' in zsh to have same behaviour as bash?
ls * would have the same effect in bash. No matter what the shell is, what happens is that the shell first expands the wildcards, and then passes the result of the expansion to the command. For ...
10
votes
Accepted
What ZSH theme does Kali use?
Kali Linux does not use a separate theme file for its zsh customizations. So you cannot download the Kali Linux zsh theme, drop it in themes/, and set ZSH_THEME to its name as you usually can in Oh My ...
9
votes
zsh fails at path completition when command is vim
This works for me :
rm $ZSH_COMPDUMP && exec zsh
9
votes
How to change theme with zsh
Thanks to @John P above in the comments as it's really his answer but for those wanting a way to change zsh theme "on the fly" without editing and re-sourcing the config, simply define this ...
9
votes
Accepted
Zsh: hash directory completion
You had the options auto_cd and cdable_vars turned on. With auto_cd, if you type a directory as a command name, the cd command is implied. With cdable_vars, if a directory doesn't exist, or a command ...
9
votes
Accepted
Files in $ZSH_CUSTOM not loaded by oh-my-zsh
Files you create in $ZSH_CUSTOM need to have a file extension of .zsh, according to the documentation:
oh-my-zsh's internals are defined in its lib directory. To change them, just create a file ...
9
votes
Accepted
How do I add colored-manpages plugin to my zsh profile (using oh-my-zsh)?
Just add the plugin to the plugins definition in .zshrc:
plugins=(last-working-dir colored-man-pages)
Then start a new shell and you'll see the plugin activated.
9
votes
How to auto-trigger history search in zsh using fzf (fuzzy finder)?
This is described in the original GitHub repository. In case you are using homebrew you'll just need to type $(brew --prefix)/opt/fzf/install and configure it the way you like. The script will create ...
9
votes
How to properly make custom zsh completions "just work"?
TL,DR: In normal operations, just drop the file into the appropriate directory. While testing, you need to remove the cache file (.zcompdump by default, but users can put it in a different location, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
oh-my-zsh × 286zsh × 268
autocomplete × 42
shell × 26
terminal × 25
command-history × 21
macos × 21
alias × 18
bash × 13
ubuntu × 11
prompt × 10
ssh × 9
colors × 9
linux × 8
command-line × 8
git × 7
theme × 7
ls × 6
tmux × 6
fedora × 5
vim × 5
environment-variables × 5
shell-script × 4
arch-linux × 4
windows-subsystem-for-linux × 4