Hi Bram, I've created a patch to improve Objective-C filetype detection in ".m" and ".mm" file. Could you check the patch?
Modern Objective-C code uses "@import" instead of "#include" or "#import". http://clang.llvm.org/docs/Modules.html#objective-c-import-declaration Regards, Kazuki Problem: Fail to detect modern Objective-C code. Solution: Add @import detector Files: runtime/filetype.vim diff --git a/runtime/filetype.vim b/runtime/filetype.vim --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1168,7 +1168,7 @@ func! s:FTm() let n = 1 while n < 10 let line = getline(n) - if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\|//\)' + if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)' setf objc return endif @@ -1336,7 +1336,7 @@ func! s:FTmm() let n = 1 while n < 10 let line = getline(n) - if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)' + if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' setf objcpp return endif -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
