~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to runtime/filetype.vim

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-05-04 11:13:42 UTC
  • mfrom: (1.1.8 upstream) (0.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090504111342-60miqybsixdpc345
Tags: 2:7.2.148-2ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/runtime/vimrc: "syntax on" is a sane default for non-tiny vim.
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Disable autoindent, line-wrapping, and backup files by default.
* Dropped changes, merged in Debian:
  - Add jaunty, karmic to the list of valid suites.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - Create a .pot file for translations.
* Drop gutsy from the list of valid distro series, it's been EOLed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
" Vim support file to detect file types
2
2
"
3
3
" Maintainer:   Bram Moolenaar <Bram@vim.org>
4
 
" Last Change:  2008 Aug 03
 
4
" Last Change:  2008 Dec 14
5
5
 
6
6
" Listen very carefully, I will say this only once
7
7
if exists("did_load_filetypes")
116
116
" XA65 MOS6510 cross assembler
117
117
au BufNewFile,BufRead *.a65                     setf a65
118
118
 
 
119
" Applescript
 
120
au BufNewFile,BufRead *.scpt                    setf applescript
 
121
 
119
122
" Applix ELF
120
123
au BufNewFile,BufRead *.am
121
124
        \ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
350
353
        \ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif
351
354
 
352
355
" C++
 
356
au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cpp
353
357
if has("fname_case")
354
 
  au BufNewFile,BufRead *.cxx,*.c++,*.C,*.H,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp
355
 
else
356
 
  au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp
 
358
  au BufNewFile,BufRead *.C,*.H setf cpp
357
359
endif
358
360
 
359
361
" .h files can be C, Ch C++, ObjC or ObjC++.
364
366
func! s:FTheader()
365
367
  if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1
366
368
    setf objc
367
 
  elseif exists("c_syntax_for_h")
 
369
  elseif exists("g:c_syntax_for_h")
368
370
    setf c
369
 
  elseif exists("ch_syntax_for_h")
 
371
  elseif exists("g:ch_syntax_for_h")
370
372
    setf ch
371
373
  else
372
374
    setf cpp
669
671
" Fetchmail RC file
670
672
au BufNewFile,BufRead .fetchmailrc              setf fetchmail
671
673
 
672
 
" FlexWiki
673
 
au BufNewFile,BufRead *.wiki                    setf flexwiki
 
674
" FlexWiki - disabled, because it has side effects when a .wiki file
 
675
" is not actually FlexWiki
 
676
"au BufNewFile,BufRead *.wiki                   setf flexwiki
674
677
 
675
678
" Focus Executable
676
679
au BufNewFile,BufRead *.fex,*.focexec           setf focexec
704
707
au BufNewFile,BufRead *.mo,*.gdmo               setf gdmo
705
708
 
706
709
" Gedcom
707
 
au BufNewFile,BufRead *.ged                     setf gedcom
 
710
au BufNewFile,BufRead *.ged,lltxxxxx.txt        setf gedcom
708
711
 
709
712
" Git
710
713
autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG    setf gitcommit
1046
1049
  let n = 1
1047
1050
  while n < 10
1048
1051
    let line = getline(n)
1049
 
    if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)'
 
1052
    if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\|//\)'
1050
1053
      setf objc
1051
1054
      return
1052
1055
    endif
1073
1076
" Maya Extension Language
1074
1077
au BufNewFile,BufRead *.mel                     setf mel
1075
1078
 
 
1079
" Mercurial config (looks like generic config file)
 
1080
au BufNewFile,BufRead *.hgrc,*hgrc              setf cfg
 
1081
 
1076
1082
" Messages
1077
1083
au BufNewFile,BufRead /var/log/messages,/var/log/messages.*[0-9]  setf messages
1078
1084
 
1263
1269
else
1264
1270
  au BufNewFile,BufRead *.pl                    call s:FTpl()
1265
1271
endif
1266
 
au BufNewFile,BufRead *.plx                     setf perl
 
1272
au BufNewFile,BufRead *.plx,*.al                setf perl
1267
1273
 
1268
1274
func! s:FTpl()
1269
1275
  if exists("g:filetype_pl")
2082
2088
" Viminfo file
2083
2089
au BufNewFile,BufRead .viminfo,_viminfo         setf viminfo
2084
2090
 
2085
 
" Virata Config Script File
2086
 
au BufRead,BufNewFile *.hw,*.module,*.pkg       setf virata
 
2091
" Virata Config Script File or Drupal module
 
2092
au BufRead,BufNewFile *.hw,*.module,*.pkg
 
2093
        \ if getline(1) =~ '<?php' |
 
2094
        \   setf php |
 
2095
        \ else |
 
2096
        \   setf virata |
 
2097
        \ endif
2087
2098
 
2088
2099
" Visual Basic (also uses *.bas) or FORM
2089
2100
au BufNewFile,BufRead *.frm                     call s:FTVB("form")
2328
2339
        \|  let b:fvwm_version = 2 | call s:StarSetf('fvwm')
2329
2340
        \|endif
2330
2341
 
 
2342
" Gedcom
 
2343
au BufNewFile,BufRead /tmp/lltmp*               call s:StarSetf('gedcom')
 
2344
 
2331
2345
" GTK RC
2332
2346
au BufNewFile,BufRead .gtkrc*,gtkrc*            call s:StarSetf('gtkrc')
2333
2347