r/zsh • • Feb 04 '26

Announcement Cheatsheet for Zsh

1 Upvotes

Hello,

I have vibe code this plugin for zsh which give help about terminal command.
It use ZLE and fzf for providing help to user.
CTRL+H is the default shortcut to launch help.
Please take a look and give me your opinion about this.
Thanks.

https://github.com/Xav-Deb/zsh-cheatsheet/


r/zsh • • Jul 14 '24

With p10k unmaintained: Here is my ultra-small plugin-less git prompt

Post image
0 Upvotes

r/zsh • • Mar 15 '23

Help Welcome message

Post image
0 Upvotes

I need your help! On every login, this prompt appears

I'd love to "fix the problem as soon as feasible" , only I've no idea how.

I guess there's a syntax problem somewhere?

Where should I start?

. profile, .zshrc ?


r/zsh • • Sep 26 '24

I think the new terminal in Rider (macOS) is aesthetically pleasing. It's simple and clean. Best of all, each command and output is wrapped in a shaded box, which makes it easy to know where one command ends and another begins. Is there a way to recreate this in my default terminal on my MacBook?

Post image
1 Upvotes

r/zsh • • Apr 12 '26

Help Why doesn't my binary run in zsh? Sorry I'm a beginner and I have no clue where to go about this

1 Upvotes

