Site icon R-bloggers

Useful packages for Sublime Text

[This article was first published on The blog of Kun Ren, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Sublime Text is an extremely powerful text editor. Currently I use Sublime Text 3 and quite enjoy its simplicity and extensibility. In this blog, I would like to introduce some of my favorite packages that leverage my productivity.

Package Control

Sublime Text is by default equipped with its package manager: Package Control. If you need to extend the original simple code editor, you can go to View > Show Console and run a block of code provided here according to your version of Sublime Text. Once you install this package manager, the whole world of wonderful packages are open to you.

It is very easy to install a package from the repositories. Just press Ctrl+Alt+P , type Install and you will be directed to Package Control: Install Package command. Now press Enter and you will find a very long list of packages available. Once you choose a package and press Enter again, the package will be downloaded and enabled automatically.

My Settings

You can customize your coding environment by installing packages or just modifying some settings. It is amazing that nearly all change in settings can take effect immediately.

Theme

I use Spacegray theme for my Sublime Text 3. I like its design of simplicity that minimizes possible distraction from your work. To install it, just follow my previous instruction and choose Spacegray package, and modify Preferences > Settings - User by changing or adding "theme": "Spacegray.sublime-theme" to the settings. Once you save the configuration file, the changes will take effect.

Color Scheme

The theme defines how Sublime Text should appear on the screen. But for code editing, it is helpful to set a friendly color scheme that defines how different elements in programming codes should appear on the screen. It defines the color, style of text, etc.

I use Tomorrow Night color scheme. The way of installation is exactly the same. This time, you may choose the installed color scheme in Preferences > Color Scheme > Tomorrow Color Schemes.

Settings

From my personal experience, a good appearance of code editor really improves the quality of my work. For example, an text editor with few colorful elements certainly distracts less than does one with many colorful tabs and buttons; A bunch of code with appropriate syntax highlighting certainly helps more than one with pure black text in white background and more than one with overused colors.

Here is my additional settings I find useful to make a good writing environment:

{
    "caret_style": "solid",
    "_face": "Source Code Pro",
    "_options":
    [
        "subpixel_antialias"
    ],
    "_size": 14,
    "highlight_line": true,
    "line_padding_bottom": 0,
    "line_padding_top": 0,
    "rulers":
    [
        85,
        120
    ],
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": true,
    "wide_caret": true,
    "word_wrap": true,
    "wrap_width": 80
}

Please note that I use Source Code Pro , any you may visit here, choose the latest version of FontsOnly package to download, and extract the OTF or TTF s to the Fonts directory.

In addition, I take out the lines of theme and color scheme in the settings.

Useful Packages

If you intensively use Sublime Text for coding editing, you will probably find these packages very useful:

Building a simple computing environment with a scripting language like R and Python is quite handy. With these packages, you will be able to make Sublime Text more of an IDE than a simple text editor. If you need more functionality, just search the repository. Enjoy it!

To leave a comment for the author, please follow the link and comment on their blog: The blog of Kun Ren.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.