Skip to content

Instantly share code, notes, and snippets.

@andre-morassut
Last active August 14, 2021 19:48
Show Gist options
  • Save andre-morassut/9428525 to your computer and use it in GitHub Desktop.
Save andre-morassut/9428525 to your computer and use it in GitHub Desktop.
Sublime Text - Text highlighting for writers

Sublime Text - Text highlighting for writers

What is it

A syntax definition for Sublime Text.

Not intened for a programming language but for prose writing. This enables :

  • highlighting for dialogs in a novel
  • Sections and titles highlights
  • Notes highlights

Using it lets you see easily the dialogs in the text flow, moreover with the minimap enabled !

How to use it

Setting up your system

Note : These steps are only necessary if you don't have Package Control and AAAPackageDev installed. If they're already installed, skip to next paragraph.

  • Install Package Control
  • From the command palette, type install and choose package installation
  • Search for "AAAPackageDev", install it.

You may have to restart Sublime Text

Installing the custom syntax highlighting

  1. Copy the romanesque.YAML-tmLanguage in your user directory (Usually under C:\Users\[your-user-name]\AppData\Roaming\Sublime text 3\Packages\User).
  2. Open the copied file with sublime text and build it (F7). *Note : To succeed build, ensure that "automatic" is enabled in Tools > Build System menu. Alternatively, you can choose Convert to... in the same sub-menu and convert the copied file to PList (Property list).
  3. Done. Sublime text will reload the syntax definition.

Licence

Licenced under the Creative Commons Attribution 4.0

# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Romanesque
scopeName: text.romanesque
fileTypes: [roman, nouvelle, histoire, lit, novel, story]
uuid: 2cf9cc36-e358-46d6-bf0c-34bc7ac97fe9
patterns:
- comment: Starting Dialogs - Dialogues avec début
name: string.quoted.double
begin: '- "'
end: '"'
- comment: Inner Dialogs - Dialogues enchâssés
name: string.quoted.double
begin: '"'
end: '"'
- comment: Sections - Début de section
name: constant.other
begin: '___(.*)___'
end: '___(.*)___'
- comment: Sections - Début de section
name: comment.block
begin: '---(.*)---'
end: '---(.*)---'
- comment: Comments - Notes
name: support.class
begin: '\*\*\**\*\*\*'
end: '\*\*\**\*\*\*'
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment