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

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.