Questions tagged [folding]

Code folding is a feature of some text editors and IDEs that allow some text to be temporarily hidden or "collapsed" in order to hide detail.

Most text editors and IDEs offer some way of hiding sections of the code in order to traverse the code more easily, only view the code currently being edited, and to show an outline of what code currently is in the file.

What code counts as a section and hence can be hidden, can be user specified or automatically added based on the syntax of the language, indentation or tokens (such as brackets).

454 questions
545
votes
23 answers

Java equivalent to #region in C#

I want to use regions for code folding in Eclipse; how can that be done in Java? An example usage in C#: #region name //code #endregion
Pentium10
  • 204,586
  • 122
  • 423
  • 502
156
votes
18 answers

how to implement regions/code collapse in javascript

How can you implement regions a.k.a. code collapse for JavaScript in Visual Studio? If there are hundreds of lines in javascript, it'll be more understandable using code folding with regions as in vb/C#. #region My Code #endregion
Prasad
  • 58,881
  • 64
  • 151
  • 199
137
votes
9 answers

Confusion about vim folding - how to disable?

When I open the file it looks like this: or even this When I open all folds, they are closed again when I navigated to another buffer and came back. To be able to work with it, I have to apply zR each time when opening a buffer. I have these…
lyuba
  • 6,250
  • 7
  • 27
  • 37
128
votes
12 answers

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

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…
Paul D. Eden
  • 19,939
  • 18
  • 59
  • 63
82
votes
4 answers

How do I enable automatic folds in Vim?

How do I enable automatic folding in Vim? set foldmethod=syntax doesn't seem to do much of anything.
Eric Johnson
  • 17,502
  • 10
  • 52
  • 59
79
votes
7 answers

notepad++ user defined regions with folding

I can't figure out how to configure notepad++ to display regions for user defined keywords. I have a big trace file which shows the start and the end of a procedure. The trace file looks like this: Beginn abc.def; ... Beginn ghi.jkl; ... …
Stephan Schielke
  • 2,744
  • 7
  • 34
  • 40
78
votes
5 answers

Fold function in vim

Is there any way or tools to fold function in vim, like Visual Studio or Eclipse?
Yongwei Xing
  • 12,983
  • 24
  • 70
  • 90
77
votes
8 answers

Intellij, project navigation. Expand all folder and file tree

Is it possible to expand the entire project tree in Intellij? I would like to do this so I can more easily search the structure and jump back and forth between files and folders. I know of double shift, and CTRL+SHIFT+N, but that is not what I am…
mjs
  • 21,431
  • 31
  • 118
  • 200
75
votes
6 answers

How can I automatically fold all functions in a file with vim?

At first, I use the set foldmethod=marker, and move the cursor to the { of one function, use the zf% to fold current function. But there are a lot of functions in this file. How can I fold all functions in this file? And I don't want to fold {} in…
Yongwei Xing
  • 12,983
  • 24
  • 70
  • 90
71
votes
6 answers

How to fold/unfold HTML tags with Vim

Is there some plugin to fold HTML tags in Vim? Or there is another way to setup a shortcut to fold or unfold html tags? I would like to fold/unfold html tags just like I do with indentation folding.
nsbm
  • 5,842
  • 6
  • 30
  • 45
71
votes
2 answers

How can I fold content in Github markdown?

How does github fold text blocks? look at this issuecomment
xiao luo
  • 777
  • 1
  • 5
  • 6
45
votes
2 answers

Python code-folding in emacs?

I have many classes and defs ... I want to have + and - keys before class and def to collapse the class or open it ( toggle it ). How i can do this?
Mohammad Efazati
  • 4,812
  • 2
  • 35
  • 50
40
votes
1 answer

Notepad++ fold all tags by default?

I have a huge XML code that I keep adding to. It has about 13.465 lines of code, and a LOT of tags. To keep everything organised (Because, the code is almost unreadable), I decided I could just fold all my tags and comment as to what they are. Is…
Bugster
  • 1,552
  • 8
  • 34
  • 56
39
votes
8 answers

Scala: how to merge a collection of Maps

I have a List of Map[String, Double], and I'd like to merge their contents into a single Map[String, Double]. How should I do this in an idiomatic way? I imagine that I should be able to do this with a fold. Something like: val newMap =…
Jeff
  • 14,831
  • 15
  • 49
  • 59
36
votes
5 answers

What code folding plugins work on Eclipse 3.6?

I am new to java development environment and I find it difficult to manage my code properly. .Net provides the #regions which is a good solution for code management. I am using Eclipse environment for java development. I tried the Coffee-Bytes but…
Yaqub Ahmad
  • 27,569
  • 23
  • 102
  • 149
1
2 3
30 31