ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

fish

by Phidica ST2/ST3

A robust Sublime Text syntax package for fish

Details

  • 3 3.0.0
    2.5.0
  • github.​com
  • github.​com
  • 3 weeks ago
  • 3 hours ago
  • 7 years ago

Installs

  • Total 9K
  • Win 830
  • OS X 6K
  • Linux 3K
Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30
Windows 0 2 1 0 0 0 1 0 0 1 0 1 0 0 2 0 0 0 2 0 2 1 0 0 0 0 2 0 0 1 0 1 0 0 0 0 0 0 0 1 1 1 0 1 0 1
OS X 4 5 7 4 0 0 3 2 3 4 3 4 1 4 3 0 4 8 2 2 3 1 2 3 4 4 0 2 3 5 2 3 2 1 4 4 2 6 4 2 1 0 1 1 4 2
Linux 0 1 1 1 1 2 1 1 1 0 1 0 0 3 2 0 1 2 1 1 1 0 1 0 1 4 0 1 1 3 1 0 0 5 0 1 0 2 1 2 0 0 1 2 1 0

Readme

Source
raw.​githubusercontent.​com

Friendly Interactive Shell (fish)

A Sublime Text 2/3 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: 3.0

Note: ST2 support is capped at fish version 2.7, with a limited set of the following features.

Features

  • Snippets for common constructs.
  • Extensive syntax highlighting:
  • Indent and prettify: Reformat the active file with fish_indent:
    • Use ctrl+alt+i or your build system shortcut (eg, ctrl+b).
    • Optional setting to run automatically when file is saved.

Installation

Via Package Control

Install Package Control, then go to Command Palette (Ctrl+Shift+P) > Package Control: Install Package > fish.

Manual

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 “Friendly Interactive Shell (fish)”.

Screenshots

As of release 3.0.0, a fish script (for example, fish-shell/share/functions/ls.fish) will look something like:

Screenshot of text in Monokai

Figure 1: Default Monokai colour scheme

Screenshot of text in custom Monokai

Figure 2: Example custom Monokai colour scheme formatting additional scopes

Exposed 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}
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

Branches and releases

ST2 support and ST3 support is separated between two branches:

  • st2: Plugins only compatible with ST2, syntax uses tmLanguage scheme, and provides highlighting for fish 2.7 only.
  • master: Plugins only compatible with ST3, syntax uses sublime-syntax scheme, and provides highlighting up to the currently supported version of fish.

The 2.x.x series of releases (on both ST support branches) only support fish 2.7.

The 3.x.x series of releases (on the master branch alone) includes support for fish 3.0 and beyond.

Contribution

Requirements:

  • PackageDev, only for ST2 development and changing the 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.

History

This project was forked from original groundwork laid by toru hamaguchi.