If I make a c file with the typical: ` #include <stdio.h> int main(){ printf("HI"); } I'm sorry I don't know how to format the code in markdown :(

Then I compile it with gcc and execute the binary, but it doesnt show the print statement. Why? It works in bash, I checked


r/zsh • • Sep 08 '26

How to configure zsh-autosuggestions

2 Upvotes

Sup guys

Am using ZSH as my default shell and Arch Linux as OS but my shell don't have the zsh-autosuggestion. I have tried to clone some repository in GitHub about such zsh-autosuggestion but when source the shell by source ~/.zshrc it gemme the error of `[oh-my-zsh] plugin'zsh-autosuggestions' not found`

How can I configure it so it work.

Thanks!


r/zsh • • May 02 '20

Problem With My Zsh Terminal

0 Upvotes

Hey guys,

Looks like i'm having some minor problems with my Zsh terminal.

When i use the touch command via zsh terminal to save a file, i can't find the file i just saved when i go back and open the folder. However, when i use the ls/list command in the dir where i saved the file, it shows as listed/existing in the folder via the terminal/shell.

Im hoping this makes sense to someone who might've had a similar issue with the Zsh terminal


r/zsh • • Jan 01 '26

Should I turn off shell competition?

1 Upvotes

I am a newcomer to Linux but I am fairly comfortable with shell. I use zsh but the shell completition feature, which is very useful, just makes me more forgetful of commands, if you can understand what I mean.


r/zsh • • Jun 23 '19

romkatv, please fair in your posts

7 Upvotes

/u/romkatv I have to point out some of your posts are misleading, like

Cause it's not your prompt is faster, but the gitstatus is faster. If you disable the git section in both promtps, there's basically no difference.

I appreciate your work, the speed brought by gitstatus in large repos, and I'm very glad to see someone improve powerlevel9k.

But please be fair. I've seen many times you posted here to promote your prompt. Not any once, you're telling us the truth:

  1. The speed of your prompt is mainly brought by gitstatus. And gitstatus's advantage is perceptible only in a large repo. That means there's no such a greet speed improvement if the git section is disabled.

  2. besides, initialization of gitstatus daemon brings an overhead of 50-60ms during the startup

Other guys promote their works here as well, like psprint2 promoted his zplugin many times. But I don't see these guys make partial comparisons and defame others' works.

Your work on gitstatus already earned praise for yourself here. Don't ruin your image by these greedy promotions. Please be fair.

Update:

Take your most recent post related with spaceship-prompt for example. If you're really confident about the speed of your prompt, why do you do the comparison under a repo having 5187 files? Obviously, a prompt without gitstatus (powerlevel9k, spaceship, pure) is no match for a prompt with it (powerlevel10k) in this situation.

Reading from your reply/benchmark, the powerlevel10k may be faster in other parts, but it's no way to tell the difference if you cheat with a big repo in your screencast.

Another question I wanna ask to you, maybe others are curious about as well is that you forked powerlevel9k as powerlevel10k and made improvements on it, why don't contribute back to the original repo?

Yes, you did open some issues and feedbacked to the original project. There's about 32 issues opened by you under bhilburn/powerlevel9k.

How many pull requests have you contributed? 0 pull request.

Besides, you integrated gitstatus into powerlevel10k very early, but the support of gitstatus in the original powerlevel9k is not added by you either. Of course, powerlevel10k will become better and better than the original powerlevel9k, cause you merge none of the improvements back.

I'm not an author of some zsh prompts, nor a contributor. Even a layman like me knows that, your behavior is far from decent in the community of open source.

robobenklein's p10k prompt (named zinc now), may hitch hike on powerlevel9k's name as well. AFAIK, it's totally a rewritten with async support. While, you powerlevel10k is not only hitchhiking on the popularity of powerlevel9k the name, but the source codes of it.


r/zsh • • Jan 20 '25

The best minimal zsh configuration

Thumbnail
felipec.wordpress.com
0 Upvotes

r/zsh • • Mar 22 '26

My simple zsh tools

1 Upvotes

Optimizing tool selection...Hey r/zsh community! 👋

I've been working on a handy bash toolset called bash-tools that makes command-line navigation and file management a breeze. It's designed to simplify your workflow with smart alias support and auto-aliasing features.

Key Features:

  • Quick Navigation: Use to to jump to directories, dev to open in VS Code, file to open in Finder

  • URL Handling: web opens URLs or aliases, with automatic alias creation from URLs

  • File Operations: md views markdown in browser, path copies paths to clipboard

  • Git Integration: sync handles add/commit/push in one go

  • Search Subcommands: All commands support s for fuzzy file search (e.g., dev s myproject api)

  • Smart Aliasing: Automatically creates aliases from paths/URLs (e.g., \~/Projects/MyApp → myapp)

It supports both aliases and direct paths/URLs, so you can use it flexibly. Perfect for developers who switch between projects frequently!

Check it out on GitHub: https://github.com/leonezhu/bash-tools

Would love to hear your feedback or suggestions!


r/zsh • • Jul 26 '24

Switched from Oh My Zsh to zinit; startup time doubled

0 Upvotes

As the title says, I tried to migrate my .zshrc from Oh My Zsh to zinit in hopes of seeing some performance increase in my startup time. Instead, it doubled. Startup time with OMZ was ~250ms; with zinit it is ~500ms. Here's my zshrc for OMZ and zinit respectively, if anyone has thoughts worth sharing:

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="powerlevel10k/powerlevel10k"

# Lazyload nvm plugin
zstyle ':omz:plugins:nvm' lazy yes
plugins=(git fzf-tab zsh-autosuggestions zsh-completions nvm npm aws brew docker docker-compose history last-working-dir zsh-syntax-highlighting zsh-vi-mode)

source $ZSH/oh-my-zsh.sh

# Syntax Highlighting Colors
COMMAND_COLOR='fg=084,bold'
typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=204,bold'
ZSH_HIGHLIGHT_STYLES[command]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[builtin]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[hashed-command]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[function]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[precommand]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[alias]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[suffix-alias]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[global-alias]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=011'
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=011'


# Custom keybindings
bindkey '^p' history-search-backward
bindkey '^n' history-search-backward

# Custom history options
HISTSIZE=5000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups

# Completion styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'

alias vim=nvim
alias vi=nvim
alias jirabl="jira issue list -a$(jira me) -sBacklog -sPlanned -sGroomed --order-by rank --order-by status"
alias jirame='jira issue list --order-by rank --order-by status  -a$(jira me) -sPlanned -sGroomed -s"In Development" -s"Hold/Waiting" -s"Code Review" -sQA'
ip () {
  echo "Public IP:  $(dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | tr -d '"')"
  echo "Private IP: $(ipconfig getifaddr en0)"
}

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

eval "$(fzf --zsh)"

export GPG_TTY=$(tty)
export PATH="/opt/homebrew/opt/curl/bin:$PATH"
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# Environment variables
export PATH="/opt/homebrew/opt/curl/bin:$PATH"
export GPG_TTY=$(tty)

if [[ -f "/opt/homebrew/bin/brew" ]] then
  # If you're using macOS, you'll want this enabled
  eval "$(/opt/homebrew/bin/brew shellenv)"
fi

# Set the directory we want to store zinit and plugins
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"

# Download Zinit, if it's not there yet
if [ ! -d "$ZINIT_HOME" ]; then
   mkdir -p "$(dirname $ZINIT_HOME)"
   git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi

# Source/Load zinit
source "${ZINIT_HOME}/zinit.zsh"

# Add in Powerlevel10k
zinit ice depth=1; zinit light romkatv/powerlevel10k

# Add in zsh plugins
zinit light Aloxaf/fzf-tab
zinit light zsh-users/zsh-autosuggestions
zinit light zsh-users/zsh-completions
zinit light zsh-users/zsh-syntax-highlighting
zinit ice depth=1; zinit light jeffreytse/zsh-vi-mode
export NVM_COMPLETION=true
export NVM_SYMLINK_CURRENT="true"
export NVM_LAZY_LOAD=true
export NVM_LAZY_LOAD_EXTRA_COMMANDS=('nvim' 'vim' 'vi')
zinit wait lucid light-mode for lukechilds/zsh-nvm

# Add in snippets
zinit snippet OMZP::git
zinit snippet OMZP::sudo
zinit snippet OMZP::aws
zinit snippet OMZP::command-not-found

# Load completions
autoload -Uz compinit && compinit

zinit cdreplay -q

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh


# Syntax Highlighting Colors
COMMAND_COLOR='fg=084,bold'
typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=204,bold'
ZSH_HIGHLIGHT_STYLES[command]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[builtin]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[hashed-command]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[function]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[precommand]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[alias]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[suffix-alias]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[global-alias]=$COMMAND_COLOR
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=011'
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=011'

# Keybindings
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward

# History
HISTSIZE=5000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups

# Completion styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'

# Aliases
alias vim=nvim
alias vi=nvim
alias jirabl="jira issue list -a$(jira me) -sBacklog -sPlanned -sGroomed --order-by rank --order-by status"
alias jirame='jira issue list --order-by rank --order-by status  -a$(jira me) -sPlanned -sGroomed -s"In Development" -s"Hold/Waiting" -s"Code Review" -sQA'
ip () {
  echo "Public IP:  $(dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | tr -d '"')"
  echo "Private IP: $(ipconfig getifaddr en0)"
}
alias ls='ls --color'
alias c='clear'

# Shell integrations
eval "$(fzf --zsh)"
# eval "$(zoxide init --cmd cd zsh)"

r/zsh • • Oct 01 '24

Help any ready to use zsh configs?)

0 Upvotes

Hi all... I am looking for a ready to use zsh configs(themes)... yes maybe there're a lot but I kinda don't like them so can you give me some example?
I really like minimalism and it'd be amazing if someone suggests minimalistic zsh theme)

Thank you.


r/zsh • • Jul 12 '26

Showcase EasyAlias

Post image
0 Upvotes

r/zsh • • Dec 03 '20

Do you need a computer science degree to install and use zsh?

0 Upvotes

Hey, I think I find quite a few articles on how to make zsh nice and colorful. And how to install oh my zsh or Prezto. I'm not interested in that at all.

What I'm looking for is how to move from bash to zsh.

What to do with my .bashrc, .bash_profile, .bash_logout? What about my .xinitrc. Right now it says:

#!/bin/bash

shall i change it to:

#!/bin/zsh

or can I just change it to:

#!/bin/sh

or

#!/usr/bin/sh

It says

#!/usr/bin/sh

on the xinitrc which is placed in /etc /X11/xinit/xinitrc.

I changed it to

#!/bin/bash

when I moved my xinitrc to ~/.xinitrc. I log in through tty, with startx, I do not have any login manager.

I would still like to have the opportunity to use bash. How do i approach it? All the how tos that are on the internet say just install zsh, and install oh my zsh or Prezto, then all is well. I'm not interested in oh my zsh or Prezto.

Is it really that simple to install zsh? I have installed it through my pakage manager and I have a .zshrc. What to do from here? I am on linux.

My head hurts after reading all the stupid articles that say the same thing, about the installation.


r/zsh • • Jan 23 '25

Fixed Join the Zsh Discord!

Thumbnail discord.gg
1 Upvotes

r/zsh • • May 23 '26

Hey everyone! I wanted to share my customized safe space setup to show my continuous solidarity and support for the community. Love is Love! I’ve been using this config across my devices (both on Termux and my Arch Linux VM). It’s super lightweight and uses standard ANSI background colors to draw

Post image
0 Upvotes

Hey everyone! I wanted to share my customized safe space setup to show my continuous solidarity and support for the community. Love is Love!

I’ve been using this config across my devices (both on Termux and my Arch Linux VM). It’s super lightweight and uses standard ANSI background colors to draw the flag, completely avoiding parsing errors.

**Details:** * **OS:** Android (Termux) / Arch Linux * **Shell:** ZSH * **Tools:** figlet, lolcat, neofetch


**How to get this look:**

**Step 1: Install the required tools** Run these commands:

pkg install figlet neofetch ruby
gem install lolcat

**Step 2: Update your config** Open your ~/.zshrc file and add the following code to the bottom of it:

clear
echo ""
echo -e "\\e\[48;5;196m                                      \\e\[0m"
echo -e "\\e\[48;5;208m                                      \\e\[0m"
echo -e "\\e\[48;5;226m                                      \\e\[0m"
echo -e "\\e\[48;5;46m                                      \\e\[0m"
echo -e "\\e\[48;5;21m                                      \\e\[0m"
echo -e "\\e\[48;5;93m                                      \\e\[0m"
echo ""
figlet -f slant TERMUX | lolcat -p 0.3
echo -e "\\e\[1m          Love is Love\\e\[0m" | lolcat -p 0.3
echo -e "\\e\[1m          Born This Way\\e\[0m" | lolcat -p 0.3
echo -e "\\e\[1m          Be You, Be Proud\\e\[0m" | lolcat -p 0.3
echo -e "\\e\[1m          We Are Everywhere\\e\[0m" | lolcat -p 0.3
echo ""
neofetch --off | lolcat -p 0.3

alias ls='ls --color=always | lolcat -p 0.3'
alias cat='cat | lolcat -p 0.3'
alias pwd='pwd | lolcat -p 0.3'
alias date='date | lolcat -p 0.3'
alias ifconfig='ifconfig | lolcat -p 0.3'
alias -g C='| lolcat -p 0.3'

PROMPT=$'%{\\e\[1;31m%}┌─\[%{\\e\[1;33m%}user%{\\e\[1;32m%}@%{\\e\[1;36m%}termux%{\\e\[1;31m%}\]-\[%{\\e\[1;34m%}%\~%{\\e\[1;31m%}\]\\n└─$ %{\\e\[0m%}'

**Step 3: Apply the changes**

source \~/.zshrc

r/zsh • • Mar 10 '24

Help oh-my-zsh bug printing a "%" or double bars each execution?

0 Upvotes

does anyone have any explanation for this? why do i keep getting "%" everytime i open a terminal? sometimes i even get double bars as well. I troubleshooted the problem and it seems it stems from the plugins auto-suggestion and auto-syntax-highlighting. When I delete those plugins, it seems to work just fine, but everytime I add them, it seems cause this problem.
I have tried different things like, manually downloading the plugin files and changing the format of the plugin list in the .zshrc file, or changing the order. Nothing worked. I have other plugins like sudo history git and some other stuff. They seem to not cause any problems. It also existed before the pokemon script, so the pokemon script definitely isn't the problem.


r/zsh • • Mar 20 '22

Is it possible to delete a variable in an array found in a python file using zsh?

0 Upvotes

I know this isn't practical, but I'm more just curious if this is possible as I am new to zsh aside from basic commands. If it is possible, how would I go about doing it? From what I could find on google it seems like maybe sed would be my best bet?


r/zsh • • Jan 22 '18

Async shell idea, is it possible?

Thumbnail
self.commandline
0 Upvotes

r/zsh • • Feb 06 '24

Uh... nvm... what are you doing?

0 Upvotes

Edit: This is directly after loading .zshrc

Edit 2: I sound a good solution (zsh-defer):

# ~/.zshrc

source ~/zsh-defer/zsh-defer.plugin.zsh

# nvm
load_nvm() {
  export NVM_DIR="$HOME/.nvm"
  [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
  [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
}

zsh-defer load_nvm

The loading of nvm is still slow, but now the startup feels fast and it accepts keyboard inputs.

Edit 3: spelling


r/zsh • • Jul 29 '24

Transform Your Terminal: 3 Must-Have Zsh Plugins!

Thumbnail
youtu.be
4 Upvotes

r/zsh • • Sep 08 '26

How to configure zsh-syntax-highlighting

1 Upvotes

Am using ZSH as my default terminal (oh my zsh) and it don't feature of zsh-syntax-highlighting and I have tried to copy the repository from GitHub but I don't know how to configure it in my zsh configurations


r/zsh • • Feb 13 '19

How do I remove the `127 ↵` from the screenshot? Using a version of af-magic?

Post image
1 Upvotes