How to make a hierarchical structure of folds/collapses in the text editor?

79 Views Asked by At

I want to format this:

# 1 =====
tibble()
## 1.1 ====
tibble()
### 1.1.1 ====
tibble()
# 2 =====
tibble()
## 2.1 ====
tibble()
### 2.1.1 ====
tibble()

If I collapse # 1 and # 2, I would like to get:

# 1 =====
# 2 =====

But instead I just get this:

# 1 =====
## 1.1 ====
tibble()
### 1.1.1 ====
tibble()
# 2 =====
## 2.1 ====
tibble()
### 2.1.1 ====
tibble()

Is it possible to have multiple "levels" of folding in rstudio?

My purpose is this: I have some long code with multiple folds inside and it has to be repeated 32 times. I would like to be able to fold all those 32 instances without losing the foldability of the inside contents of each of the 32 instances.

0

There are 0 best solutions below