Permalink
Browse files

Beginning of work on #2

  • Loading branch information...
1 parent 7bac750 commit 62a735112933ca5dee88e485b061209d55906a46 @rking committed with rking@sharpsaw.org Jan 17, 2013
Showing with 16 additions and 4 deletions.
  1. +14 −2 colors/detailed.vim
  2. +2 −2 test/app/models/omni.rb
View
16 colors/detailed.vim
@@ -393,7 +393,6 @@ let s:c = {
\'purple125': 125,
\'purple126': 126,
\'purple127': 127,
- \'purple129 (TODO: use this)': 129,
\'purple131': 131,
\'purple132': 132,
\'purple139': 139,
@@ -451,6 +450,10 @@ fun! s:fgbg(group, fg, bg)
exe 'hi '.a:group.' '.s:color_for(a:fg,'fg').' '.s:color_for(a:bg,'bg')
endfun
+fun! s:bold(group)
+ exe 'hi '.a:group.' cterm=bold gui=bold'
+endfun
+
fun! s:bold_fg(group, fg)
exe 'hi '.a:group.' '.s:color_for(a:fg,'fg').' cterm=bold gui=bold'
endfun
@@ -544,6 +547,7 @@ fun! s:detailed_colors()
" for :set cursorline
call s:bg('CursorLine', 'gray233')
+
hi CursorLine cterm=none " Get rid of the underline
" For :set colorcolumn=80
@@ -591,7 +595,10 @@ fun! s:detailed_colors()
call s:fg('detailedInstanceVariable', 'blue75')
- call s:fgbg('detailedString', 'purple125', 'gray233')
+ call s:fgbg('detailedString', 'red124', 'gray233')
+ call s:fgbg('detailedInterpolatedString', 'purple125', 'gray233')
+ call s:fgbg('detailedExecutedString', 'green34', 'purple53')
+ call s:bold('detailedExecutedString')
call s:fgbg('detailedRawString', 'red160', 'gray233')
call s:fg('detailedStringDelimiter', 'blue33')
call s:fg('detailedInterpolationDelimiter', 'gray244')
@@ -725,6 +732,11 @@ fun! s:ruby_syntax_and_highlights()
" Steal this back from the too-generic 'rubyControl':
syn match detailedExits "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|trap\)\>[?!]\@!\)"
+ " TODO: also handle %(…), etc
+ syn region detailedInterpolatedString matchgroup=detailedInterpolatedStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
+ " TODO: Also, %x(). Anything else?
+ syn region detailedExecutedString matchgroup=detailedExecutedStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
+
" The default syntax/ruby.vim gets this way wrong (only does 2 chars and is
" transparent):
syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]*" contains=NONE display
View
4 test/app/models/omni.rb
@@ -11,10 +11,10 @@ class Thing < ActiveRecord::Base
@@foo = $bar = @baz = buz = 2 + 1
def initialize
- lvar = { key: 231.0, 123 => ((true)), 'key3': { nes: 'ted' } }
+ lvar = { key: 231.0, 123 => ((true)), 'key3' => { nes: 'ted' } }
@ivar = lvar.gsub /^a.c{3}[^e-f](\(g\th|i(?:j)k)(?#comment)$/i, 'hi \1'
puts 'hi!' while 3 < @ivar
- arr << 'hi'
+ arr << 'hi' << "hih#{i}" << `hi`
end
private

0 comments on commit 62a7351

Please sign in to comment.