Wikia

Vim Tips Wiki

Hide fold markers

Talk0
1,612pages on
this wiki
Revision as of 05:20, July 13, 2012 by JohnBot (Talk | contribs)

Tip 241 Printable Monobook Previous Next

created 2002 · complexity intermediate · author Edwin · version 6.0


I wanted to start using folding without having to get used to seeing the (default) markers, aka {{{ and }}}. So, here are two autocmds that will make them fade to black (bg=black, fg=black). Alternatively, you could use the Ignore highlighting group.

Method 1:

au BufRead,BufNewfile * syn match fmrkr '"*{{{\|"*}}}' |
  \ syn cluster vimCommentGroup contains=fmrkr |
  \ hi fmrkr term=NONE guibg=black guifg=black
  \ ctermbg=black ctermfg=black

Method 2:

au BufRead,BufNewfile * syn match fmrkr '"*{{{\|"*}}}'
  \ containedin=vimLineComment contained |
  \ hi fmrkr term=NONE guibg=black guifg=black
  \ ctermbg=black ctermfg=black

Both methods accomplish the same thing, but in a different way. Simply pick one and see those annoying markers fade away.

I just tried it out with Vim files, but you can easily modify it for any other filetypes.

References

Comments

 TO DO 
It might be better to:

  • Use add= instead of contains= for the syn cluster
  • Use Syntax autocmd event instead of BufRead,BufNewfile for both methods
  • With the above, make it trigger only for the correct language (e.g. autocmd Syntax vim ...)

Around Wikia's network

Random Wiki