background preloader

Sublime

Facebook Twitter

TmTheme Editor. Sublime Text tutorial for use with rails and rspec on mac - Übergeek UnLtd. While the world did not end yesterday, my subscription to Rubymine and Textmate both expired. And they will probably not be renewed since I made a new friend: Sublime Text. For the past few days I have been busy switching. This post is all my wisdom on setting up Sublime Text code editor (well, IDE?)

On mac osx with special attention to use it with ruby and rails. Install package control After installing Sublime, first thing is to install package control, which allows you to manage Sublime extensions as well as takes care of automatic updates of add-ons. Now you manage packages via the command palette (cmd+shift+P) > package control or via Sublime > Preferences > package control.

Some of the must-have packages: Soda theme. this is the hypest theme clearly, most webcasters use it. Sublime Text 2 stores all under ~/Library/Application Support/Sublime Text 2. Here is the full list of my custom packages so far: Mine looks like this: Here is another example. Console opens with Ctrl+backtick. Basic Concepts — Sublime Text Help. Snippets — Sublime Text Help.

Whether you are coding or writing the next vampire best-seller, you’re likely to need certain short fragments of text again and again. Use snippets to save yourself tedious typing. Snippets are smart templates that will insert text for you and adapt it to their context. To create a new snippet, select Tools | New Snippet….

Sublime Text will present you with an skeleton for a new snippet. Snippets can be stored under any package’s folder, but to keep it simple while you’re learning, you can save them to your Packages/User folder. Snippets File Format Snippets typically live in a Sublime Text package. The structure of a typical snippet is as follows (including the default hints Sublime Text inserts for your convenience): <snippet><content><! The snippet element contains all the information Sublime Text needs in order to know what to insert, whether to insert it and when.

Content The actual snippet. Keep the following in mind when writing your own snippets: tabTrigger scope description Note Fields i g m. How to Create a Sublime Text 2 Plugin. An Editor You Will Regret You Haven’t Used Before (and Tips on Getting the Most out of it) ← o2.js. Textmate vs Sublime 2 - Phx Tag Soup. Day 10 of the 30 Day Writing Challenge I love, and I mean LOVE TextMate. It was my baby up until this year.

TextMate did some amazing things, but their lack of updates started to wear on me. I had seen a few friends starting to use Sublime Text 2 and, at first, totally ignored their praise of the product. I thought, there’s NOTHING Sublime is doing that TextMate (TM) isn’t. So, it took about a month from the time I saw Sublime, to the time I gave it a try. Works on all platforms TextMate: OSX Only Sublime: OSX, Linux, Windows Clear choice there. Selecting Lines of Code TextMate: cmd-shift-L Sublime: cmd-L I don’t think I need to explain what this keystroke is doing. Moving lines of code up and down Sublime and TextMate: cmd+ctrl up and down arrows There are some subtle differences in the two though, so read on.

TextMate: When you have an entire line selected (cmd-L), it will move the line up or down one line at a time. Wrapping the guts TextMate: cmd-shift-w Sublime: cmd-shift-w Multiple Cursors. How do I setup/use ruby on rails snippets and autocomplete in sublime text 2. Getting Started with Sublime Text 2 - opensoul.org. I recently switched to Sublime Text 2 from TextMate. I did not love it at first. As it goes with many of the finer things in life, Sublime is an acquired taste. It was not until I paired with a coworker for a few days that I really started to see its power. I have been using it since and have not looked back. Here are a few tips that made it easier for me to get into it. Command palette Think of the command palette as Alfred for your code editor. Package Control If you feel like something is missing from Sublime, then there is probably a plugin for it.

To use package control, press ⌘⇧P to bring up the command palette, begin to type “install”, and select “ Package Control: Install Package ”. Beat the ugly out of it I cannot figure out a nice way to say this, so I will just say it: out of the box, Sublime is hideous. Update: The new default theme is actually much better. Start by installing the Soda UI theme via Package Control. Ahh, that is better. Ok, now we can stand to look at it. Sublime Text Packages by the Community – wbond. Sublime Text 2 for Ruby. Matz has said he wants Ruby to be the “80% language”, the ideal tool for 80% of software development. After switching from TextMate to Sublime Text 2 (ST2) a few months ago, I believe it’s the “80% editor”.

