Fish#
The friendly interactive shell. Fish ships its own line editor
(not readline), with syntax highlighting, autosuggestions, and
abbreviation expansion enabled by default. Most readline-style
emacs bindings still work because fish reuses the conventions;
the differences are in suggestion-acceptance keys, the history
pager, and fish-only widgets like prepend-sudo and
edit-command-buffer.
Switch to vi-style editing with fish_vi_key_bindings; revert
with fish_default_key_bindings. bind with no arguments
lists every active binding; bind --list-modes lists keymaps.
fish_config opens the web UI; funced <name> edits a
function in $EDITOR.
For shell startup files, universal variables, and abbreviation
configuration, see the fish documentation at
https://fishshell.com/docs/current/.
Cursor Movement#
Key |
Action |
|---|---|
|
move to start of line ( |
|
move to end of line ( |
|
move back one character |
|
accept autosuggestion (or move forward if none) |
|
move back one word |
|
move forward one word |
|
move back one path component |
|
move forward one path component |
Autosuggestions#
Fish shows the most likely completion in dim grey as you type. Acceptance is the headline keybinding.
Key |
Action |
|---|---|
|
accept entire autosuggestion |
|
accept entire autosuggestion (same as Right) |
|
accept next word of autosuggestion |
|
accept next word of autosuggestion |
|
dismiss current autosuggestion |
Editing#
Key |
Action |
|---|---|
|
delete character under cursor (EOF on empty line) |
|
delete character before cursor |
|
delete character before cursor |
|
delete word forward |
|
delete word backward (whitespace-delimited) |
|
delete word backward (alphanumeric-aware) |
|
kill (cut) to end of line |
|
kill from cursor to start of line |
|
yank (paste) last killed text |
|
rotate to previous kill after Ctrl-y |
|
transpose character with previous |
|
transpose word with previous |
|
uppercase word from cursor |
|
lowercase word from cursor |
|
capitalize word from cursor |
|
undo last edit |
|
redo (after undo) |
History#
Up / Down search history with the current line as a prefix.
Ctrl-r opens the searchable history pager.
Key |
Action |
|---|---|
|
previous matching history entry (prefix search) |
|
next matching history entry |
|
open history pager (searchable) |
|
move to previous token in history |
|
move to next token in history |
|
insert last argument of previous command |
|
print full history |
|
search history non-interactively |
|
delete a history entry |
|
merge in writes from other fish sessions |
Process Control#
Key |
Action |
|---|---|
|
cancel current line / send SIGINT to foreground |
|
suspend foreground process (SIGTSTP) |
|
send EOF; exit shell on empty line |
|
clear screen (keeps current line) |
|
pause terminal output (XOFF) |
|
resume terminal output (XON) |
|
send SIGQUIT (core dump) |
Completion#
Tab cycles through completions inline; if there are many, the
pager opens. Inside the pager use arrow keys; Enter accepts,
Esc cancels.
Key |
Action |
|---|---|
|
complete / cycle next match (opens pager if many) |
|
cycle previous match |
|
close completion pager without selecting |
|
close pager without selecting |
|
accept the highlighted completion |
|
scroll the pager |
|
search next within pager |
|
search previous within pager |
Fish Specials#
Widgets and bindings unique to fish.
Key |
Action |
|---|---|
|
prepend |
|
edit current command in |
|
run |
|
run |
|
append |
|
history-pager-delete on current entry (in pager) |
|
cut current line to the kill ring (whole-line cut) |
|
insert |
Vi Mode#
Enable with fish_vi_key_bindings. Two main modes: insert
(default after enable) and default (Vim “normal”); visual
adds selection. Esc exits insert to default.
Key |
Action |
|---|---|
|
enter default (command) mode |
|
insert at cursor |
|
append after cursor |
|
append at end of line |
|
insert at start of line |
|
move to start / first non-blank |
|
move to end of line |
|
word forward / back / end |
|
find next / previous |
|
delete character under cursor |
|
delete word / to end / whole line |
|
change word / to end / whole line |
|
yank word / to end / whole line |
|
paste after / before cursor |
|
undo |
|
enter visual mode |
|
linewise visual mode |
|
previous / next history line (in default mode) |
|
search history backward / forward |
Config and Discovery#
Command |
Action |
|---|---|
|
list every active binding |
|
list keymap modes ( |
|
bind a key in a specific mode |
|
bind Ctrl-x to a named function |
|
remove a binding |
|
revert to emacs-style bindings |
|
switch to vi-style bindings |
|
open the configuration web UI |
|
edit a function in |
|
print a function’s definition |
|
list every defined function |
|
list abbreviations |
|
add an abbreviation |
|
list terminal-driver shortcuts ( |