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 / runtime / indent.vim < prev    next >
Encoding:
Text File  |  2010-08-15  |  767 b   |  32 lines

  1. " Vim support file to switch on loading indent files for file types
  2. "
  3. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  4. " Last Change:    2008 Feb 22
  5.  
  6. if exists("did_indent_on")
  7.   finish
  8. endif
  9. let did_indent_on = 1
  10.  
  11. augroup filetypeindent
  12.   au FileType * call s:LoadIndent()
  13.   func! s:LoadIndent()
  14.     if exists("b:undo_indent")
  15.       exe b:undo_indent
  16.       unlet! b:undo_indent b:did_indent
  17.     endif
  18.     let s = expand("<amatch>")
  19.     if s != ""
  20.       if exists("b:did_indent")
  21.     unlet b:did_indent
  22.       endif
  23.  
  24.       " When there is a dot it is used to separate filetype names.  Thus for
  25.       " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
  26.       for name in split(s, '\.')
  27.     exe 'runtime! indent/' . name . '.vim'
  28.       endfor
  29.     endif
  30.   endfunc
  31. augroup END
  32.