File: asmselect.vim

package info (click to toggle)
vim-rt 5.3-12
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,172 kB
  • ctags: 815
  • sloc: makefile: 857; awk: 778; ansic: 379; perl: 192; sh: 167
file content (31 lines) | stat: -rw-r--r-- 914 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
" Vim syntax file
" Language:	Selects between various assemblers
" Maintainer:	C. Laurence Gonsalves <clgonsal@kami.com>
" Last change:	1998 July 22
" URL:		http://www.cryogen.com/clgonsal/vim/syntax/asmselect.vim

" make sure b:asmsyntax exists
if !exists("b:asmsyntax")
    let b:asmsyntax = ""
endif

if b:asmsyntax == ""
    " see if file contains any asmsyntax=foo overrides. If so, change
    " b:asmsyntax appropriately
    let b:head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4)." ".getline(5)." "
    if b:head =~ '\sasmsyntax=\S\+\s'
        let b:asmsyntax = substitute(b:head, '.*\sasmsyntax=\(\S\+\)\s.*','\1', "")
    endif
    unlet b:head
endif

" if b:asmsyntax still isn't set, default to asmsyntax or GNU
if b:asmsyntax == ""
    if exists("asmsyntax")
	let b:asmsyntax = asmsyntax
    else
	let b:asmsyntax = "asm"
    endif
endif

exe "so $VIM/syntax/" . b:asmsyntax . ".vim"