sponsor Vim development Vim logo Vim Book Ad

basic Tip #504: syntax check

 tip karma   Rating -15/20, Viewed by 1507 

created:   July 4, 2003 11:26      complexity:   basic
author:   cnf      as of Vim:   6.0

i need a condition depending on what syntax a file is

like
if syntax = perl
    do foo
endif

tried above code, didnt work
how do i check what syntax file is loaded ?

 rate this tip  Life Changing Helpful Unfulfilling 

<<PuTTY numeric keypad mappings | email from vim! >>

Additional Notes

[email protected], July 4, 2003 20:51
ok

solved it with

autocmd Syntax perl do foo

a spot of trouble arose with "let perl_fold=1" but i got around that too
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