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
  • 5 years ago
  • 12 minutes ago
  • 8 years ago

Installs

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

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.