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
9
votes
3 answers

Collapse comments and all functions in vim/gvim

I'm a novice user to vim and I haven't been able to find in the internet how to collapse functions and I've figured out how to collapse the argument list in C with zfa} and zfa). but I can't figure out how to collapse the comments sections. How do…
Andrew Redd
  • 4,632
  • 8
  • 40
  • 64
8
votes
2 answers

Change the text in folds

I noticed that fold texts can show useful information. They usually show something like +-- 5 lines:
-------------------------------------------- Is it possible to change the text in those lines? I noticed that something is…
xralf
  • 3,312
  • 45
  • 129
  • 200
8
votes
3 answers

How to make section in PyCharm

I have just moved to Python from R. In R you can use #new section#### to have the 'new section' as title in the script section list. Then, you could easily find that block of script by hitting this title within "Jump to menu" (see figure). In this…
8
votes
4 answers

How can I share my folds in VIM?

I am in a project with 3 people. We need to have the same folds in Vim for each member. How can I share my folds? [Feedback] I understood one important thing: Google ignores signs, such as {{{, so please google "VIM three braces" to find help about…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
8
votes
2 answers

How can I set Idea collapse too long string?

Look at Eclipse: and in Idea: So, how can I make Idea collapse multiline String like Eclipse?
Senjou Zhu
  • 81
  • 3
8
votes
1 answer

Can I disable code folding in WebStorm?

I want to disable code folding in WebStorm. It's possible to turn off the folding indicators, but the folding itself still works. I'd like to be rid of the whole thing, so it's impossible to activate it in any way. Is this possible? (There aren't…
Tom Seddon
  • 2,648
  • 1
  • 19
  • 28
8
votes
1 answer

How to collapse all blocks of #ifdefs that will not be compiled in Visual Studio?

The problem is the following: the codebase have many files with multiple blocks compiled conditionally for each of target platforms using the #if defined(...) directive. Since the typical programmer is working mainly on one of the platforms it is…
Singulus
  • 1,958
  • 2
  • 16
  • 16
8
votes
2 answers

Android code folding the Switch block

Under Android Studio 1.0.2 is there a way to fold the block of code for a Switch conditional statement? I could not find how to do it online or in File > Settings.
samjesse
  • 378
  • 4
  • 14
8
votes
1 answer

How to disable Eclipse's "auto-folding during typing"?

Eclipse (any version AFAIK) has some weird behavior related to folding in Java code. Suppose I’m editing this class: class A { String field; @Nonnull Object method(){ // whatever } } If folding is enabled and I tell it to collapse…
bogdanb
  • 448
  • 3
  • 10
7
votes
3 answers

gvim automatic show foldcolumn when there are folds in a file

I know you can use set foldcolumn=1 to enable fold column but is there a way to automatic turn it on only when there are folds exist in the file?
Jerry Gao
  • 1,389
  • 3
  • 13
  • 17
7
votes
6 answers

How can I automatically fold a long C code in Vim?

I regularly run into C-codes without folding. It is irritating to read them if there is no folding, particularly with long files. How can I fold them?
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
7
votes
2 answers

Vim folding on syntax for R

I'm working with vim on my linux machine and need code folding to work for R. I have the Vim-R-plusing2 installed to enable passing code from vim into an R session, but the folding does not work when foldmethod=syntax. How do I get folding for R…
Andrew Redd
  • 4,632
  • 8
  • 40
  • 64
7
votes
1 answer

How do I get Code Folding in Vim for shell scripts working

Whatever I do, I don't seem to get syntax folding running for shell scripts. So I have a file called abc.sh call :let g:sh_fold_enabled=7 :let g:is_bash=1 :set foldmethod=syntax But it still can't find any folds. Why is that?
hgiesel
  • 5,430
  • 2
  • 29
  • 56
7
votes
3 answers

Outline or fold mode for editing Emacs Lisp code

Is there a minor mode that I can use in combination with Emacs-Lisp mode such that each function definition can be switched on or off easily without inserting special code in the text file? for instance (defun test1() (message "Hi!")) (defun…
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
7
votes
2 answers

In Scala, how to foldleft when sometimes two elements should not turn into one element?

I have a list of Pair's which represent lines with a start index and end index. The type is (Int,Int) being a tuple of two integers. Now I wish to join together any lines which are touching each other, for example. List( (1,5),(6,10),(12,20) )…
Phil
  • 46,436
  • 33
  • 110
  • 175