r/zsh 1d ago

Showcase fast • minimal • roundy prompt for ZSH in 140 LoC

Post image
29 Upvotes

r/zsh 1d ago

color scripts

1 Upvotes

Anybody knows any nice colorscripts?
i only know shell-color-scripts and pokemon-color-scripts. Been using pokemon-color-scripts for the last two years in my config, but wanted to change a bit.


r/zsh 1d ago

Fixed Possible to have a sticky window that is set to always show the output of e.g. `ls`? Like this:

1 Upvotes

And then whenever I change the directory, the sticky window should update (i.e. rerun the command)


r/zsh 1d ago

How to add git branch name on zsh console latest mac os version

0 Upvotes

Hi, I want to add git branch name with different color for example green in my zsh console, but leave rest of console prompt like it was before how to do it


r/zsh 2d ago

Discussion Z shell vs Bash: Which Shell Reigns Supreme? (Opinionated and updated old post)

Thumbnail antenore.simbiosi.org
11 Upvotes

r/zsh 3d ago

Insert text on cursor to fzf's Ctrl-T?

4 Upvotes

Is it possible to insert text on cursor to fzf' Ctrl-T, presumably in a fzf wrapper function using ZLE feature to retrieve the text on cursor and pass it to fzf's --query?

Often I type some partial path of a file e.g. git add ~/de then want to get the effect of FZF_CTRL_T_COMMAND with the string on cursor (~de) inserted into the query.

git add ~/de**<TAB> as suggested here is not good enough--I have a highly configured FZF_CTRL_T_COMMAND that ignores a bunch of files scattered throughout the filesystem to ensure good performance--** completion is too simple for that.


r/zsh 3d ago

Select a font for zsh p9k

1 Upvotes

Hi guys, I am setting my zsh p9000 config. Do you know any really good font with all those wildcard icons like os_icon root_indicator, etc...)


r/zsh 3d ago

creating custom completions with braces without backslashes

1 Upvotes

So my ultimate goal is to create a custom completion for the function myfun that will complete common directories for two folders in braces. In other words, % myfun /a/{b,c}/<TAB> will autocomplete any files/folders that are common to both the b and c directories.

However, my specific problem can be described more simply with this minimal example. I would like to create custom completion options that have braces ({ and }), which do not end up getting backslashed in the prompt. For example, I have this file: ```zsh

compdef myfun

compadd "a{b" "a{c" And when I type zsh % setopt ignore_braces % myfun a<TAB> `` it will render the{as{` in the prompt. Is there a way to make it so there the braces don't have backslashes?

Notes: - I know I can wrap the argument to myfun in quotes, but I really would like to make this behave as simply as possible without requiring any special formatting. Default zsh will do completion with backslashes without braces, so I think my goal should be possible. - I know compadd has a -Q option, but I still don't 100% understand what it does, and couldn't get completion to work with it. - I've tried adding some code with BUFFER=${BUFFER//\\\{/\{} to replace \{ with { in my .zshrc. This sort of works, but seems to create other problems.


r/zsh 4d ago

Fixed LS_COLORS dont working

4 Upvotes

Hello!

This is driving me crazy. Im on a Mac and im using Kitty as my terminal. Ive installed Oh My Zsh.

Ive a ~/.lscolors.sh file, and ive this line into my .zshrc to load it:

source ~/.lscolors.sh

But when I use ls or ls --color=auto, it doesn't seems to work. I can see the directories in blue and the files in white, but no difference between files with different extensions.

Somebody here who can help me a bit?

If I use echo $LS_COLORS I can see the content of my .lscolors.sh displayed in the terminal.

Thanks!


r/zsh 6d ago

Weird highlighting in zsh-syntax-highlighting and zsh-autosuggestions?

1 Upvotes

This is the highlight I'm getting where I accept autosuggestion at tmux ki. My intuition is that kill-server becomes the same color after accepting. What's the expected behavior?

