Fish: Difference between revisions

imported>TigerbyteDev
m added a missing bracket in the home manager config
imported>Liassica
Various cleanup and rewording
Line 1: Line 1:
{{DISPLAYTITLE:fish}}
{{DISPLAYTITLE:fish}}
fish is the [http://fishshell.com/ Friendly Interactive Shell].
fish, the [http://fishshell.com/ Friendly Interactive Shell], is a [[Command Shell|command shell]] designed around user-friendliness.


== Installation ==
== Installation ==
Line 6: Line 6:
For setting fish as the default shell system wide, see [[Command Shell#Changing default shell]].
For setting fish as the default shell system wide, see [[Command Shell#Changing default shell]].


A user specific installation with [[Home Manager]] looks like this
A basic user-specific installation with [[Home Manager]] may look like this:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 14: Line 14:
</syntaxhighlight>
</syntaxhighlight>


Change <code>myuser</code> with the username you want to configure.
Change <code>myuser</code> to the username of the user you want to configure.


You can enable the fish shell and manage fish configuration and plugins with home manager, but to enable vendor fish completions provided by Nixpkgs you will also want to enable the fish shell in <code>/etc/nixos/configuration.nix</code>:
You can enable the fish shell and manage fish configuration and plugins with Home Manager, but to enable vendor fish completions provided by Nixpkgs you will also want to enable the fish shell in <code>/etc/nixos/configuration.nix</code>:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 26: Line 26:
=== System wide ===
=== System wide ===


To enable fish plugins, add your prefered plugins to `environment.systemPackages` to enable them:
To enable fish plugins, add your preferred plugins to `environment.systemPackages`:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 44: Line 44:
=== Home Manager ===
=== Home Manager ===


An example configuration in Home Manager for adding plugins and changing options could look like this
An example configuration in Home Manager for adding plugins and changing options could look like this:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 91: Line 91:
</syntaxhighlight>
</syntaxhighlight>


Now your prompt looks like this
Now your prompt looks like this:


* outside: <code>~></code>
* outside: <code>~></code>
* inside: <code><nix-shell> ~></code>
* inside: <code><nix-shell> ~></code>


btw. you can directly start nix-shell in fish with <code>nix-shell --run fish</code>, but (FIXME) the normal build functions are not available there.
You can directly start nix-shell in fish with <code>nix-shell --run fish</code>.


=== Environments ===
=== Environments ===
Helper functions that put you in a nix-shell with the given packages installed.  
Here are some examples of helper functions that put you in a nix-shell with the given packages installed.  


You can either put these in <code>programs.fish.functions</code> with home-manager or in <code>~/.config/fish/functions/fish_prompt.fish</code> without.
You can either put these in <code>programs.fish.functions</code> with home-manager or in <code>~/.config/fish/functions/fish_prompt.fish</code> without.