Ruby
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CHANGELOG.md
CHEATSHEET.md
Name.sublime-snippet
README.md
_ampersand.sublime-snippet
_bang_ruby.sublime-snippet
_curly.sublime-snippet
_hash_hash_hash.sublime-snippet
_ternary.sublime-snippet
aa.sublime-snippet
alias.sublime-snippet
ar.sublime-snippet
ascii.sublime-snippet
aw.sublime-snippet
begin.sublime-snippet
begine.sublime-snippet
binary.sublime-snippet
callee.sublime-snippet
case.sublime-snippet
case0.sublime-snippet
catch.sublime-snippet
class.sublime-snippet ruby sublime snippets Apr 20, 2015
class_lt_lt.sublime-snippet
classinclude.sublime-snippet
classinherit.sublime-snippet
d64.sublime-snippet
def.sublime-snippet
def0.sublime-snippet
defi.sublime-snippet
defined.sublime-snippet
defo.sublime-snippet
defo0.sublime-snippet
defoi.sublime-snippet
defs.sublime-snippet
defs0.sublime-snippet
defsi.sublime-snippet
dir.sublime-snippet
do.sublime-snippet
do0.sublime-snippet
e64.sublime-snippet
else.sublime-snippet
elsif.sublime-snippet
encoding.sublime-snippet
ensure.sublime-snippet ruby sublime snippets Apr 20, 2015
error.sublime-snippet
exception.sublime-snippet
extend.sublime-snippet
file.sublime-snippet
frozen.sublime-snippet
gem.sublime-snippet
gemfile.sublime-snippet
gemfilegemspec.sublime-snippet ruby sublime snippets Apr 20, 2015
gemgit.sublime-snippet
gemgitbranch.sublime-snippet
gemgittag.sublime-snippet
gemspec.sublime-snippet
generate-cheatsheet.rb
group.sublime-snippet
hashproc.sublime-snippet
here.sublime-snippet add [X] to wrappable snippets Apr 22, 2015
here_quote.sublime-snippet
if.sublime-snippet
ife.sublime-snippet
include.sublime-snippet
init.sublime-snippet
init0.sublime-snippet
initi.sublime-snippet tab trigger for initi Apr 21, 2015
ips.sublime-snippet
ivd.sublime-snippet
ivg.sublime-snippet
ivs.sublime-snippet
lambda.sublime-snippet
lambda0.sublime-snippet
lambda0i.sublime-snippet
lambdai.sublime-snippet
ld.sublime-snippet
line.sublime-snippet
loop.sublime-snippet
method.sublime-snippet
minispec.sublime-snippet
module.sublime-snippet
moduleextended.sublime-snippet
moduleincluded.sublime-snippet
multicomment.sublime-snippet
open3.sublime-snippet
prepend.sublime-snippet
proc.sublime-snippet
proc0.sublime-snippet
proc0i.sublime-snippet
proci.sublime-snippet
rakefile.sublime-snippet
random.sublime-snippet
randombase64.sublime-snippet
randombytes.sublime-snippet
randomhex.sublime-snippet
randomurlsafebase64.sublime-snippet
range.sublime-snippet
rangee.sublime-snippet
regex.sublime-snippet
regexi.sublime-snippet
regexm.sublime-snippet
regexx.sublime-snippet
rescue.sublime-snippet
rq.sublime-snippet
rr.sublime-snippet
set.sublime-snippet
sha256.sublime-snippet ruby sublime snippets Apr 20, 2015
sha512.sublime-snippet
struct.sublime-snippet
task.sublime-snippet
timeout.sublime-snippet
undef.sublime-snippet wording Apr 22, 2015
unfrozen.sublime-snippet
unless.sublime-snippet add [X] to wrappable snippets Apr 22, 2015
until.sublime-snippet
utf.sublime-snippet
uuid.sublime-snippet
version.sublime-snippet
when.sublime-snippet
while.sublime-snippet

README.md

Productive Sublime Snippets for Ruby

Style

  • Only Ruby snippets
  • Focus on Ruby core and common standard snippets
  • No gem specific snippets, except for stdlib, bundler and rake

Install

  • Search in Sublime's package control for "ProductiveSnippetsRuby" OR
  • Clone into a directory in your Sublime Text Packages folder
  • Delete interfering Ruby snippets

Included snippets

Custom Shortcuts / Wrap around Selection

You can map keys to insert a specific snippet. This makes especially sense for snippets that can be wrapped around the current selection. A good example would be wrapping the selection in a Begin / Rescue statement. To do so when ALT+SHIFT+R is pressed, add this to your keymap file:

{
  "keys"      :   ["alt+shift+r"],
  "command"   :   "insert_snippet",
  "args": {
    "name": "Packages/ProductiveSnippetsRuby/begin.sublime-snippet"
  }
}

All snippets that can be wraped arround the selection have a [X] in their description. This allows you to define a key mapping, that shows all snippets that you can wrap arround the current selection:

{
  "keys": ["alt+shift+w"],
  "command": "show_overlay",
  "args": {
    "overlay": "command_palette",
    "text": "Snippet: [X]"
  }
}

Also See

J-_-L

MIT