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

foldmethod=syntax : foldclose in some functions only

Expand Messages
  • R. shankar
    I use foldmethod=syntax and Language used is C++ I have a c code structure like this - class ABC { struct a { ..... } struct b { ..... } struct c { ..... }
    Message 1 of 1 , Nov 29, 2004
      I use foldmethod=syntax and Language used is C++

      I have a c code structure like this -

      class ABC
      {

      struct a
      {
      .....
      }

      struct b
      {
      .....
      }

      struct c
      {
      .....
      }

      function d
      {
      ....
      }

      }

      After folding I want that -
      class ABC
      {

      struct a
      +---15lines ---{-------------------------------
      struct b
      +---15lines ---{-------------------------------
      struct c
      +---15lines ---{-------------------------------
      function d
      +---15lines ---{-------------------------------

      }


      class ABC and function d should not get folded unless I give the command zc to it.
      While for struct a,b,c It should behave like set foldclose=all. i.e as soon as I leave the struct, it should automatically close.

      In simple words, How can I have some selected functions to behave like foldclose switched on and some other functions to behave like foldclose switched off.

      I tired this, but either all behaves as foldclose=all or foldopen=all. I also tried to select some function and issue the command :'<,'>foldclose, but it did not work.

      Is there any way out.

      Regards,
      shankar
    Your message has been successfully submitted and would be delivered to recipients shortly.