Created
July 13, 2013 00:53
-
-
Save hyuki0000/5988910 to your computer and use it in GitHub Desktop.
A simple example for syntax coloring of ".txt" files. *Sample Sample Sample => PreProc ;Sample Sample Sample => Comment
This file contains 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
augroup filetypedetect | |
au BufNewFile,BufRead *.txt setf txt | |
augroup END |
This file contains 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 syntax file | |
if exists("b:current_syntax") | |
finish | |
endif | |
syn match txtSection "^\*.*$" | |
syn match txtComment "^;.*$" | |
hi link txtSection PreProc | |
hi link txtComment Comment | |
let b:current_syntax = "txt" |
Author
hyuki0000
commented
Jul 13, 2013
- filetype.vim は ~/.vim/filetype.vim に置く。
- txt.vim は ~/.vim/syntax/txt.vim に置く。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment