Skip to content
This repository

When snipmate is installed using Vundle instead of Pathogen the path to snipmate is different. #23

Open
wants to merge 3 commits into from

2 participants

Kris Leech Alexandr Korsak
Kris Leech

This commit will look in each given path (pathogen, vundle, root), the first which exists sets @snippets_dir.

It will also allow for additional paths to be added in the future should some other package manager install snipmate elsewhere.

Kris Leech and others added some commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 3 unique commits by 2 authors.

Sep 21, 2011
Kris Leech Allow the rake tasks to find the snippets folder if snipmate has been…
… installed using Vundle
45f8297
Jan 29, 2012
Alexandr Korsak oivoodoo Fix snippet for 'for' statement 81d9279
Jan 30, 2012
Kris Leech Merge pull request #1 from oivoodoo/master
Fix snippet for 'for' statement
d64ba5a
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. +3 1 Rakefile
  2. +3 3 javascript/for.snippet
4 Rakefile
@@ -5,7 +5,9 @@ namespace :snippets_dir do
5 5 task :find do
6 6 vim_dir = File.join(ENV['VIMFILES'] || ENV['HOME'] || ENV['USERPROFILE'], RUBY_PLATFORM =~ /mswin|msys|mingw32/ ? "vimfiles" : ".vim")
7 7 pathogen_dir = File.join(vim_dir, "bundle")
8   - @snippets_dir = File.directory?(pathogen_dir) ? File.join(pathogen_dir, "snipmate", "snippets") : File.join(vim_dir, "snippets")
  8 + @snippets_dir = [File.join(pathogen_dir, 'snipmate', 'snippets'), File.join(pathogen_dir, 'snipmate.vim', 'snippets'), File.join(vim_dir, "snippets")].select do | folder |
  9 + File.exists? folder
  10 + end[0]
9 11 end
10 12
11 13 desc "Purge the contents of the vim snippets directory"
6 javascript/for.snippet
... ... @@ -1,3 +1,3 @@
1   -for (var <+i+>=0; <+i+> < <+<+Things+>.length+>; <+i+>++) {
2   -<+<+Things+>[<+i+>]+>
3   -};
  1 +for (var ${1:i}=0; ${1:i} < ${2:collection}.length; ${1:i}++) {
  2 + ${2:collection}[${1:i}]
  3 +}

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.