folding

Sublime Text 3 Multiline Method Folding

断了今生、忘了曾经 提交于 2021-02-07 14:29:24
问题 SO... Sublime Text has the built in ability to fold methods, but as soon as the method declaration spans multiple lines it loses this ability. Does anyone know about a plugin or a way to make this work? Specifically I am running into this with ruby (and my team adheres to a strict style guide regarding line length), but the language shouldn't matter. 回答1: Instead of clicking on the down arrow that appears in the gutter next to the first line of the function definition, all you need to do is

Sublime Text 3 Multiline Method Folding

白昼怎懂夜的黑 提交于 2021-02-07 14:21:11
问题 SO... Sublime Text has the built in ability to fold methods, but as soon as the method declaration spans multiple lines it loses this ability. Does anyone know about a plugin or a way to make this work? Specifically I am running into this with ruby (and my team adheres to a strict style guide regarding line length), but the language shouldn't matter. 回答1: Instead of clicking on the down arrow that appears in the gutter next to the first line of the function definition, all you need to do is

Three curly brackets together in php source code

一笑奈何 提交于 2020-01-10 17:13:53
问题 I just downloaded complete source code of PHP from php.net (PHP 5.4.0 [tar.bz2]). They are often using three curly brackets together as given below (The following code snippet extracted form ext/ctype/ctype.c.) /* {{{ proto bool ctype_digit(mixed c) Checks for numeric character(s) */ static PHP_FUNCTION(ctype_digit) { CTYPE(isdigit); } /* }}} */ Does anyone have the idea why they are using these three curly brackets together? 回答1: They are vim fold markers, they make it easy to collapse and

How to save collapsed / folded code in Sublime Text after removal of bufferscroll plugin

拜拜、爱过 提交于 2020-01-01 05:06:28
问题 Is there a way to save/sync collapsed code from session to session in Sublime Text 3, now that the BufferScroll plugin has been removed? 回答1: Here's the background story (I can't find the link, the author might have deleted it, so I'm paraphrasing). Basically, the author of Package Control requested that, instead of using dates as version numbers (such as 2016.03.18.06.34.41 for the most recent version of BufferScroll), package authors should use semantic versioning similar to how Github

What is the recommended way to use Vim folding for Python code

别来无恙 提交于 2019-12-31 07:52:26
问题 I am interested in enabling code folding in Vim for Python code. I have noticed multiple ways to do so. Does anyone have a preferred way to do Python code folding in Vim? I.e, Do you have a particular Vim plugin that you use and like? Do you use manual folding or do you place markers in comments? Any other recommended ways to do code folding for Python in Vim? 回答1: Personally I can't convince myself to litter my code with the markers. I've become pretty used to (and efficient) at using indent

Example of the difference between List.fold and List.foldBack

爷,独闯天下 提交于 2019-12-29 07:27:30
问题 My understanding of the difference between List.fold and List.foldBack is that foldBack iterates over its list in a reverse order. Both functions accumulate a result from the items in the list. I'm having trouble coming up with a good example where it is preferable to foldBack over a list. In the examples I have come up with, the results are the same for both fold and foldBack, if the function logic does the same thing. [<Fact>] let ``List.foldBack accumulating a value from the right to the

Feature request for a text-editor with support for literate programming [closed]

好久不见. 提交于 2019-12-25 04:45:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 years ago . This is a feature request for the writers of Visual Studio and any other programmer's editor. Consider a literate program as follows: /* File Name: LiterateProgram.h */ // \begin{comment} #pragma once #include "myHeader.h" /* \end{comment} %\bigskip \begin{lstlisting} % */ class CSomeClass : public CSomeBase {

Vim folding every line ending in { but not classes

扶醉桌前 提交于 2019-12-24 08:51:16
问题 I intend to fold all the lines ending in { but not classes. So far I have came up with this command : :%g/.\{-}\(class\)\@!.*{$/normal! zf% But this would match also the lines containing class . 回答1: There are several problems: From :help /\@! : "You can't use "\@!" to look for a non-match before the matching position". Use \@<! , include the possible characters in between in there, and drop the useless (because it's not anchored) non-greedy first match. The :global command places the cursor

Is it possible to display nested sections in a collapsed fold with vim?

淺唱寂寞╮ 提交于 2019-12-24 04:10:38
问题 When a fold is collapsed in vim, all of the nested headings are hidden away so that you can't see what's inside. I'm curious if anyone knows if it's possible or has a solution for foldtext function (or through another method) that can display the sections inside a fold when a fold is collapsed. I'm looking for something that would display folds more like this: + -- 2000 TopSection1 " Fold Level 1 + --- 500 TopSection1 : ChildSection1 " Fold Level 2 + ---- 50 TopSection1 : ChildSection1 :