Sublime Forum

How do I remove syntax highlighting but keep language settings?

#1

When I open some.rb and go to Sublime Text -> Preference -> Settings - Syntax Specific I find the following in my Ruby.sublime-settings file

// These settings override both User and Default settings for the Ruby syntax
{
    "tab_size": 2,
    "translate_tabs_to_spaces": true,
    "auto_indent": false,
}

When I open some.txt I find the following in my Plain text.sublime-settings file

// These settings override both User and Default settings for the Plain text syntax
{
    "tab_size": 8,
}

In both on the left pane I see Preferences.sublime-settings with the following config option

{
    // Sets the colors used within the text area
    "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
...

So it seems like both have the same color settings. However for plain text there are no colors and for ruby there are colors. Shown in the figure below:

I’d like to be able to keep the language settings about indentation, code completion, build system, etc for Ruby but I want to turn the colors off.

How do I turn the colors off for a language?

In the past my strategy has been to simply ignore all the packages; however, then I lose the ability to change indention settings and others mentioned above. Shown in my Preferences.sublime-settings - User file

{
	"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
	"font_size": 15,
	"ignored_packages":
	[
		"Vintage",
		"ASP",
		"ActionScript",
		"AppleScript",
		"Batch File",
		"C#",
		"C++",
		"CSS",
		"Clojure",
		"D",
		"Default",
		"Diff",
		"Erlang",
		"Go",
		"Graphviz",
		"Groovy",
		"HTML",
		"Haskell",
		"Java",
		"JavaScript",
		"LaTeX",
		"Lisp",
		"Lua",
		"Makefile",
		"Markdown",
		"Matlab",
		"OCaml",
		"Objective-C",
		"PHP",
		"Pascal",
		"Perl",
		"Python",
		"R",
		"Rails",
		"RestructuredText",
		"Rust",
		"SQL",
		"Scala",
		"ShellScript",
		"TCL",
		"Textile",
		"XML",
		"YAML"
	],
	"save_on_focus_lost": true,
	"scroll_past_end": true,
	"word_wrap": false
}
0 Likes

#2

You just need to define an “empty” color-scheme:

Save the following as empty.tmTheme in your user package directory and it should appear in your list of color scheme.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>name</key>
	<string>Empty</string>
	<key>settings</key>
	<array>
		<dict>
			<key>settings</key>
			<dict>
				<key>background</key>
				<string>#000000</string>
				<key>caret</key>
				<string>#A7A7A7</string>
				<key>foreground</key>
				<string>#F8F8F8</string>
				<key>invisibles</key>
				<string>#CAE2FB3D</string>
				<key>lineHighlight</key>
				<string>#FFFFFF38</string>
				<key>selection</key>
				<string>#DDF0FF60</string>
				<key>inactiveSelection</key>
				<string>#DDF0FF38</string>
				<key>bracketsForeground</key>
				<string>#FFFFFFFF</string>
			</dict>
		</dict>
	</array>
</dict>
</plist>

You might have to adjust the basic color to your taste :wink:

1 Like

#3

Thank you for the help @Clams!

I found the Monokai.tmTheme at:

I removed all the elements in the <array> except the first one, named the file min.tmTheme, and placed it at:

~/Library/Application Support/Sublime Text 3/Packages/User/min.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>name</key>
	<string>Monokai</string>
	<key>settings</key>
	<array>
		<dict>
			<key>settings</key>
			<dict>
				<key>background</key>
				<string>#272822</string>
				<key>caret</key>
				<string>#F8F8F0</string>
				<key>foreground</key>
				<string>#F8F8F2</string>
				<key>invisibles</key>
				<string>#3B3A32</string>
				<key>lineHighlight</key>
				<string>#3E3D32</string>
				<key>selection</key>
				<string>#49483E</string>
				<key>findHighlight</key>
				<string>#FFE792</string>
				<key>findHighlightForeground</key>
				<string>#000000</string>
				<key>selectionBorder</key>
				<string>#222218</string>
				<key>activeGuide</key>
				<string>#9D550FB0</string>

				<key>bracketsForeground</key>
				<string>#F8F8F2A5</string>
				<key>bracketsOptions</key>
				<string>underline</string>

				<key>bracketContentsForeground</key>
				<string>#F8F8F2A5</string>
				<key>bracketContentsOptions</key>
				<string>underline</string>

				<key>tagsOptions</key>
				<string>stippled_underline</string>
			</dict>
		</dict>
	</array>
	<key>uuid</key>
	<string>D8D5E82E-3D5B-46B5-B38E-8C841C21347D</string>
</dict>
</plist>

And I updated my Ruby specific settings as shown:

~/Library/Application Support/Sublime Text 3/Packages/User/Ruby.sublime-settings
{
    "color_scheme": "Packages/User/min.tmTheme",
    "tab_size": 2,
    "translate_tabs_to_spaces": true,
    "auto_indent": false,
}

0 Likes