Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on the Fish Shell

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips & Traps

  1. 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 -ic

Key Bindings

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.

Completions

  1. The built-in fish function fish_update_completions updates completions using manual pages.

  2. 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
  3. crazy-complete helps generate completion scripts based on YAML defined completion rules.

Comments