ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Sublime​ERB

by eddorre ST2/ST3

TextMate Style ERB Block for Sublime Text

Details

  • 2014.03.19.06.38.51
  • github.​com
  • github.​com
  • 4 years ago
  • 1 hour ago
  • 6 years ago

Installs

  • Total 44K
  • Win 8K
  • OS X 25K
  • Linux 12K
Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6
Windows 3 2 5 1 4 1 3 4 5 3 5 1 3 3 5 3 3 4 3 3 3 5 2 4 6 2 8 1 4 6 5 5 3 3 6 3 3 5 2 3 7 3 5 4 4 3
OS X 6 7 6 8 2 7 1 7 6 7 3 12 12 4 5 10 11 7 10 11 4 3 2 17 12 15 9 6 9 8 7 9 4 10 5 4 9 10 12 8 2 4 4 5 6 3
Linux 1 6 3 2 5 5 4 2 5 7 4 2 6 2 2 3 5 3 3 7 3 2 5 5 3 15 9 4 0 4 3 10 3 9 2 4 2 6 4 4 4 6 0 5 5 4

Readme

Source
raw.​githubusercontent.​com

A Port of TextMate's ERB support for Sublime Text 2

Installation

Sublime Package Control

I suggest using Sublime Package Control. Once you have Sublime Package control installed, you can install “SublimeERB” in a few easy steps.

Press CTRL + SHIFT + P on Windows and Linux and CMD + SHIFT + P on a Mac to bring up Sublime's Command Palette, then type install package to bring up Package Control's package selector. It should be the first selection. Type “SublimeERB,” which, again, should be the first selection, and then hit enter. You should now have the proper package installed, but you will still need to add a keybinding to use it.

Sublime Text 3 Beta Install

Make sure to follow the updated instructions for installing package control. Even with the package being installed via package control, you still need to modify your keybinding file as per the instructions below. The manual installation listed below still works for Sublime Text 3.

Manual Installation

Clone the repository and symlink file to Sublime's User Directory:

OS X

git clone git@github.com:eddorre/SublimeERB.git ~/.sublime_erb

ln -fs ~/.sublime_erb/ ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/SublimeERB

Linux

git clone git@github.com:eddorre/SublimeERB.git ~/.sublime_erb

ln -fs ~/.sublime_erb/ ~/.config/sublime-text-2/Packages/SublimeERB

Usage

Add Keybinding

Open your User Keybinding File and add the following keybinding to activate the toggle command in all file types:

[
    { "keys": ["ctrl+shift+."], "command": "erb" }
  ]

…or only in the most common ERB contexts:

[
    { "keys": ["ctrl+shift+."], "command": "erb", "context":
      [
        { "key": "selector", "operator": "equal", "operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee" }
      ]
    }
  ]

Now you can use ctrl+shift+. to create and toggle between ERB tags. NOTE: On a Mac use the command key for the ctrl key.

Update To Latest Version

cd ~/.sublime_erb
  git pull --rebase

Sample

Copyright

SublimeERB is Copyright © 2011 Carlos Rodriguez, released under the MIT License.