autocmd check filename in vim?

I want to write some autocmd's that check if the filename is this or that..

I've been trying:

autocmd VimEnter * if % is "preamble" | Explore | endif
autocmd VimEnter * if %=="preamble" | Explore | endif
autocmd VimEnter * if &filename == "preamble" | Explore | endif

but none of this works?

WHat should I do?

(this example is over-simplified, note that I'd also like to have an else statement).

9
задан romeovs 15 May 2011 в 16:55
поделиться