Running Turtle
Running Turtle

Reputation: 12752

Custom folding in vim

in my .vimrc file, I have the follwing for custom folding javascript:

function! JavaScriptFold()
    setl foldmethod=syntax
    setl foldlevelstart=1
    syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend

    function! FoldText()
        return substitute(getline(v:foldstart), '{.*', '{...}', '')
    endfunction
    setl foldtext=FoldText()
endfunction
au FileType javascript call JavaScriptFold()
au FileType javascript setl fen

It works great except for one thing: when folded, I have something like:

function hello(){...]-----------------------------------------------------------

My question is: how to get rid of the '----' that goes to the end of the line ?

Upvotes: 4

Views: 3034

Answers (1)

Randy Morris
Randy Morris

Reputation: 40947

Those characters are configured via the fillchars option, more specifically the fold: item of the fillchars option.

See :help fillchars for more info.

Upvotes: 7

Related Questions