a4cd3c666a79

vim: add the cram syntax file
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 26 Sep 2010 18:28:43 -0400
parents 012ee2f6f9ad
children 614694ef009f
branches/tags (none)
files vim/.vimrc vim/colors/molokai.vim vim/syntax/cram.vim

Changes

--- a/vim/.vimrc	Thu Sep 23 17:42:09 2010 -0400
+++ b/vim/.vimrc	Sun Sep 26 18:28:43 2010 -0400
@@ -232,6 +232,9 @@
 " Stop it, hash key
 inoremap # X<BS>#
 
+" Cram tests
+au BufNewFile,BufRead *.t set filetype=cram
+
 if has('gui_running')
     set guifont=Menlo:h12
     colorscheme molokai
--- a/vim/colors/molokai.vim	Thu Sep 23 17:42:09 2010 -0400
+++ b/vim/colors/molokai.vim	Sun Sep 26 18:28:43 2010 -0400
@@ -47,7 +47,6 @@
 hi ErrorMsg        guifg=#F92672 guibg=#232526 gui=bold
 hi Exception       guifg=#A6E22E               gui=bold
 hi Float           guifg=#AE81FF
-hi FoldColumn      guifg=#465457 guibg=#000000
 hi Folded          guifg=#465457 guibg=#000000
 hi Function        guifg=#A6E22E
 hi Identifier      guifg=#FD971F
@@ -115,15 +114,17 @@
    hi CursorColumn                  guibg=#3E3D32
    hi ColorColumn                   guibg=#3E3D32
    hi LineNr          guifg=#AAAAAA guibg=#3B3A32
+   hi FoldColumn      guifg=#AAAAAA guibg=#3B3A32
    hi NonText         guifg=#BCBCBC guibg=#3B3A32
 else
    hi Normal          guifg=#F8F8F2 guibg=#1B1D1E
    hi Folded          guifg=#666666 guibg=#1B1D1E
-   hi Comment         guifg=#465457
+   hi Comment         guifg=#5c7176
    hi CursorLine                    guibg=#232728
    hi CursorColumn                  guibg=#232728
    hi ColorColumn                   guibg=#232728
    hi LineNr          guifg=#AAAAAA guibg=#1B1D1E
+   hi FoldColumn      guifg=#AAAAAA guibg=#1B1D1E
    
    " Invisible character colors
    highlight NonText    guifg=#444444 guibg=#1a1c1d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/syntax/cram.vim	Sun Sep 26 18:28:43 2010 -0400
@@ -0,0 +1,27 @@
+" Vim syntax file
+" Language: Cram Tests
+" Author: Steve Losh (steve@stevelosh.com)
+"
+" Add the following line to your ~/.vimrc to enable:
+" au BufNewFile,BufRead *.t set filetype=cram
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn include @Shell syntax/sh.vim
+
+syn match cramComment /^[^ ].*$/
+syn region cramOutput start=/^  [^$>]/ start=/^  $/ end=/\v.(\n\n*[^ ])\@=/me=s end=/  [$>]/me=e-3 end=/^$/ fold containedin=cramBlock
+syn match cramCommandStart /^  \$ / containedin=cramCommand
+syn region cramCommand start=/^  \$ /hs=s+4,rs=s+4 end=/^  [^>]/me=e-3 end=/^  $/me=e-2 containedin=cramBlock contains=@Shell keepend
+syn region cramBlock start=/^  /ms=e-2 end=/\v.(\n\n*[^ ])\@=/me=s end=/^$/me=e-1 fold keepend
+
+hi link cramCommandStart Keyword
+hi link cramComment Normal
+hi link cramOutput Comment
+
+set foldmethod=syntax
+syn sync maxlines=200
+
+let b:current_syntax = "cram"