2014-10-05 04:17:46 +00:00
\section abbr abbr - manage fish abbreviations
\subsection abbr-synopsis Synopsis
\fish{synopsis}
abbr -a word="phrase"
abbr -s
abbr -l
2015-05-22 01:48:39 +00:00
abbr -e word
2014-10-05 04:17:46 +00:00
\endfish
\subsection abbr-description Description
`abbr` manipulates the list of abbreviations that fish will expand.
2014-10-07 23:48:22 +00:00
Abbreviations are user-defined character sequences or words that are replaced with longer phrases after they are entered. For example, a frequently-run command such as `git checkout` can be abbreviated to `gco`. After entering `gco` and pressing @key{Space} or @key{Enter}, the full text `git checkout` will appear in the command line.
2014-10-05 04:17:46 +00:00
Abbreviations are stored, by default, in a universal variable.
The following parameters are available:
2014-11-15 15:48:40 +00:00
- `-a WORD PHRASE` or `--add WORD PHRASE` Adds a new abbreviation, where WORD will be expanded to PHRASE.
2014-10-05 04:17:46 +00:00
- `-s` or `--show` Show all abbreviated words and their expanded phrases in a manner suitable for export and import.
- `-l` or `--list` Lists all abbreviated words.
2015-05-22 01:48:39 +00:00
- `-e WORD` or `--erase WORD` Erase the abbreviation WORD.
2014-10-05 04:17:46 +00:00
\subsection abbr-example Examples
\fish
2014-11-15 15:48:40 +00:00
abbr -a gco git checkout
2014-10-05 04:17:46 +00:00
\endfish
Add a new abbreviation where `gco` will be replaced with `git checkout`.
\fish
2015-05-22 01:48:39 +00:00
abbr -e gco
2014-10-05 04:17:46 +00:00
\endfish
2015-05-22 01:48:39 +00:00
Erase the `gco` abbreviation.
2014-10-05 04:17:46 +00:00
\fish
ssh another_host abbr -s | source
\endfish
Import the abbreviations defined on another_host over SSH.