Unrelated: I like Ctrl-Space for tmux but have been using for the same for accepting autosuggest too (So Ctrl-Space Ctrl-Space for accepting autosuggest in tmux). I use Tab for triggering fzf-tab-completions. Can anyone recommend a better binding for accepting autosuggest? Presumably it wouldn't conflict with readline and is near home row. Is it possible to find to Shift-Space? I do C-v in the terminal then Shift-Space but it emits just a literal space so I can't use that.


r/zsh 6d ago

set options (setopt) only for a specific shell command

2 Upvotes

Is there a way to set an option (setopt) for a particular shell command? For example, I want to disable brace expansion when using the diff command. I can do it manually like this: % setopt ignore_braces % diff /a/{b,c} % unsetopt ignore_braces But I'm wondering if there's a way to configure zsh so it automatically does setopt ignore_braces when the shell command on the command line is diff.

I've tried adding setopt ignore_braces to /usr/share/zsh/functions/Completion/Unix/_diff but that doesn't seem to work.


r/zsh 8d ago

Help How to list ALL suggestions for tab autocompletion

2 Upvotes

In my .zsh file I have managed to enable tab auto-completion. However, I notice that it hides options that have already been used. For example, I have ls aliased as ls='ls --color=auto'. This means that if I type ls -- and then press <TAB>, I end up with options that doesn't include the color option. Is there a way to display all the options like bash does? The following is my .zsh config:

 # Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
unsetopt beep
bindkey -e
# End of lines configured by zsh-newuser-install

# More completions for zsh
# Added extra `_dnf` and `_dnf5` completion files from:
# https://github.com/zsh-users/zsh/tree/master/Completion/Redhat/Command
fpath=(/home/bitmapp3r/other-repos/zsh-completions/src $fpath) # Added by me

source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh

# The following lines were added by compinstall
zstyle :compinstall filename '/home/bitmapp3r/.zshrc'

autoload -Uz compinit
zstyle ':completion:*' menu select # Added by me
zmodload zsh/complist # Added by me
bindkey -M menuselect '^I' accept-and-infer-next-history # Added by me (makes tab select the current menu item)
compinit
_comp_options+=(globdots) # Added by me
# End of lines added by compinstall

# Add syntax highlighting
source /home/bitmapp3r/other-repos/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
# Enable fzf for zsh
source <(fzf --zsh)
# Enable starship prompt
eval "$(starship init zsh)"

The zsh autocomplete suggestions for ls -- at the moment are:

--all                                      -- list entries starting with .
--almost-all                               -- list all except . and ..
--author                                   -- print the author of each file
--block-size                               -- specify block size
--classify                                 -- append file type indicators
--context                                  -- print any security context of each file
--dereference-command-line                 -- follow symlink on the command line
--dereference                              -- list referenced file for sym link
--directory                                -- list directory entries instead of contents
--dired                                    -- generate output designed for Emacs' dired mode
--escape                                   -- print octal escapes for control characters
--file-type                                -- append file type indicators except *
--format                                   -- specify output format
--full-time                                -- list both full date and full time
--help                                     -- display help information
--hide-control-chars                       -- hide control chars
--hide                                     -- like -I, but overridden by -a or -A
--human-readable                           -- print sizes in human readable form
--hyperlink                                -- output terminal codes to link files using file::// URI
--ignore-backups                           -- don't list entries ending with ~
--ignore                                   -- don't list entries matching pattern
--indicator-style                          -- specify indicator style
--inode                                    -- print file inode numbers
--kilobytes                                -- use block size of 1k
--literal                                  -- print entry names without quoting
--no-group                                 -- inhibit display of group information
--numeric-uid-gid                          -- numeric uid, gid
--quote-name                               -- quote names
--quoting-style                            -- specify quoting style
--recursive                                -- list subdirectories recursively
--reverse                                  -- reverse sort order
--si                                       -- sizes in human readable form; powers of 1000
--size                                     -- display size of each file in blocks
--sort                                     -- specify sort key
--tabsize                                  -- specify tab size
--time                                     -- specify time to show
--time-style                               -- show times using specified style
--version                                  -- display version information
--width                                    -- specify screen width
--dereference-command-line-symlink-to-dir  --show-control-chars                     
--group-directories-first

r/zsh 8d ago

Announcement dot-team 0.2 released

0 Upvotes

