Sublime Forum

Create my own syntax theme

#1

Hello,

I wish used ST3 for written my note regarding to Swift (I am new in the development word).
So, I would like to create my own “syntax theme” with few rules :
1/ if line start with a point : color black and size 15
2/ if line start with a / : color red and Bold
3/ if line start with…

What are your advice to do it ? and also a quick process… to do it :wink:

Thanks a lot

0 Likes

#2

https://www.sublimetext.com/docs/3/syntax.html

2 Likes

#3

It is very complex for me…
i have tried to find solution but I just understand I need :
1/ create a new syntax (.tmLanguage)
2/ create new color-scheme

Perhaps, somebody in this forum have already created it : a simple syntax mainly used for .txt files (plain text) where there are 3 difference style : main, bold and red

KR

0 Likes

#4

Try these links:

  1. https://www.sublimetext.com/docs/3/scope_naming.html
  2. http://docs.sublimetext.info/en/latest/extensibility/syntaxdefs.html
  3. Creating Syntax Definitions Tutorial
  4. http://www.siltutorials.com/sublime-text-syntax-tutorial/
  5. http://ilkinulas.github.io/programming/2016/02/05/sublime-text-syntax-highlighting.html

If think it is too difficult create syntax for Sublime Text, give a look into how it is done for Visual Studio Code. May be it is easier for you to learn:

  1. https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
  2. https://code.visualstudio.com/api/extension-capabilities/theming
  3. https://code.visualstudio.com/blogs/2017/02/08/syntax-highlighting-optimizations
  4. https://stackoverflow.com/questions/38148857/customizing-syntax-highlighting-in-visual-studio-code
  5. https://stackoverflow.com/questions/29973619/how-to-make-vs-code-to-treat-other-file-extensions-as-certain-language
  6. https://stackoverflow.com/questions/43456813/creating-visual-studio-code-extension-for-syntax-highlighting-of-a-custom-langua
0 Likes