1

I have these two functions

  void function_one(){
    return;
  }

  void function_two()
  {
    return;
  }

when I use zM to fold the functions I get

  +--  3 lines: void function_one(){--

  void function_two()
  +--  3 lines: {-

the function_two doesn't get a nice folding, How I can get the same folding as for function_one in function_two?

PD: I use two code styles, curly brackets on same line as function name and curly braces under the function name, because some projects use one code style and other projects use the other code style.

  • I assume this is C or C++? – Martin Tournoij Nov 10 '16 at 18:15
  • @Carpetsmoker yes, both c and c++ – juanpablo Nov 10 '16 at 19:03
1

I did define VimFold4C that tries its best to fold C & C++ codes. The caveat is when we are modifying the code: I'm using caches in order to speed up the fold processing, but alas it has quirks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.