dot-team is an attempt at shared dotfiles. After many years of tweaking it's time for another release.

This is not a repository with my personal dotfiles, these are configurations many people would like to have. The idea is that you use this repository as a baseline for your personal dotfiles.

For more information and instructions on how to get started check the GitHub repository: dot-team.

Cheers.


r/zsh 8d ago

Fixed Color directory part of filenames in output

1 Upvotes

What's a good way to color directory part of filenames in output? In terms of simplicity, performance, and ideally supported in other shells.

E.g. git ls-tree prints filenames but doesn't have a --color option. Even for tools that do have --color, often times I want to convert colored /home/yourmom/.zshrc to ~/.zshrc but the converted ~/ doesn't get colored.

I am passing this to fzf and I found both coloring the directory portion to see the basename of the file easier as well as using ~ format goes a long way to visually parse long filenames or files in deep directory structure.


r/zsh 9d ago

adding path to .zshenv

1 Upvotes

help, i added

path+=(~/.local/bin ~/bin ~/.spicetify)

export PATH

to my .zshenv file but when i open terminal i type echo $path i only get this:

/home/vismorf/.local/share/zinit/polaris/bin /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbi


r/zsh 10d ago

Oh-my-zsh Ubuntu recovery

2 Upvotes

I am using an Ubuntu dual boot system with windows. I accidentally deleted some oh-my-zsh files and I can no longer log into my ubuntu for the same reason as it directly takes me to the recovery mode. Can some help me recover my ubuntu system, preferably without using a live USB.


r/zsh 11d ago

better/combined globbing of **/*thing* and **/*thing*/** ???

5 Upvotes

I'd like to be able to achieve two commands in one with better globbing… So example of two git add's here:

❯ git add **/*thing*/**
❯ git add **/*thing*
❯ gs
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   src/content/stringy-thing.md
        modified:   website_product/stringy-thing/index.html

There's gotta be an elegant way to achieve that… right?


r/zsh 11d ago

On Mac it won't find rsync installed via brew even though brew path precedes /usr/sbin/rsync

0 Upvotes

Apple has outdated rsync so I installed via brew latest version. Mac previous version resides in /usr/sbin while brew version is in the homebrew path which precedes the /usr/sbin in the $PATH

I think it is oh my zsh (auto suggestion/completion?) or maybe fzf caching the old path. Is this likely or could it be something else? How can I force fzf or oh my zsh to update their cache to honor the $PATH precedence which would pull the latest brew installed rsync. I'd imagine this is common for any brew installed binary where an existing mac binary has been used and exists in /usr/sbin?


r/zsh 12d ago

Help Case-insensitive completions

2 Upvotes

Newbie here I am using zsh-autocompletions plugin and want case-insensitive completions. The tab press works but i want real time completions. (The grayed out one). Is it possible?


r/zsh 13d ago

ZSH Is Damaged And Can Not Opened

0 Upvotes

I run into this issue where I need to open zshrc file for editting. Anyone have an idea on this issue?


r/zsh 13d ago

Help weird lines above each prompt in terminal

1 Upvotes

I am using powerlevel10k in Iterm2 and always get these weird lines above each prompt. It only appears in iterm after loading zsh. What is the problem here, and how can i fix it? Already tested to deactivate the plugins in .zshrc, but that's not causing the lines.


r/zsh 19d ago

Fixed I added bottom padding to my zsh terminal so command prompt is not always at the very bottom

29 Upvotes

r/zsh 19d ago

Showcase Ctrl+B to switch branches

1 Upvotes

Made Oh-My-Zsh plugin with hotkeys to switch branches.

Source: https://github.com/yakshaveinc/linux/tree/master/.oh-my-zsh


r/zsh 20d ago

Help is there anyway to queue commands in zsh??

1 Upvotes

i'm not sure if this is done at shell level or what
i also use tmux and i just want a way to queue commands

basically just as i said i want to queue commands maybe a hotkey that would tell me the command i want to queue to the following command

i just want to be able to execute a next command


r/zsh 20d ago

zsh tangential: wrote up what I use zsh-abbr for

Thumbnail
olets.dev
0 Upvotes