Created
June 28, 2009 03:03
-
-
Save kana/137190 to your computer and use it in GitHub Desktop.
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 -u NONE -c 'source test.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
Before Syntax * = / | |
:edit a.vim | |
Before FileType * = vim/vim | |
FileType vim on a.vim | |
Before Syntax * = vim/vim | |
After Syntax * = vim/vim | |
After FileType * = vim/vim | |
:edit xyzzy | |
:setfiletype vim | |
Before FileType * = vim/vim | |
FileType vim on xyzzy | |
Before FileType * = html/html | |
Before Syntax * = html/html | |
After Syntax * = html/html | |
After FileType * = html/html | |
Before Syntax * = html/vim | |
After Syntax * = html/vim | |
After FileType * = html/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
autocmd FileType vim | |
\ call add(g:message, 'FileType vim on '.expand('%')) | |
\ | if expand('%') ==# 'xyzzy' | |
\ | setlocal filetype=html | |
\ | endif |
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
set nocompatible | |
let g:message = [] | |
augroup testBefore | |
autocmd FileType * | |
\ call add(g:message, 'Before FileType * = '.&l:filetype.'/'.expand('<amatch>')) | |
autocmd Syntax * | |
\ call add(g:message, 'Before Syntax * = '.&l:filetype.'/'.expand('<amatch>')) | |
augroup END | |
syntax enable | |
augroup testAfter | |
autocmd FileType * | |
\ call add(g:message, 'After FileType * = '.&l:filetype.'/'.expand('<amatch>')) | |
autocmd Syntax * | |
\ call add(g:message, 'After Syntax * = '.&l:filetype.'/'.expand('<amatch>')) | |
augroup END | |
call add(g:message, ':edit a.vim') | |
edit a.vim | |
call add(g:message, ':edit xyzzy') | |
edit xyzzy | |
call add(g:message, ':setfiletype vim') | |
setfiletype vim | |
put =g:message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment