56267Re: Any way to put tabs in foldtext?
- Feb 1, 2005On 2005-02-01, Luc Hermitte <hermitte@...> wrote:
> Hello,FWIW, I do something similar in my .vimrc:
> * On Tue, Feb 01, 2005 at 03:05:03PM -0700, Bryce Ready <bryce.ready@...> wrote:
> > I am using gVim 6.3.30, on a Fedora Core 3 linux machine. The
> > documentation for the foldtext variable (which defines what is shown
> > for a folded group of lines) says that any tabs are converted into
> > spaces. Myself, I prefer to just show the first line as it is (tabs
> > and all), and use the foldcolumn option to tell if there is a fold or
> > not. Is there any workaround that anyone knows of that would allow me
> > to do this?
> You can substitute leading tabs by as many strings of &tabstop spaces.
> That is what I use into:
" This is intended to be the same as the default foldtext()
" function, but without the text of the first line of the fold,
" since my fold strategy is different from Bram's. See fold.c
" for a good example of how Bram uses folding. (foldtext will
" have to be reset to foldtext().) See f_foldtext() in eval.c
" to see how string is built.
" Modified 28 Nov. 2001 to indent the fold text by the same
" amount as the first line of the fold.
let n = v:foldend - v:foldstart + 1
let i = indent(v:foldstart)
let istr = ''
while i > 0
let istr = istr . ' '
let i = i - 1
return istr . "+-" . v:folddashes . " " . n . " lines "
Gary Johnson | Agilent Technologies
garyjohn@... | Wireless Division
| Spokane, Washington, USA
- << Previous post in topic Next post in topic >>