On 2010-04-18, john wrote:
> hi,
> 
> can i customize the vim fold indicator (when fold is 'closed') to go 
> just to the leftmost non-whitespace char rather than all the way to the
> left margin?

You can replace the text that Vim generates for that line with your
own by specifying your own function for 'foldtext'.  See

    :help fold-foldtext

Here's an example from my .vimrc that does the sort of indenting you
want, but it removes other text from that line as well.  I wrote it
before the repeat() function was available, so using that function
now would simplify this a bit by removing the while loop.

    set foldtext=MyFoldText()
    function! MyFoldText()
        let n = v:foldend - v:foldstart + 1
        let i = indent(v:foldstart)
        let istr = ''
        while i > 0
            let istr = istr . ' '
            let i = i - 1
        endwhile
        return istr . "+-" . v:folddashes . " " . n . " lines "
    endfunction

Regards,
Gary

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Subscription settings: http://groups.google.com/group/vim_use/subscribe?hl=en

Reply via email to