scrooloose / vimfiles

The ~/.vim directory that we share at work
828 stars 465 forks source link

some auto-complete snippets not working in vim #1

Closed kipkoan closed 14 years ago

kipkoan commented 14 years ago

I'm having a problem where some of the snippets don't seem to be working correctly.

For example, if in the RoR model I enter "hm" and hit < tab >, it expands to: has_many :<+object+>s<+, :class_name => "<+object+>", :foreign_key => "<+reference+>_id"+>

The cursor is then at the end of that line, and not set up for me to enter the information in place of the tags.

However, if I enter "habtm" and hit < tab >, it expands to: has_and_belongs_to_many :object, :join_table => "table_name", :foreign_key => "_id"

The cursor is then over the "object" symbol ready for me to replace, and then hitting tab moves me to "table_name" where I can replace that, then tab again moves to the beginning of the "_id" field for me to enter that. I assume this is how the "has_many" snippet should work also?

I've tested this on Linux running VIM 7.2 and on Mac running MacVim 7.2, and the same happens on both.

Do you know what I might be doing wrong... or what I can try to fix it? Any help you can give me is very much appreciated!

Thanks!

Kip

scrooloose commented 14 years ago

this is because the snipmate-snippets repo was originally derived from a snippet repo for another snippet plugin

the best thing to do is fix the snippet file in the snipmate-snippets repo and send a pull request ;)