search

Home  >  Q&A  >  body text

There is no way to fold js code in vim

My code snippet is as shown below

My vim configuration file is as follows:
][3]

At this time, there is no way to fold the code when I press za.

But python functions can be folded normally in python files

Please ask God for answers.

迷茫迷茫2774 days ago689

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-16 16:39:14

    Okay. /syntax/javascript.vim就搞定这个了。
    你的set foldmethod?What is the output?

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 16:39:14

    set shiftwidth

    indent fold-indent

    Automatically define folds by indented lines.

    The folding level is calculated by dividing the line indentation by 'shiftwidth' (rounded down). Consecutive rows with the same or higher folding level form a fold. Within it, rows with higher fold levels form nested folds.

    The number of nesting levels is limited by the 'foldnestmax' option.

    reply
    0
  • Cancelreply