Skip to content

ourovoros-io/sway-sublime-hl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sway Syntax Highlighting for Sublime Text

A custom syntax highlighting plugin for the Sway programming language in Sublime Text. This plugin provides highlighting for Sway's syntax elements, including keywords, types, functions, structs, attributes (e.g., #[storage(read, write)], #[payable]), storage blocks, and more. It includes a tailored Monokai dark color scheme with vibrant colors for better readability.

Features

  • Syntax Highlighting: Covers Sway-specific elements like contract;, storage { ... }, impl ... for ..., asm blocks, and fixed-size strings (str[8]).
  • Custom Scopes: Keywords in magenta, types in cyan, functions in green, fields and parameters in orange, attributes with neon purple brackets, storage and payable in blue, read and write in cyan.
  • Nested Support: Proper highlighting inside structs, storage/configurable blocks, function bodies, and attributes.
  • Theme Integration: A modified Monokai scheme (Sway-Monokai.sublime-color-scheme) optimized for dark mode.
  • File Association: Automatically applies to .sw files.

Installation

Manual Installation (Recommended for Quick Setup)

  1. Open Sublime Text and navigate to your User packages directory:

    • macOS: ~/Library/Application Support/Sublime Text/Packages/User/
    • Windows: %APPDATA%\Sublime Text\Packages\User\
    • Linux: ~/.config/sublime-text/Packages/User/
  2. Create a new folder named Sway (optional, but recommended for organization).

  3. Copy the following files into the folder:

    • Sway.sublime-syntax: The main syntax definition file.
    • Sway-Monokai.sublime-color-scheme: The custom color scheme file.
  4. Restart Sublime Text.

Setup

  1. Select the Color Scheme:

    • Go to Preferences > Color Scheme and choose "Sway-Monokai".
  2. Associate File Extension:

    • Open a .sw file.
    • If not automatically detected, go to View > Syntax > Sway.

License

MIT License. See LICENSE for details.

About

Sway Syntax Highlighting for Sublime Text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages