[PATCH] Obj-C filetype detection

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[PATCH] Obj-C filetype detection

Björn Winckler
Hi,

The attached patch properly detects Objective-C files (.m) which start
with C++ style comments (//).  The current filetype.vim only looks for
C-style comments (/*) and hence often comes to the conclusion that
Obj-C files are Matlab files.

Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


filetype.vim.diff (692 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PATCH] Obj-C filetype detection

Bram Moolenaar


Bjorn Wickler wrote:

> The attached patch properly detects Objective-C files (.m) which start
> with C++ style comments (//).  The current filetype.vim only looks for
> C-style comments (/*) and hence often comes to the conclusion that
> Obj-C files are Matlab files.

Fine with me.  If nobody objects I'll include this.

--
ARTHUR: Charge!
   [They all charge with swords drawn towards the RABBIT.  A tremendous twenty
   second fight with Peckinpahish shots and borrowing heavily also on the
   Kung Fu and karate-type films ensues, in which some four KNIGHTS are
   comprehensively killed.]
ARTHUR: Run away!  Run away!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PATCH] Obj-C filetype detection

Patrick Texier-2
Le Sat, 13 Dec 2008 20:50:15 +0100, Bram Moolenaar a écrit dans le
message <[hidden email]> :

> Fine with me.  If nobody objects I'll include this.

I have a patch for gedcom files detection for LifeLines (Unix and
Windows).
--
Patrick Texier

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


filetype.patch (764 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PATCH] Obj-C filetype detection

Bram Moolenaar


Patrick Texier wrote:

> I have a patch for gedcom files detection for LifeLines (Unix and
> Windows).

Thanks.  It's better to put patterns that end in a * near the end of
filetype.vim:

*** ../vim-7.2.069/runtime/filetype.vim Wed Aug  6 18:56:36 2008
--- runtime/filetype.vim Sun Dec 14 12:54:19 2008
***************
*** 704,710 ****
  au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
 
  " Gedcom
! au BufNewFile,BufRead *.ged setf gedcom
 
  " Git
  autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG    setf gitcommit
--- 707,713 ----
  au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
 
  " Gedcom
! au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
 
  " Git
  autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG    setf gitcommit
***************
*** 2325,2330 ****
--- 2336,2344 ----
  \|  let b:fvwm_version = 2 | call s:StarSetf('fvwm')
  \|endif
 
+ " Gedcom
+ au BufNewFile,BufRead /tmp/lltmp* call s:StarSetf('gedcom')
+
  " GTK RC
  au BufNewFile,BufRead .gtkrc*,gtkrc* call s:StarSetf('gtkrc')
 


--
An indication you must be a manager:
You feel sorry for Dilbert's boss.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Loading...