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

Re: fold label

Expand Messages
  • shawn wilson
    ... if i do something like this in perl code: ################### # useless comment # ################### and the line of #s is the first line of the fold, vim
    Message 1 of 5 , Nov 13, 2012
    • 0 Attachment
      On Tue, Nov 13, 2012 at 7:16 PM, Christian Brabandt <cblists@...> wrote:
      > Hi shawn!
      >
      > On Di, 13 Nov 2012, shawn wilson wrote:
      >
      >> On Tue, Nov 13, 2012 at 9:50 AM, Christian Brabandt <cblists@...> wrote:
      >> > On Tue, November 13, 2012 10:33, shawn wilson wrote:
      >> >> is there a way to specify how a fold gets labeled? the default (of the
      >> >> first line with visible text is generally correct) but sometimes, my
      >> >> fold will start at a line with only /* or // or #. and a fold label
      >> >> with one of these is next to useless.
      >> >>
      >> > See
      >> > :h 'foldtext'
      >> > :h fold-foldtext
      >> >
      >>
      >> per foldtext -
      >> Leading white space, "//" or "/*" and the text from the 'foldmarker'
      >> and 'commentstring' options is removed.
      >>
      >> i have:
      >> let perl_fold=1 " Perl
      >> and try:
      >> autocmd FileType perl set commentstring='# %s'
      >>
      >> but, this doesn't seem to do anything.
      >>
      >> also, it seems i was wrong about // - that does seem to work correctly in js
      >
      > I am not sure, what you are trying to do here.
      if i do something like this in perl code:
      ###################
      # useless comment #
      ###################

      and the line of #s is the first line of the fold, vim does:
      +-- 3 lines: ##################------------------------------------------------------------------------------
      which is, of course, next to useless.

      > But here is an example of
      > how I customize my folded text. It is based on an idea by Greg Sexton
      > mentioned at
      > http://www.gregsexton.org/2011/03/improving-the-text-displayed-in-a-fold/
      >

      thanks. i think i'll have the same display issue i'm currently having.
      however i think i can change this:
      getline(fs) =~ '^\s*$'
      to something like:
      getline(fs) =~ '^[^#\\ ]*$'
      and that might work. either way, i think i can see how to make it work
      with that.

      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.