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
19
votes
2 answers

Copy & paste folded text in Visual Studio Code

Given the following text Node1_L1 Node1_L2 Node2_L2 Node2_L1 Node3_L2 Node1_L3 Node2_L3 Node4_L2 Node3_L3 Node4_L3 Node3_L1 Node5_L2 Node6_L2 I can use vscode's built-in folding feature to fold it to look like so +…
NoaHammer
  • 322
  • 2
  • 9
19
votes
3 answers

How can I disable code folding in vim with vim-latex?

I have tried the usual approaches, and have read :help tex.vim (see : http://vimdoc.sourceforge.net/htmldoc/syntax.html ) I've taken a brief look at syntax/tex.vim, but can't see how to disable it without rebuilding vim without folding. I'm sick of…
James Broadhead
  • 1,878
  • 1
  • 16
  • 19
18
votes
3 answers

Python code folding with Vim

I have tried a bunch of Python code folding plugins and I have seen this question asked once here, but they all don't seem to be too useful to achieve Python code folding in this manner: class myClass(models.Model): [folded code] class…
Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
18
votes
3 answers

How do I fold code for comment blocks inside method blocks?

How can I fold comment blocks inside method blocks to be folded (outlined), just like methods and regions, etc.?
camainc
  • 3,750
  • 7
  • 35
  • 46
18
votes
2 answers

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

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…
Mike Coxeter
  • 589
  • 1
  • 6
  • 18
17
votes
2 answers

Excel Create Collapsible Indented Row Hierarchies

I would like to create indented collapsible row hierarchies in Excel for my spreadsheet. I have used group function but that becomes hard to manage for me. Here is an example of what I am trying to create: https://www.youtube.com/watch?v=CBJY83PTiXs
user2533460
  • 349
  • 3
  • 7
  • 20
16
votes
2 answers

EMACS folding/unfolding R code

Is there an Emacs minor-mode (or piece of elisp code) that lets you selectively hide/show environments while in Sweave (Sweave = R + LaTeX)? For instance, I would like to move to the beginning of a code block (<<>>), hit a keystroke, and have the…
Riccardo
  • 1,885
  • 3
  • 15
  • 22
16
votes
3 answers

How can I fold YAML items in VIM?

I have a YAML formatted text file, and would like to define custom folding for VIM, but I'm not sure how to go about it (despite reading the VIM documentation for folding). The file consists of YAML "documents", like so: --- title: My Title attr1:…
wkranec
  • 163
  • 1
  • 5
15
votes
4 answers

Is it possible to display page feed symbols differently in Vim?

One of the nice things about Vim is that one can insert a page feed symbol (Ctrl-L in Insert mode), which delegates the printer to start printing the following on a new page. It shows as ^L in text. Is it possible to make this symbol show as…
Rook
  • 60,248
  • 49
  • 165
  • 242
15
votes
3 answers

IntelliJ IDEA plugin to fold .conf files?

I have a Scala app built with Lift framework. It has a few .conf files. When I open those .conf files in my IntelliJ IDEA Ultimate Fancy Pants Edition, I do not see any buttons to fold those curly braces in those files. Hotkeys do not do it either.…
Vasily802
  • 1,703
  • 2
  • 18
  • 35
15
votes
1 answer

Code folding for LaTeX in Emacs

Is there an Emacs minor-mode (or piece of elisp code) that lets you selectively hide/show environments while in LaTeX mode? For instance, I would like to move to the beginning of a long \begin{figure} block, hit a keystroke, and have the contents of…
ShreevatsaR
  • 38,402
  • 17
  • 102
  • 126
15
votes
3 answers

How can I fold GNU C style functions in Vim correctly?

When writing C code, I use a mixture of GNU and K&R style. This means that the return value, each parameter and the opening body curly brace of a function is on its own line. I would also like to use Vim's folding feature but with foldmethod=syntax,…
matthias
  • 2,161
  • 15
  • 22
14
votes
1 answer

Syntax-highlight Python in a vim fold line

I have found that code-folding helps me organize my files better. Thus, at the bottom of my ~/.vimrc, I enable vim code folding by default: ""Folding set foldmethod=indent set foldnestmax=2 nnoremap za vnoremap zf "set nofoldenable …
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174
14
votes
2 answers

PhpStorm define collapsible code regions (Visual Studio style Regions) possible?

In Visual Studio you can use #region and #endregion to wrap developer defined blocks of code. I would love to see this functionality in PhpStorm, it is an ideal way to organise a large source file (for example lots of interface implementations). Is…
Gavin
  • 2,153
  • 2
  • 25
  • 35
14
votes
3 answers

How to disable code folding in Visual C++ 2010

Does anyone know how to disable code folding in Visual C++ 2010? In the 2008 version I used to disable it by unchecking a certain check box, but this seems to be removed. I tried to get these How to permanently disable region-folding in Visual…
yep me
  • 141
  • 1
  • 3
1 2
3
30 31