Sublime Text

I am writing this blog out of my experience to share the key details of the different IDEs I have used while programming in Force.com environment. This might help an experienced or newbie developer in choosing the right IDE to code. Sublime Text is a sophisticated text editor for code, markup and prose. You’ll love the slick user interface, extraordinary features and amazing performance.We are familiar with the Force.com IDE which is based on the Eclipse platform which we use to code, compile, test, package and deploy Salesforce projects. Today we can look forward to another cool tool for Salesforce Developers – MavensMate. It is a powerful open source tool for building Force.com IDEs. It helps us to develop Salesforce applications easily regardless of the platform or text editor. Most of us are using the beloved Sublime Text for coding our projects.

My favorite and most probably every programmers most loved IDE. Eclipse is famous as a Java Integrated Development Environment (IDE). Salesforce You can easily combine language support and other features into any of our default packages, and the Eclipse Marketplace allows for virtually unlimited customization and extension. Eclipse give a feel of traditional desktop based programming from developer end and in back end it saves all in Salesforce Cloud.

Let’s see how to integrate MavensMate with Sublime Text to make it a powerful development environment like (or better than) the Force.com IDE.

sublimeWhat Sublime Text can do Go to Anything

Use Go to Anything to open files with only a few keystrokes, and instantly jump to symbols, lines or words.

Triggered with Ctrl+P, it is possible to:

  • Type part of a file name to open it.
  • Type @ to jump to symbols, # to search within the file, and : to go to a line number.

These shortcuts can be combined, so tp@rf may take you to a function read_file within a file text_parser.py. Similarly, tp:100 would take you to line 100 of the same file.

MultipleSelectionButtonMultiple Selections:

Make ten changes at the same time, not one change ten times. Multiple selections allow you to interactively change many lines at once, rename variables with ease, and manipulate files faster than ever.Try pressing Ctrl+Shift+L to split the selection into lines and Ctrl+D to select the next occurrence of the selected word. To make multiple selections with the mouse, take a look at the Column Selection documentation.

comm_pallCommand Pallette:

The Command Palette holds infrequently used functionality, like sorting, changing the syntax and changing the indentation settings. With just a few keystrokes, you can search for what you want, without ever having to navigate through the menus or remember obscure key bindings.Show the Command Palette with Ctrl+Shift+P.

command-palette

Command-Pallette

dfmDistraction Free Mode:

When you need to focus, Distraction Free Mode is there to help you out. Distraction Free Mode is full screen, chrome free editing, with nothing but your text in the center of the screen. You can incrementally show elements of the UI, such as tabs and the find panel, as you need them. You can enter Distraction Free Mode using the View/Enter Distraction Free Mode menu.

projInstant Project Switch:

Projects in Sublime Text capture the full contents of the workspace, including modified and unsaved files. You can switch between projects in a manner similar to Goto Anything, and the switch is instant, with no save prompts ­ all your modifications will be restored next time the project is opened.

pluginPlugin API:

Sublime Text has a powerful, Python based plugin API. Along with the API, it comes with a built in Python console to interactively experiment in real time.

cross-platform-iconCross Platform:

Sublime Text is available for OS X, Windows and Linux. One license is all you need to use Sublime Text on every computer you own, no matter what operating system it uses.

featuresLatest Features

  • Added new Syntax Definition file format, .sublime ­syntax.
  • Added a custom regex engine that matches multiple regexps in parallel, for faster file loading and indexing.
  • Improved Unicode support, including combining character rendering, character classification in regex searches, and case insensitivity in Goto Anything matching.
  • Packages are now on GitHub.
  • Incorporates many community provided improvements to the above packages, with significant improvements to HTML, CSS, JavaScript, Go, D and SQL.
  • Added Panel Switcher to status bar.
  • Better handling of troublesome files during indexing.
  • Improved file change detection.
  • Added “Profile Events” to the Command Palette, to help identify slow plugins.
  • Build Systems may now define a list of file name wildcard patterns to trigger on, via the file_patterns .key prompt_open_file and related commands now accept an initial_directoryargument.
  • Improved indenting behavior when indent_to_bracket is enabled.
  • Spell Checker now reads from manually edited user preferences on the fly.
  • Stability improvements for Find in Files when using regular expressions that result in significant backtracking.
  • Fixed file truncation when using hexadecimal encoding.
  • Fixed brackets in strings influencing auto indent.
  • Fixed inconsistencies in Goto Anything when selecting symbols.
  • Fixed tab completion regression in 3081, where h1..h6 HTML completions were not triggering.
  • Fixed Goto Definition command not working when placed in a submenu.
  • OSX: Fixed Emoji & Symbols popup failing to insert text in some cases.
  • Windows: Added support for inserting characters from outside of the BMP.
  • Windows: ctrl+alt+p is no longer bound by default, due to compatibility issues with some keyboard layouts.
  • Windows: Updated code signing certificate to no longer use SHA1.
  • Linux: Fixed a file permission issue when running without ­­wait.
  • Linux: crash_reporter is statically linked, improving system compatibility.
  • API: Added Window.is_sidebar_visible() and Window.set_sidebar_visible().
  • API: Added View.is_auto_complete_visible().
  • API: Added find_output_panel(), destroy_output_panel(), active_panel() and panels().
  • API: Added create_output_panel() now accepts an optional parameter,”unlisted”.

configDownload and Installation

If you don’t already have Sublime Text 3, download it from http://www.sublimetext.com/3 . Now we need to

           install the Sublime Text Package Control.

          Open Sublime Text, and open console from View ­> Show Console.

ecl8

Now copy the python code appropriate for your Sublime version from https://sublime.wbond.net/installation and paste it on the console.You may need to restart Sublime Text for completing the installation.

Now go to Preferences­>Package Control.

ecl9

Enter Install Package and select it.

A list of available packages will be displayed.

ecl11

Search for MavensMate and hit Enter.MavensMate will get installed and a welcome text will be displayed in the editor. You will also get a new MavensMate menu!

ecl12

Creating a New Project:

Now it’s time to create a new project and download metadata from our Salesforce org to MavensMate.Before creating a project, you have to specify the path to your workspace folder where you will be storing the project files. Just open MavensMate ­> Settings ­> User and search for mm_workspace. Enter the absolute path to your workspace folder (Eg: “mm_workspace” :“E:\\MavensmateWorkspace “) and save the settings file.

Now we can create our project by going to MavensMate ­> Project ­> New Project.

ecl13

A browser window will open where you need to specify your Salesforce credentials. The Advanced tab allows you to customize the metadata subscription list and the Project. Metadata tab allows you to choose the components to be downloaded.

Img_1

Choose your preferences and click Create Project.

MavensMate will download the specified metadata components from the salesforce org. After completing this process, the project will load in Sublime.

Img2

Now you can develop your salesforce app inside MavensMate IDE. It works faster than Eclipse and deploy the components directly to the org. We can create Apex classes, Triggers, Pages and Components. Syntax highlighting and code completion features is very useful during application development. We can perform Apex testing, compilation and debugging directly from MavensMate.

ecl16

After development, we can validate and deploy our application to the Salesforce org.  Reference http://mavensmate.com/Getting_Started/Users


Author: AJ

Share This Post On

1 Comment

  1. Thank you for sharing such a nice and interesting blog with us. i have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle. please keep on updates. hope it might be much useful for us. keep on updating…

    Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *