tag:blogger.com,1999:blog-7592502102239071169.post4875545291849842210..comments2017-02-07T02:53:20.636-07:00Comments on Bits about Bytes: Objective-C Syntax in gVimAlexhttp://www.blogger.com/profile/13385489484617545171noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-7592502102239071169.post-302156039200804752013-05-16T11:37:47.758-06:002013-05-16T11:37:47.758-06:00Thanks a lot! Just what I needed!
Cheers,
AndyThanks a lot! Just what I needed!<br /><br />Cheers,<br />AndyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7592502102239071169.post-54402797627035928242011-08-21T12:12:48.951-06:002011-08-21T12:12:48.951-06:00Yes, thank you very much. Google is great, but wi...Yes, thank you very much. Google is great, but without people like you it really wouldn't be anywhere as useful as it is today.hollandnoreply@blogger.comtag:blogger.com,1999:blog-7592502102239071169.post-84487095513685749072009-06-09T21:21:30.144-06:002009-06-09T21:21:30.144-06:00I found that the reason this was failing is that V...I found that the reason this was failing is that Vim was only looking at the first 10 lines of a file to determine if it was an Objective C file. Specifically, it was looking for #include or #import statements in order to consider it an Objective C file. The problem is, many of the files generated by XCode have comment headers at the front of the file which are much longer than 10 lines, so Vim will never find an #import or #include in those files.<br /><br />Solution:<br /><br />edit your filetype.vim file in the shared vim directory (mine was at /usr/share/vim/vim72/filetype.vim). In that file there is a function named FTm. Search for "FTm" (case sensitive) until you find it. The 2nd line of the function looks like this:<br /><br />while n < 10<br /><br />Simply change that to:<br /><br />while n < 100<br /><br />Save the file, and you're done.<br /><br />This will make Vim search the first 100 lines of the file instead of the first 10. Fixed my filetype detection on the first try.<br /><br />Hopefully this will help someone else with the same problem (particularly if they ever really have a need to edit both Objective C and Matlab files).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7592502102239071169.post-32038310825072194342009-01-27T08:06:00.000-07:002009-01-27T08:06:00.000-07:00@lysium: correct. But as I don't use Matlab, and ...@lysium: correct. But as I don't use Matlab, and I do use Objective-C, I'm ok with clobbering the Matlab syntax.Alexhttps://www.blogger.com/profile/13385489484617545171noreply@blogger.comtag:blogger.com,1999:blog-7592502102239071169.post-60061730976300160472009-01-27T02:20:00.000-07:002009-01-27T02:20:00.000-07:00vim identifies '.m' as Matlab files (whhich happen...vim identifies '.m' as Matlab files (whhich happen to have the same extension '.m' as ObjectiveC files)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7592502102239071169.post-4525897405739441612009-01-02T01:29:00.000-07:002009-01-02T01:29:00.000-07:00WOW.. Thanks. I'm glad i didn't have to digg aroun...WOW.. Thanks. I'm glad i didn't have to digg around for this.. Google helped bring it.. I wouldn't have thought to look in the help for something like this! Post more tips as you come accross them.Unknownhttps://www.blogger.com/profile/05387737678596061279noreply@blogger.com