A robust Sublime Text syntax package for fish
40
stars
357
commits
Shell
primary language
Jun 14, 2025
updated
A Sublime Text package for the friendly interactive shell. It features a robust syntax highlighting scheme that mimics the native highlighting behaviour of fish.
The package currently supports up to fish version: 4.0
Note: ST3 support will cease in a future release. ST2 support is capped at fish 2.7 with a limited set of the following features.
fish_indent:
ctrl+alt+i or your build system shortcut (eg, ctrl+b).Install Package Control, then go to Command Palette (Ctrl+Shift+P) > Package Control: Install Package > fish.
Clone the repository to your Packages directory and rename it to fish.
cd /path/to/sublime/packages/directory
git clone https://github.com/Phidica/sublime-fish.git
mv sublime-fish fish
Open a .fish file and verify the selected syntax is "Fish".
As of release 3.0.0, a fish script (for example, fish-shell/share/functions/ls.fish) will look something like:

Figure 1: Default Monokai colour scheme

Figure 2: Example custom Monokai colour scheme formatting additional scopes
| fish construct | Scope name |
|---|---|
| Unquoted string | meta.string.unquoted |
| Command name | meta.function-call.name |
| Parameters | meta.function-call.parameter.option/argument |
| File path (in argument) | meta.function-call.parameter.argument.path |
| File path (in redirection) | meta.function-call.operator.redirection.path |
| Redirection | meta.function-call.operator.redirection.{stdin,stdout,stderr}.{explicit,implicit} and keyword.operator.redirect.{truncate,append} |
| Job expansion | meta.function-call.parameter.argument.job-expansion and punctuation.definition.job |
| Process expansion | meta.function-call.parameter.argument.process-expansion and punctuation.definition.process |
| Variable expansion | meta.variable-expansion and punctuation.definition.variable |
| Command substitution | meta.parens.command-substitution and punctuation.section.parens.begin/end |
| Index expansion | meta.brackets.index-expansion and punctuation.section.brackets.begin/end |
| Brace expansion | meta.braces.brace-expansion and punctuation.section.braces.begin/separator/end |
| Wildcard expansion | meta.wildcard-expansion and keyword.operator.question-mark/single-star/double-star |
| Home directory expansion | keyword.operator.tilde |
Support for different ST major versions is separated between several branches:
master: Plugins compatible with ST4, and syntax provides highlighting for fish versions 2.7 and up.st3: Plugins compatible with ST3 and above (via backwards compatibility features), and syntax provides highlighting for fish versions 2.7 and up.st2: Plugins only compatible with ST2, syntax uses the more limited tmLanguage scheme instead of sublime-syntax, and provides highlighting for fish 2.7 only.The particular fish major version supported by a tagged release is indicated by the version number:
st2 and st3) only supports fish 2.7.st3 and master) includes support for fish 3.0 to 3.7.st3 and master) includes support for fish 4.0 and beyond.Requirements:
tmPreferences file.ST2 development: The source file of the syntax is fish.YAML-tmLanguage. When editing this file, "compile" it with the PackageDev build system to automatically generate the fish.tmLanguage file which is used by Sublime Text 2.
ST3+ development: The source file of the syntax is fish.sublime-syntax.
Guide for contributing is located here.
The first Sublime Text fish syntax highlighter was by toru hamaguchi. When that project became unmaintained, @Phidica fully rewrote the schema and replaced the links on Package Control.
Shell
64.0%
Python
36.0%
A robust Sublime Text syntax package for fish
40
stars
357
commits
Shell
primary language
Jun 14, 2025
updated
A Sublime Text package for the friendly interactive shell. It features a robust syntax highlighting scheme that mimics the native highlighting behaviour of fish.
The package currently supports up to fish version: 4.0
Note: ST3 support will cease in a future release. ST2 support is capped at fish 2.7 with a limited set of the following features.
fish_indent:
ctrl+alt+i or your build system shortcut (eg, ctrl+b).Install Package Control, then go to Command Palette (Ctrl+Shift+P) > Package Control: Install Package > fish.
Clone the repository to your Packages directory and rename it to fish.
cd /path/to/sublime/packages/directory
git clone https://github.com/Phidica/sublime-fish.git
mv sublime-fish fish
Open a .fish file and verify the selected syntax is "Fish".
As of release 3.0.0, a fish script (for example, fish-shell/share/functions/ls.fish) will look something like:

Figure 1: Default Monokai colour scheme

Figure 2: Example custom Monokai colour scheme formatting additional scopes
| fish construct | Scope name |
|---|---|
| Unquoted string | meta.string.unquoted |
| Command name | meta.function-call.name |
| Parameters | meta.function-call.parameter.option/argument |
| File path (in argument) | meta.function-call.parameter.argument.path |
| File path (in redirection) | meta.function-call.operator.redirection.path |
| Redirection | meta.function-call.operator.redirection.{stdin,stdout,stderr}.{explicit,implicit} and keyword.operator.redirect.{truncate,append} |
| Job expansion | meta.function-call.parameter.argument.job-expansion and punctuation.definition.job |
| Process expansion | meta.function-call.parameter.argument.process-expansion and punctuation.definition.process |
| Variable expansion | meta.variable-expansion and punctuation.definition.variable |
| Command substitution | meta.parens.command-substitution and punctuation.section.parens.begin/end |
| Index expansion | meta.brackets.index-expansion and punctuation.section.brackets.begin/end |
| Brace expansion | meta.braces.brace-expansion and punctuation.section.braces.begin/separator/end |
| Wildcard expansion | meta.wildcard-expansion and keyword.operator.question-mark/single-star/double-star |
| Home directory expansion | keyword.operator.tilde |
Support for different ST major versions is separated between several branches:
master: Plugins compatible with ST4, and syntax provides highlighting for fish versions 2.7 and up.st3: Plugins compatible with ST3 and above (via backwards compatibility features), and syntax provides highlighting for fish versions 2.7 and up.st2: Plugins only compatible with ST2, syntax uses the more limited tmLanguage scheme instead of sublime-syntax, and provides highlighting for fish 2.7 only.The particular fish major version supported by a tagged release is indicated by the version number:
st2 and st3) only supports fish 2.7.st3 and master) includes support for fish 3.0 to 3.7.st3 and master) includes support for fish 4.0 and beyond.Requirements:
tmPreferences file.ST2 development: The source file of the syntax is fish.YAML-tmLanguage. When editing this file, "compile" it with the PackageDev build system to automatically generate the fish.tmLanguage file which is used by Sublime Text 2.
ST3+ development: The source file of the syntax is fish.sublime-syntax.
Guide for contributing is located here.
The first Sublime Text fish syntax highlighter was by toru hamaguchi. When that project became unmaintained, @Phidica fully rewrote the schema and replaced the links on Package Control.
Shell
64.0%
Python
36.0%