Question

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 ?

Was it helpful?

Solution

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

See :help fillchars for more info.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top