Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips & Traps¶
Configuration files of the fish shell are located at
~/.config/fish.
Installation & Configuration¶
icon makes it easy to install and configure the fish shell.
icon fish -icKey Bindings¶
Use the built-in function
fish_key_readerto tell you how to bind shortcuts.If for whatever reason,
Alt+edoes edit the current command line in an external editor on macOS,Alt+vis the way to go (if you don’t bother or don’t have time to dig into configurations).
Shortcuts | Description |
|---|---|
Alt+. | Get parameter of previous commands. |
Alt+e or Alt+v | Edit the current command line in an external editor. |
Please refer to Interactive use for a more comprehensive list of key bindings.
Globbing / Wildcard Matching¶
Fish only supports the * and ** glob as syntax.
The ? glob has been deprecated and is supported in newer version of fish.
For more details,
please refer to
Fish Documentation - Wildcards (Globs)
.
Linting Tools for Fish Scripts¶
The fish shell provides built-in tools for lingting.
fish_ident: format fish scripts.fish -n: check syntax of fish scripts.
Completions¶
The built-in fish function fish
_update _completions updates completions using manual pages. Instead of writing completion scripts manually, lots of tools support exporting completion scripts for bash, zsh, fish, etc.
command-line applications developed using cobra (GoLang)
docker completion fish > ~/.config/fish/completions/docker.fish
icon completion fish > ~/.config/fish/completions/icon.fish
crazy-complete helps generate completion scripts based on YAML defined completion rules.