You should switch to it, especially if you’re using TextMate. Why Sublime Text 2? Speed. It’s got the responsiveness of Vim/Emacs but in a full GUI environment. It doesn’t freeze/beachball. Getting Started I’ve helped a handful of new ST2 users get setup over the past few months. Install the subl command line tool. Leveling Up with Custom Commands Sublime Text 2 makes it dead simple to write your own commands and key bindings in Python. Copy the path of the current file to the clipboard. New key bindings are installed by dropping Python class files in ~/Library/Application Support/Sublime Text 2/Packages/User and then binding them from Default (OSX).sublime-keymap in the same directory.

Running RSpec from Sublime Text 2 This is my favorite part of my Sublime Text 2 config. More Resources. Sublime Text 2: Tips for moving over. I’m a long time Coda user. A few months ago I, like everyone else, decided to switch over to vim. I really liked Vim but just couldn’t get the hang of it for whatever reason. After shamefully crawling back to Coda, I found myself realizing that Coda fell short in a few areas. It was then I decided to give Sublime Text 2 a shot as it had been touted as the sucessor to Text Mate. 1. If you do a lot of work in bash, its helpful to open up a file or entire folder in your editor right from the command line. To Install: Run the following line in your terminal.sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl This will then give you access to the bash command subl with a number of arguments.

The most basic usage is to open the current folder in Sublime Text 2. Subl -ab tutorial.html opens the file tutorial.html in the current window but keeps terminal in focus. 2. This was one of the biggest annoyances for me when switching over from coda. 3. 4. 5. Using Sublime Text 2 with Ruby on Rails. Mrmartineau/SublimeTextSetup. Sublime Text 2 Tips and Tricks (Updated) Sublime Text 2 is one of the fastest and most incredible code editors to be released in a long time! With a community and plugin ecosystem as passionate as this one, it just might be impossible for any other editor to catch up. I'll show you my favorite tips and tricks today.

Sublime Text 2 is currently available for all major platforms: OS X, Linux and Windows. 1 - Bleeding Edge Versions Sublime is in active development. Download a dev build of Sublime 2 here. 2 - Get a Better Icon Update: here is a better icon. In its defense, Sublime Text 2 is still in a beta state. To integrate it, you need to replace the existing "Sublime Text 2.icns" file with this new one. Please take note of the fact that, if you're using the frequently updated development version of Sublime Text, with each update, the icon will be removed. 3 - Access the Command Palette Similar to TextMate, we can use Sublime's command palette by accessing the Tools menu, or by pressing Shift + Command + P, on the Mac. 8 - Alignment.

Sublime Text Unofficial Documentation — Sublime Text Unofficial Documentation. Color Theme Generator - TextMate/Emacs/Vim. Gcollazo/BrowserRefresh-Sublime. Noklesta/SublimeQuickFileCreator. Kemayo/sublime-text-2-goto-documentation. Kemayo/sublime-text-2-clipboard-history. Sublime 2 Plugins that I found useful in RoR developement. RubyTest plugin Sublime Text 2 plugin for running ruby tests! (Unit, RSpec, Cucumber) Package Control A full-featured package manager Ctags Easy and fast navigation between code definition DetectSyntax Detect the syntax of files that might not be detected properly (detects rails files which allows to use proper and powerful snippets) Git Plugin for some git integration into Sublime Txt 2 ERB Insert and Toggle Commands TextMate Style ERB Block for Sublime Text (<%= %>, <% %>..) Rails Related Files Sublime Text 2 Ruby on Rails Related Files (allows you to easily navigate your Rails projects) Clipboard History Clipboard history plugin for Sublime Text 2 Cucumber Cucumber syntax & snippets.

Emmet