Skip to content

Instantly share code, notes, and snippets.

@ghprince
Created October 13, 2012 10:28
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 ghprince/3884084 to your computer and use it in GitHub Desktop.
Save ghprince/3884084 to your computer and use it in GitHub Desktop.
CCK filetype detection for VIM
" Vim support file to detect file types in scripts
"
" Maintainer: Gordon Gao <gordon.gao@oracle.com>
" 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 wonphisith.nimyeezhone@oracle.com)
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