sponsor Vim development Vim logo Vim Book Ad

basic Tip #364: Automatic file type detection with fully qualified ClearCase names

 tip karma   Rating 22/10, Viewed by 1038 

created:   November 8, 2002 1:47      complexity:   basic
author:   Arnaud Cassignol      as of Vim:   6.0

I am using the great plugin from Douglas Potts (vimscript #15).

When you load a specific ClearCase version of a file, vim cannot find the correct file type in the full name (ex. filename.c@@/main/foo/1). To improve that, you can create an autocommand in the filetype.vim file in your user runtime directory.

augroup filetypedetect
  au BufNewFile,BufRead */*@@*
    \ if expand("<afile>") =~ '@@' |
    \   exe "doau filetypedetect BufRead " . expand("<afile>:s?@@.*$??") |
    \ endif
augroup END

The test in the command is for compatibility with path containing '@@' sequence.

 rate this tip  Life Changing Helpful Unfulfilling 

<<Starting up Vim very fast expecially from a telnet session | Vim Book Online >>

Additional Notes

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo