home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / ftplugin.vim < prev    next >
Encoding:
Text File  |  2003-05-10  |  766 b   |  28 lines

  1. " Vim support file to switch on loading plugins for file types
  2. "
  3. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  4. " Last change:    2003 May 10
  5.  
  6. if exists("did_load_ftplugin")
  7.   finish
  8. endif
  9. let did_load_ftplugin = 1
  10.  
  11. augroup filetypeplugin
  12.   au FileType * call s:LoadFTPlugin()
  13.   func! s:LoadFTPlugin()
  14.     if expand("<amatch>") != ""
  15.       if exists("b:undo_ftplugin")
  16.     exe b:undo_ftplugin
  17.     unlet b:undo_ftplugin b:did_ftplugin
  18.       endif
  19.       if &cpo =~# "S" && exists("b:did_ftplugin")
  20.     " In compatible mode options are reset to the global values, need to
  21.     " set the local values also when a plugin was already used.
  22.     unlet b:did_ftplugin
  23.       endif
  24.       runtime! ftplugin/<amatch>.vim ftplugin/<amatch>_*.vim ftplugin/<amatch>/*.vim
  25.     endif
  26.   endfunc
  27. augroup END
  28.