So I'm faced up with this discrepancy between the way my ls displays colors via this:
https://github.com/seebi/dircolors-solarized
Between that, and how zsh tab autocompletion display colors. I'll make this clear with an image:
Cheers in advance for any insights as to how to reconcile these two realms of listing directories!
list-colors is the style used by Zsh to set completion colors, it has its own funny syntax, use the following to set it to match your LS_COLORS:
# colored completion - use my LS_COLORS
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
BTW, this line comes straight from the zsh manual, man zshall and then search for LS_COLORS.
Related
I recently switched from bash to zsh and I am trying to figure out how to change the double tab autocomplete behavior. I'd like it to autocomplete only if there is a unique match.
This can be controlled by shell options. You can try it in interactive shell first, then add your preferred options to ~/.zshrc.
To make zsh auto complete behave more like bash, you can start with this:
setopt NO_AUTOLIST BASH_AUTOLIST NO_MENUCOMPLETE
Also check official zsh documentation, section 6 and especially subsection 6.2. Currently it can be found here: https://zsh.sourceforge.io/Guide/zshguide06.html#l147
I use zsh and I would like backward-kill-word in Emacs mode to behave like Emacs (and bash, fwiw). The behaviour that I have failed to reproduce is that when I press multiple backward-kill-word Emacs adds the killed text to the cut buffer (the first item in the killring) making it possible for me to yank everything with one yank command.
How can I configure zsh to behave like this aspect of Emacs editors?
Actually, by default, Zsh's cut buffer works exactly the same as in Emacs. Just use zsh -f to start Zsh without config files and try it.
However, are you perhaps using zsh-autosuggestions or zsh-syntax-highlighting? There are bugs in these plugins that break this feature:
https://github.com/zsh-users/zsh-autosuggestions/issues/363
https://github.com/zsh-users/zsh-syntax-highlighting/issues/150#issuecomment-658381485
Fixes have been submitted, but for zsh-autosuggestions, none have yet been merged, and for zsh-syntax-highlighting, the fix won't work until Zsh 5.9 has been released.
In the meantime, though, zsh-autocomplete contains a workaround that fixes the problem. If you add that plugin, your cut buffer will start functioning like normal again.
I'm confused what data is being shown in my terminal tabs. The first part, epzio is obviously my username. But the second part, #C02S60BBG8WP, I have no idea.
Note: I use zsh combined with oh-my-zsh for my shell.
Is it possible to customize what is shown in the tab titles? I'd like to remove the epzio#C02S60BBG8WP part altogether and just display the current working directory.
Also, why do my tab titles turn blue for no apparent reason? I thought this was only supposed to happen when you had a specific process such as node running. As you can see in the screenshot below, the tic-tac-toe tab has turned blue even though nothing is happening in that tab.
Update: It seems that the solution might involve making changes to ~/.oh-my-zsh/lib/termsupport.zsh, but I'm not sure if these would get overridden when oh-my-zsh updates itself.
C02S60BBG8WP is probably your hostname; check by typing hostname.
You can change the terminal title by printing an escape sequence like this:
echo -en "\033]0;New terminal title\a"
So this should change the title to your current working directory, $PWD, substituted by a single ~ if you're in $HOME:
echo -en "\033]0;${PWD/#$HOME/~}\007"
If that doesn't work, it's probably being overridden immediately afterwards by a command that is automatically invoked by your shell. In bash, this would be PROMPT_COMMAND which on my system looks like this:
$ echo $PROMPT_COMMAND
__vte_prompt_command; printf "\033]0;%s#%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"
The zsh equivalent seems to be to define a precmd hook:
precmd() { echo -en "\033]0;${PWD/#$HOME/~}\007" }
To make that permanent, you can just put it your .zshrc.
I'm trying to figure out how to customize zsh completion so that it never completes beyond an ambiguous result by just hitting tab. Here's an example.
$ emacs f<TAB>
food fool
(completes into)
$ emacs foo
food fool
Importantly, if I press TAB after 'emacs foo' I would like zsh to beep instead of complete into the menu.
Thanks.
Descending into the completion menu is controlled via the AUTO_MENU option. This is a default option which can be turned off by setting in your .zshrc the 'no' prefixed option.
setopt noautomenu
ZSH Documentation: 16 Options
Is there a way to make zsh complete parameters of commands (just like the fish shell do). For example, when I type ls -- and use TAB it will pop up a list of all ls parameters.
I know that I can use fish shell for this, and I know that fish shell is amazing, but there is a lot of missing functionalities in the fish shell. That's why I am looking to bring this parameter completion in zsh.
Try with single hyphen, like ls -. All built in commands are working fine. Btw for custom oh-my-zsh plugin autocompletion, it depends on plugin configuration.
oh-my-zsh has over 200 plugins for different commands. But unfortunately the auto completions are all hand made. So there will be never auto complete function for every command.