Skip to content

Loading…

Fix snippet for 'for' statement #26

Open
wants to merge 3 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 21, 2011
  1. Allow the rake tasks to find the snippets folder if snipmate has been…

    Kris Leech committed
    … installed using Vundle
Commits on Jan 29, 2012
  1. @oivoodoo

    Fix snippet for 'for' statement

    oivoodoo committed
Commits on Apr 11, 2013
  1. @oivoodoo

    Add rdebug snippet

    oivoodoo committed
Showing with 10 additions and 4 deletions.
  1. +3 −1 Rakefile
  2. +3 −3 javascript/for.snippet
  3. +4 −0 ruby/rdebug.snippet
View
4 Rakefile
@@ -5,7 +5,9 @@ namespace :snippets_dir do
task :find do
vim_dir = File.join(ENV['VIMFILES'] || ENV['HOME'] || ENV['USERPROFILE'], RUBY_PLATFORM =~ /mswin|msys|mingw32/ ? "vimfiles" : ".vim")
pathogen_dir = File.join(vim_dir, "bundle")
- @snippets_dir = File.directory?(pathogen_dir) ? File.join(pathogen_dir, "snipmate", "snippets") : File.join(vim_dir, "snippets")
+ @snippets_dir = [File.join(pathogen_dir, 'snipmate', 'snippets'), File.join(pathogen_dir, 'snipmate.vim', 'snippets'), File.join(vim_dir, "snippets")].select do | folder |
+ File.exists? folder
+ end[0]
end
desc "Purge the contents of the vim snippets directory"
View
6 javascript/for.snippet
@@ -1,3 +1,3 @@
-for (var <+i+>=0; <+i+> < <+<+Things+>.length+>; <+i+>++) {
-<+<+Things+>[<+i+>]+>
-};
+for (var ${1:i}=0; ${1:i} < ${2:collection}.length; ${1:i}++) {
+ ${2:collection}[${1:i}]
+}
View
4 ruby/rdebug.snippet
@@ -0,0 +1,4 @@
+require 'ruby-debug'
+debugger
+${1}
+
Something went wrong with that request. Please try again.