Make your text editor recognize the CocoaPods files

Superbil edited this page Oct 29, 2013 · 3 revisions


Add the following to your ftdetect/ruby.vim script:

" CocoaPods
au BufNewFile,BufRead Podfile,*.podspec      set filetype=ruby

Sublime Text 2

  • Click the name of the current content format in the lower right corner (most likely "Plain Text").
  • Select "Open all with current extension as..." in the menu which opens.
  • Pick "Ruby" from the list.

Even though the menu refers to "extensions" this method also works for Podfile files, which have no extension. It will not cause Sublime Text 2 to open all files without extensions in Ruby mode.


Add the following to your init.el

 (add-auto-mode 'ruby-mode
           "Podfile\\'" "\\.podspec\\'")