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

Sublime​ERB

by eddorre ST2/ST3 Trending

TextMate Style ERB Block for Sublime Text

Details

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

Installs

  • Total 47K
  • Win 9K
  • OS X 26K
  • Linux 12K
Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5
Windows 0 7 3 5 2 6 4 5 3 2 1 2 2 7 1 4 5 2 4 1 3 4 2 2 4 5 4 1 4 4 3 3 5 5 5 5 5 2 4 3 7 2 5 3 4 2
OS X 4 4 4 6 5 3 8 8 7 2 5 4 3 2 3 3 3 2 1 2 4 6 1 2 2 3 2 7 4 7 2 5 5 2 4 3 7 5 6 6 10 11 5 8 0 2
Linux 0 4 5 3 3 2 5 3 6 0 3 5 4 3 3 8 3 3 6 1 5 6 3 4 2 7 1 6 1 1 1 4 4 2 5 5 2 1 2 3 7 2 3 3 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.