Zsh: Difference between revisions
I divided the information into more manageable sections and formatted the code using Alejandra. Additionally, I added references and some other options. |
m Removed numbering |
||
Line 10: | Line 10: | ||
== Configuration == | == Configuration == | ||
==== | ==== Basic ==== | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
programs.zsh = { | programs.zsh = { | ||
Line 17: | Line 17: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== | ==== Advanced ==== | ||
The configuration below is using home manager, but a more limited version of it can be achieved if system-wide.<syntaxhighlight lang="nix"> | The configuration below is using home manager, but a more limited version of it can be achieved if system-wide.<syntaxhighlight lang="nix"> | ||
programs.zsh = { | programs.zsh = { | ||
Line 40: | Line 40: | ||
== Tips and Tricks == | == Tips and Tricks == | ||
==== | ==== Where to see a list of options? ==== | ||
The home manager options are defined in the following [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.zsh.enable Home Manager Options Manual]. | The home manager options are defined in the following [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.zsh.enable Home Manager Options Manual]. | ||
The system-wide options are listed on [https://mynixos.com/search?q=zsh MyNixOS]. | The system-wide options are listed on [https://mynixos.com/search?q=zsh MyNixOS]. | ||
==== | ==== How to use plugins? ==== | ||
Home manager has three ways of managing plugins: '''Zplug''', '''Oh-My-Zsh''' and '''Manual'''.<syntaxhighlight lang="nix"> | Home manager has three ways of managing plugins: '''Zplug''', '''Oh-My-Zsh''' and '''Manual'''.<syntaxhighlight lang="nix"> | ||
programs.zsh = { | programs.zsh = { | ||
Line 102: | Line 102: | ||
== Troubleshooting == | == Troubleshooting == | ||
==== | ==== Zsh-autocomplete not working ==== | ||
You may have some issues with the {{ic|marlonrichert/zsh-autocomplete}} plugin on NixOS. That's because the default NixOS configuration overrides keybinds for up and down arrow keys. To fix this issue, you need to add this somewhere in your .zshrc (either manually if your .zshrc is not managed by Nix, or with {{ic|packages.zsh.initExtra}}) | You may have some issues with the {{ic|marlonrichert/zsh-autocomplete}} plugin on NixOS. That's because the default NixOS configuration overrides keybinds for up and down arrow keys. To fix this issue, you need to add this somewhere in your .zshrc (either manually if your .zshrc is not managed by Nix, or with {{ic|packages.zsh.initExtra}}) | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 108: | Line 108: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== | ==== SHA Mismatch during manual plugin installation ==== | ||
If manual plugin installation fails with SHA mismatch, generating a valid hash as part of the error message can be achieved by temporarily switching to: | If manual plugin installation fails with SHA mismatch, generating a valid hash as part of the error message can be achieved by temporarily switching to: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
Line 117: | Line 117: | ||
Redoing this is mandatory if one wants to update to a newer commit of the targeted plugin repository. | Redoing this is mandatory if one wants to update to a newer commit of the targeted plugin repository. | ||
==== | ==== GDM does not show user when zsh is the default shell ==== | ||
GDM only shows users that have their default shell set to a shell listed in /etc/shells. Setting the default shell using the following does not update /etc/shells. | GDM only shows users that have their default shell set to a shell listed in /etc/shells. Setting the default shell using the following does not update /etc/shells. | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> |