Created
March 12, 2018 05:00
-
-
Save yoshikaw/e948884ee2cf56e36e653d5052df4877 to your computer and use it in GitHub Desktop.
vim blockdiag filetype detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" blockdiag | |
autocmd BufRead,BufNewFile *.diag | |
\ let s:line1 = getline(1) | | |
\ if s:line1 =~ '\<diagram\|blockdiag\>\s*{' | | |
\ set filetype=blockdiag | | |
\ elseif s:line1 =~ '\<seqdiag\>\s*{' | | |
\ set filetype=seqdiag | | |
\ elseif s:line1 =~ '\<actdiag\>\s*{' | | |
\ set filetype=actdiag | | |
\ elseif s:line1 =~ '\<nwdiag\>\s*{' | | |
\ set filetype=nwdiag | | |
\ elseif s:line1 =~ '\<rackdiag\>\s*{' | | | |
\ set filetype=rackdiag | | |
\ elseif s:line1 =~ '\<packetdiag\>\s*{' | | |
\ set filetype=packetdiag | | |
\ endif | | |
\ unlet s:line1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment