Fish

Install

Install fish via homebrew

brew install fish

Set fish as default shell

echo /usr/local/bin/fish | sudo tee -a /etc/shells
sudo chsh -s $(which fish) $(whoami)

Default fish config folder location

~/.config/fish

Completions

Update man page completions

fish_update_completions

Functions

List available fish functions

functions

Show source for specific function (type provides syntax highlighting)

List Builtin function names

Environment

Set environment variable for command

Abbreviations

Add (-a) global (-g) abbreviation

Add (-a) global (-g) abbreviation and set cursor position

List full abbreviations or abbreviation names

Remove abbreviation

Rename abbreviation

Command History

Show all command history items

Clear all command history items

Limit history results (show count most recent entries, eg. -5 five entries)

Include timestamp of command in history output

Show history matching filter and string criteria (optionally limit to -n results)

Delete history matching filter and string criteria

History result filters

Set filter string to be case sensitive

List history entries that contain the specified string

Delete history entries that contain the specified string

Search command history from string using grep

Directory Navigation

Cycle through previous and next visited directories

Show the ordered directory history available to prevd and nextd

Show numbered list of recent directories to allow jumping to specified directory

Private Mode

Use private mode for running commands with tokens or other context that should not be persisted to history

String Functions

Search and replace string content (-r for regex)

Keyboard Shortcuts

Directory Navigation

Cycle through prevd and nextd entries (when command empty)

List directory history (when current command is empty)

Run ls for current directory

Command Completion

Show completions for current token (command, attribute or path)

Show completions with search filter for current token

Accept displayed autosuggestion

Cycle through previous commands using current input

Show searchable command history (using current command is filter)

Cycle through older and newer commands in searchable command history

Command Editing

Clear (or halt) current command

Move the cursor to the beginning or end of the current command

Move cursor by one word within current command

Move cursor by one word (ignoring punctuation) within current command

Delete one character to the right of the cursor

Delete from the beginning of the line to the cursor

Delete from the cursor to the end of the command

Delete one path component

Add new line to command at current cursor position

Helpers

Print short help description for command at cursor

Show man page for current command

Add pipe to less pager for current command

Open file name at cursor in less pager

Append sudo to current command

Edit current command in external editor (set via $VISUAL and $EDITOR variables)

Utilities

Output performance timings for fish shell startup

Last updated