home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / asmselect.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  914 b   |  32 lines

  1. " Vim syntax file
  2. " Language:    Selects between various assemblers
  3. " Maintainer:    C. Laurence Gonsalves <clgonsal@kami.com>
  4. " Last change:    1998 July 22
  5. " URL:        http://www.cryogen.com/clgonsal/vim/syntax/asmselect.vim
  6.  
  7. " make sure b:asmsyntax exists
  8. if !exists("b:asmsyntax")
  9.     let b:asmsyntax = ""
  10. endif
  11.  
  12. if b:asmsyntax == ""
  13.     " see if file contains any asmsyntax=foo overrides. If so, change
  14.     " b:asmsyntax appropriately
  15.     let b:head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4)." ".getline(5)." "
  16.     if b:head =~ '\sasmsyntax=\S\+\s'
  17.         let b:asmsyntax = substitute(b:head, '.*\sasmsyntax=\(\S\+\)\s.*','\1', "")
  18.     endif
  19.     unlet b:head
  20. endif
  21.  
  22. " if b:asmsyntax still isn't set, default to asmsyntax or GNU
  23. if b:asmsyntax == ""
  24.     if exists("asmsyntax")
  25.     let b:asmsyntax = asmsyntax
  26.     else
  27.     let b:asmsyntax = "asm"
  28.     endif
  29. endif
  30.  
  31. exe "so $VIM/syntax/" . b:asmsyntax . ".vim"
  32.