|
| 1 | +" Vim syntax file |
| 2 | +" Filename: txt.vim |
| 3 | +" Language: plain text :) |
| 4 | +" Maintainer: Aurelio Marinho Jargas |
| 5 | +" URL: http://aurelio.net/vim/txt.vim |
| 6 | +" Instalacao: Colocar no final do seu ~/.vimrc: |
| 7 | +" au BufNewFile,BufRead *.txt source ~/rota/para/txt.vim |
| 8 | +" |
| 9 | +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 10 | +syn clear |
| 11 | +syn case ignore |
| 12 | + |
| 13 | +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 14 | +"MISC: |
| 15 | +syn keyword txtTodo TODO FIXME XXX contained |
| 16 | +syn match txtComment '^#.*$' contains=txtTodo |
| 17 | +syn match txtNumber '\<\d\+\([,.]\d\+\)\{,1}\>' |
| 18 | +syn match txtPercent '\<\d\+\([,.]\d\+\)\{,1}%' |
| 19 | +"syn match txtBlank '\s\+$' |
| 20 | +syn match txtBar '^\s*[_=-]\{20,}\s*$' |
| 21 | +syn match txtSpecial '[][(){}®]' |
| 22 | +syn match txtSpecial '\<\(US\|R\)\$' |
| 23 | + |
| 24 | +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 25 | +"URL EMAIL: |
| 26 | +syn match txtEmail '\<[A-Za-z0-9_.-]\+@\([A-Za-z0-9_-]\+\.\)\+[A-Za-z]\{2,4}\>\(?[A-Za-z0-9%&=+.,@*_-]\+\)\=' |
| 27 | +syn match txtUrl '\<\(\(https\=\|ftp\|news\|telnet\|gopher\|wais\)://\([A-Za-z0-9._-]\+\(:[^ @]*\)\=@\)\=\|\(www[23]\=\.\|ftp\.\)\)[A-Za-z0-9%._/~:,=$@-]\+\>/*\(?[A-Za-z0-9/%&=+.,@*_-]\+\)\=\(#[A-Za-z0-9%._-]\+\)\=' |
| 28 | +syn match txtEmailMsg '^\s*\(From\|De\|To\|Para\|Date\|Data\|Assunto\|Subject\):.*' |
| 29 | +syn match txtEmailQuote '^\(>\($\| \)\)\+' |
| 30 | + |
| 31 | +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 32 | +"LIST: |
| 33 | +syn match txtList '^ *[-+*.] [^ ]'me=e-1 |
| 34 | +syn match txtList '^ *[0-9]\+) ' |
| 35 | +syn match txtDefList '^ *[^:]\{6,\}:'hs=e contains=ALL |
| 36 | + |
| 37 | +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 38 | +"FONT BEAUTIFIERS: |
| 39 | +syn match txtUnderline '_[^_[:blank:]].\{-}_'hs=s+1,he=e-1 |
| 40 | +syn match txtBold '\*[^*[:blank:]].\{-}\*'hs=s+1,he=e-1 |
| 41 | +syn match txtMonospace "`[^`]\+`"hs=s+1,he=e-1 |
| 42 | +" max: two lines |
| 43 | +syn match txtParentesis "([^)]\+\(\n\)\=[^)]*)" contains=txtUrl,txtEmail |
| 44 | +syn match txtQuotes '"[^"]\+\(\n\)\=[^"]*"'hs=s+1,he=e-1 |
| 45 | +" max: two words |
| 46 | +syn match txtQuotes "'\w\+ \?\w\+'"hs=s+1,he=e-1 |
| 47 | + |
| 48 | +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 49 | +" color definitions (specific) |
| 50 | +hi txtBar term=bold cterm=bold gui=bold |
| 51 | +hi txtBold term=bold cterm=bold gui=bold |
| 52 | +hi txtItalic term=italic cterm=italic gui=italic |
| 53 | +hi txtUnderline term=underline cterm=underline gui=underline |
| 54 | +" |
| 55 | +" color definitions (using Vim defaults) |
| 56 | +hi link txtComment Comment |
| 57 | +hi link txtQuotes String |
| 58 | +hi link txtBlank Error |
| 59 | +hi link txtNumber Number |
| 60 | +hi link txtPercent Number |
| 61 | +hi link txtTodo Todo |
| 62 | +hi link txtEmail PreProc |
| 63 | +hi link txtUrl PreProc |
| 64 | +hi link txtList Statement |
| 65 | +hi link txtDefList Statement |
| 66 | +hi link txtMonospace Special |
| 67 | +hi link txtSpecial Statement |
| 68 | +hi link txtParentesis Comment |
| 69 | +hi link txtEmailMsg Structure |
| 70 | +hi link txtEmailQuote Structure |
| 71 | +" |
| 72 | +let b:current_syntax = 'txt' |
| 73 | +" vim:tw=0:et |
0 commit comments