Sublime Forum

New to Sublime.. Font and Font Color Customization

#1

I’m currently using Notepad++ for batch files and AutoIt scripts. I’m able to easily customize colors and font/font styles to my liking for any programming language (example below). However, with Sublime; I dont see any way to change fonts and font colors (based on commands, variables, etc). I can only change to predefined themes. Am I missing something? I tried searching for a Sublime package that integrates this kind of customization functionality; but didn’t see anything like that. I did find the online tool http://tmtheme-editor.herokuapp.com; which I’m not sure what it does; but, that’s not compatible with either Firefox or Internet Explorer (I use both). I also tried Sublime 3 beta; but that didn’t have this functionality either.

0 Likes

#2

Sublime’s colouring and theming system (including syntax colouring) is designed to be compatible with TextMate. Like TextMate, there is no built in interactive system for playing around with colours, fonts and themes. The benefit is that this theming system is mature, well supported and powerful - since tmThemes allow colours to be applied within particular scopes, which themselves can be defined cleverly with regular expressions.

Configuration of sublime is done through JSON files, except textmate themes which are XML files. There are no interactive dialogs and whatnot. In the beginning this might seem counterintuitive but in time you’ll probably see the benefits of this approach.

The link you mention is a web-based JS theme editor that will generate a tmTheme XML file for you. All you need to do is download the file, drop it in to your Data/Packages/User folder. Then edit your user preferences (menu Preferences…Settings User) and add this line inside the {}

"color_scheme": "Packages/User/YourThemeFile.tmTheme",

You’ll need to remove the trailing , if it’s the last line before the closing }

Save the preferences file and watch your colours change.

Of course, you can edit/create tmTheme files by hand if you wish, though the tmTheming system is quite complicated. The online tmtheme editor has a bunch of nice “base themes” which you can customise, probably the easiest way to roll your own. Personally I like dark themes, and run a slightly customised version of Base16-Tomorrow, which can be installed with package control and has dark and light variants.

Changing font is just a case of editing another user pref… As before:

"font_face": "YourChosenFontName",

Font size is global in sublime and can be changed with Ctrl+Mousewheel or Ctrl+KeypadPlus/Minus.

If you want to poke about other settings, take a look at Preferences…Settings Default. Nearly all are in there and they’re documented. However I’d advise not changing these Defaults, simply copy any lines over to your User Prefs file and modify them there.

:smile:

0 Likes

#3

Thanks. You’re right, I dont really see the benefits of not including native color/font control. :smile: I’ve actually never heard of textmate. From what I found on google, it looks like a apple’s version of Notepad.exe.

I took the time to download a portable version of Google Chrome. just to use the Online based theme editor; which helped me identify the colors; and, choose the colors I wanted. The good news is I wont need to go through this again, since I was able to get the colors to suit my taste.

Thanks again for taking the time to help me.
MKANET

0 Likes