Skip to content

Commit

Permalink
g:haskell_conceal_comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dag committed May 19, 2012
1 parent a3973b1 commit ac0ba18
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
19 changes: 15 additions & 4 deletions autoload/vim2hs/haskell/syntax.vim
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,27 @@ function! vim2hs#haskell#syntax#strings() " {{{
endfunction " }}}


function! vim2hs#haskell#syntax#comments() " {{{
function! vim2hs#haskell#syntax#comments(conceal) " {{{
syntax case match

syntax keyword hsTodo
\ TODO FIXME XXX
\ contained

syntax match hsComment
\ /--.*/
\ contains=hsTodo
if a:conceal
syntax match hsComment
\ /--.*/
\ contains=hsTodo
\ conceal cchar=

syntax match hsComment
\ /^\s*--.*/
\ contains=hsTodo
else
syntax match hsComment
\ /--.*/
\ contains=hsTodo
endif

syntax region hsBlockComment
\ start="{-" end="-}"
Expand Down
36 changes: 19 additions & 17 deletions syntax/haskell.vim
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
syntax clear


call vim2hs#letdefault('g:haskell_haddock' , 0)
call vim2hs#letdefault('g:haskell_ffi' , 1)
call vim2hs#letdefault('g:haskell_cpp' , 1)
call vim2hs#letdefault('g:haskell_th' , 1)
call vim2hs#letdefault('g:haskell_quasi' , 1)
call vim2hs#letdefault('g:haskell_interpolation' , 1)
call vim2hs#letdefault('g:haskell_regex' , 1)
call vim2hs#letdefault('g:haskell_jmacro' , 1)
call vim2hs#letdefault('g:haskell_shqq' , 1)
call vim2hs#letdefault('g:haskell_sql' , 1)
call vim2hs#letdefault('g:haskell_json' , 1)
call vim2hs#letdefault('g:haskell_xml' , 1)
call vim2hs#letdefault('g:haskell_hsp' , 1)
call vim2hs#letdefault('g:haskell_conceal' , 1)
call vim2hs#letdefault('g:haskell_conceal_wide' , 0)
call vim2hs#letdefault('g:haskell_conceal_bad' , 0)
call vim2hs#letdefault('g:haskell_haddock' , 0)
call vim2hs#letdefault('g:haskell_ffi' , 1)
call vim2hs#letdefault('g:haskell_cpp' , 1)
call vim2hs#letdefault('g:haskell_th' , 1)
call vim2hs#letdefault('g:haskell_quasi' , 1)
call vim2hs#letdefault('g:haskell_interpolation' , 1)
call vim2hs#letdefault('g:haskell_regex' , 1)
call vim2hs#letdefault('g:haskell_jmacro' , 1)
call vim2hs#letdefault('g:haskell_shqq' , 1)
call vim2hs#letdefault('g:haskell_sql' , 1)
call vim2hs#letdefault('g:haskell_json' , 1)
call vim2hs#letdefault('g:haskell_xml' , 1)
call vim2hs#letdefault('g:haskell_hsp' , 1)
call vim2hs#letdefault('g:haskell_conceal' , 1)
call vim2hs#letdefault('g:haskell_conceal_comments' , 0)
call vim2hs#letdefault('g:haskell_conceal_wide' , 0)
call vim2hs#letdefault('g:haskell_conceal_bad' , 0)


call vim2hs#haskell#syntax#operators()
Expand Down Expand Up @@ -87,7 +88,8 @@ call vim2hs#haskell#syntax#keywords(1)
call vim2hs#haskell#syntax#types()
call vim2hs#haskell#syntax#folds()
call vim2hs#haskell#syntax#strings()
call vim2hs#haskell#syntax#comments()
call vim2hs#haskell#syntax#comments(g:haskell_conceal
\ && g:haskell_conceal_comments)

if g:haskell_haddock
call vim2hs#haskell#syntax#haddock()
Expand Down

0 comments on commit ac0ba18

Please sign in to comment.