Loading ...
Sorry, an error occurred while loading the content.

56447Re: Any way to put tabs in foldtext?

Expand Messages
  • Luc Hermitte
    Feb 9, 2005

      * On Fri, Feb 04, 2005 at 04:51:15PM +0530, Raja Koduru <kscraja@...> 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:le
      > >>>http://hermitte.free.fr/vim/ressources/vimfiles/fold/c-fold.vim
      > >
      > >>Please suggest on how to use this script. or methods to verify if this
      > >>really loaded by vim and is working.
      > >
      > >This script is a fold plugin for C and C++. It defines two functions
      > >used in 'foldexpr' and in 'foldtext'.
      > >
      > >It is loaded from my .vimrc (available on my site) thanks to a few
      > >autocommands very similar to the ones used to load ftplugins. It
      > >should be droppable as it is into {rtp}/ftplugin/c/, and get loaded
      > >automatically for C and C++ files.
      > >
      > >
      > Luc,
      > When i enable these fold-scripts, the file loading is taking 4 to 6
      > seconds for a file of size 557 lines. This load time is even worse for
      > larger files. But when is use ...

      I know. My script is damn slow :-(
      Unfortunatelly I do not have much time to correctly rewrite it.
      I only gave you a link to it in the case you could be interrested to
      have your own 'foldtext' function.

      However, I must admit I do not know whether we can set 'foldtext' to a
      custom function and still set 'foldmethod' to something like "syntax".


      Luc Hermitte
    • Show all 7 messages in this topic