Fish
Last updated: 2024, Mon Jun 3rd at 13:48 CDT
Fish is a friendly smart shell. This includes features like syntax highlighting, autosuggest-as-you-type, and tab completions that just work. Fish is not POSIX compliant, though, so most shell scripts wont run normally.
Official Site GitHub Documentation
To Install: #
Preferred method
Install though your package manager
sudo pacman -S fish
sudo apt install fish
sudo dnf install fish
sudo zypper in fish
Essentials #
You can set fish as your default shell but do not remove bash or sh, this can break installs or install scripts. To switch to using fish as your default shell, run fish
then
chsh -s (which fish)
to add to root user
sudo chsh -s (which fish)
There are several advantages to using fish:
- Syntax highlighting and Autosuggestions, incorrect commands will be highlighted red along with greyed out suggested commands that you can accept with
→
oralt
+→
to accept the first word. - Tab Completion with interactive command options, by pressing
tab
fish tries to guess the word. If there is more then one then they are opened in menu. When a-
after a command andtab
is used it will try to list all the options. - Local web-based help and configuration, in the terminal if you type
help
orfish_config
a page will open in your browser. Thehelp
command opens the official documentation andfish_config
opens a page that allows you to configure some of the theming and prompts. - Interactive history search, A menu can be opened by pressing
Ctrl
+shift
+r
that allows you to search though the history of commands. - Abbreviations and Automatic cd, both of these can make it quicker to execute commands and navigate. Abbreviations can be used to shorthand code, so a command
upg
could be an abbreviation fornala upgrade
, this can also be used for frequent directories. Additionally in fish, it is not necessary to usecd
to change directory,~/downloads
works the same ascd ~/dowloads
.
Extras #
Note
Functions and settings can be put in
~/.config/fish/
When first starting out, most of your settings can go into config.fish
. However as you expand the config file, it will be easier to section out the settings for better speed and for easier reading. Start by moving functions into the .config/fish/functions/
and then move snippets to like alias or abbr to .config/fish/conf.d/
. Functions need to be in a file by the same name, the function msl
should be in the msl.fish
file.
Additionally fish will execute files in the same directory in a normal order (“01” before “2”), this means that you can create a load order by labeling 00-whatever.fish
or 00_whatever.fish
.