在vim中自定义折叠

Run*_*tle 4 vim folding

在我的.vimrc文件中,我有以下自定义折叠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
Run Code Online (Sandbox Code Playgroud)

除了一件事之外,它的效果很好:当折叠时,我有类似的东西:

function hello(){...]-----------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

我的问题是:如何摆脱走向终点的'----'?

Ran*_*ris 6

这些字符通过fillchars选项配置,更具体地说fold:fillchars选项的项目.

有关详情:help fillchars,请参阅.