Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • foldtext() must be global, just enable fold in vimrc locally for rust filetype. Thanks, the question's answered, but I have another, how to persist hi for fold of each filetype, I find that each fold needs different highlight style for it. I'll open another question. Commented Nov 5, 2018 at 3:40
  • foldtext is a local option in vim, so not sure what you mean by must be global (windows for which it is not globally set retain the default). Do ask another question for your second one. Commented Nov 5, 2018 at 3:46
  • I see, so each object in vim is local meaning we can use setlocal to map it to a local variable? I setlocal foldtext=RustFoldText() and it only works this way, plus s:RustFoldText() in define the function and setlocal make RustFoldText isn't applied. Commented Nov 5, 2018 at 3:51
  • I’m not sure i quite follow what youre saying... take a look at the help in vim and see if you can answer your questions Commented Nov 5, 2018 at 4:23