Jeff Cook
Jeff Cook

Reputation: 8774

Sublime Text 3 doesnot show color scheme when opened Visualforce page

I am using Sublime Text-3 version 3.0 build 3143. I have connected to Salesforce using MavensMate and opened the VF Page, but dont see any color when Opened the VisualForce Page in Sublime Text. How to fixed this issue ??

enter image description here

Upvotes: 0

Views: 731

Answers (1)

OdatNurd
OdatNurd

Reputation: 22791

VisualForce isn't something that Sublime supports out of the box, so in order to have things like syntax highlighting, you'll need to install a package that adds that support in.

The de-facto repository of third party add-on packages is Package Control, and doing a search reveals that there is a VisualForce package available.

The description for the package mentions that it provides syntax highlighting for .page files. Assuming that's the kind of file you're trying to open (I'm not familiar with VisualForce at all), this is probably what you want.

In particular, the content represented in your image appears like the following for me once this package is installed (except that I have elided what appears to be an extraneous </apex:outputText> after the email_us label):

Sample VisualForce Highlighting

For what it's worth, the package also includes completions to make creating such files easier.

Since you mentioned in comments that you're a little unclear on the process, here's a step by step set of instructions on how to get set up for this with Sublime Text 3143.

  1. If you haven't already done so, you need to install Package Control. If it's not installed, the commands in the next step won't be available.

    There are official installation instructions for this, but in your build of Sublime Text you can also select Tools > Install Package Control... from the menu or Install Package Control from the Command Palette in order to do the same thing.

    If that menu item is not visible in your menu/command palette, then Package Control is already installed; the command is hidden if it's not needed.

  2. Open the Command Palette with Tools > Command Palette or the appropriate key binding for your operation system (visible in that menu entry), then select the command Package Control: Install Package.

    This will download the list of all packages and present them to you in a list; it may take a moment to download the whole thing. You'll see a spinner in the status line of the window to tell you the operation is in progress.

  3. When the list of packages appears, select the VisualForce package from the list of packages; you can find it quicker by entering visual to filter the package list down.

Once this is done, the package will be installed; during the installation there will be a spinner in the status line to tell you, and the status line will briefly say that the package was installed once it's done, but it goes quick so if you blink you might miss it.

With the package now installed, you should be able to close your file and open it again to have the appropriate syntax applied to it.

You can also select Set Syntax: VisualForce from the command palette or select View > Syntax > VisualForce from the menu in order to manually set the syntax in the current file to the VisualForce syntax.

You'll need to do this for example when you create a new file since the default syntax is Plain Text and the appropriate syntax won't get set until you save the file with an appropriate extension first otherwise.

Upvotes: 1

Related Questions