Created
October 13, 2012 10:28
-
-
Save ghprince/3884084 to your computer and use it in GitHub Desktop.
CCK filetype detection for VIM
This file contains hidden or 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
" Vim support file to detect file types in scripts | |
" | |
" Maintainer: Gordon Gao <[email protected]> | |
" Last change: 2012 Oct 17 | |
" This file is a user customized script file to detect CCK filetype. | |
" Only do the rest when the FileType autocommand has not been triggered yet. | |
if did_filetype() | |
finish | |
endif | |
" Skip comment and blank at the beginning of the file | |
" (thanks to [email protected]) | |
let n = 1 | |
while n < 90 && n < line("$") && getline(n) =~ '^\s*\(#\|$\)' | |
let n = n + 1 | |
endwhile | |
if getline(n) =~ "^type" && getline(n+1) =~ "^name" && getline(n+2) =~ "^author" && getline(n+3) =~ "version" | |
set ft=cck | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment