Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 1 | " Vim filetype plugin file |
| 2 | " Language: MS Message files (*.mc) |
| 3 | " Maintainer: Kevin Locke <kwl7@cornell.edu> |
| 4 | " Last Change: 2008 April 09 |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 5 | " 2024 Jan 14 by Vim Project (browsefilter) |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 6 | " Location: http://kevinlocke.name/programs/vim/syntax/msmessages.vim |
| 7 | |
| 8 | " Based on c.vim |
| 9 | |
| 10 | " Only do this when not done yet for this buffer |
| 11 | if exists("b:did_ftplugin") |
| 12 | finish |
| 13 | endif |
| 14 | |
| 15 | " Don't load another plugin for this buffer |
| 16 | let b:did_ftplugin = 1 |
| 17 | |
| 18 | " Using line continuation here. |
| 19 | let s:cpo_save = &cpo |
| 20 | set cpo-=C |
| 21 | |
| 22 | let b:undo_ftplugin = "setl fo< com< cms< | unlet! b:browsefilter" |
| 23 | |
| 24 | " Set 'formatoptions' to format all lines, including comments |
| 25 | setlocal fo-=ct fo+=roql |
| 26 | |
| 27 | " Comments includes both ";" which describes a "comment" which will be |
| 28 | " converted to C code and variants on "; //" which will remain comments |
| 29 | " in the generated C code |
| 30 | setlocal comments=:;,:;//,:;\ //,s:;\ /*\ ,m:;\ \ *\ ,e:;\ \ */ |
| 31 | setlocal commentstring=;\ //\ %s |
| 32 | |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 33 | " Win32 and GTK can filter files in the browse dialog |
| 34 | if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 35 | let b:browsefilter = "MS Message Files (*.mc)\t*.mc\n" . |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 36 | \ "Resource Files (*.rc)\t*.rc\n" |
| 37 | if has("win32") |
| 38 | let b:browsefilter .= "All Files (*.*)\t*\n" |
| 39 | else |
| 40 | let b:browsefilter .= "All Files (*)\t*\n" |
| 41 | endif |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 42 | endif |
| 43 | |
| 44 | let &cpo = s:cpo_save |
| 45 | unlet s:cpo_save |