Skip to content

Instantly share code, notes, and snippets.

@tsibley
Created August 18, 2010 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsibley/536040 to your computer and use it in GitHub Desktop.
Save tsibley/536040 to your computer and use it in GitHub Desktop.
Better mason file detection for vim
" Mason
au BufNewFile,BufRead * call s:FTmason()
func! s:FTmason()
let n = 1
while n < 10
let l = getline(n)
if l =~ '^%#' || l =~ '^\<%(INIT|init)\>' || l =~ '^\<%(ARGS|args)\>'
set filetype=mason
return
endif
let n = n + 1
endwhile
endfunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment