百度 此外,从美国经济的角度看,经过十年扩张,2001年,美国的经济增长已经从顶峰开始跌落。
A feature which lets visually hide (and toggle) regions of a text file, by replacing its contents with a single outline line.
252 questions
1
vote
1
answer
44
views
Autofold particular blocks when editing particular filetype?
I'm writing a lot of code in D and I would like to be able to auto-fold the unittest {} blocks in *.d files, but not any other types of blocks. How should I go about it?
Example:
string hello_world() {...
0
votes
1
answer
38
views
Automatic fold opening when jumping to a folded section
I often use my code completely folded just to grasp the main structure. When fixing some error I go directly to the line with nG where n is the line number (sometimes I also use :n, or even nvim +n ...
0
votes
1
answer
29
views
Automatically folding regions of tikzpicture in tex files in init.lua
Trying to automatically fold blocks in my tex file that look like
\begin{center}
\begin{tikzpicture}[scale=0.2]
\tikzstyle{every node}+=[inner sep=0pt]
\draw [black] (23.5,-26) circle (3);
\draw [...
0
votes
1
answer
39
views
Help in defining a simple custom fold expr
I am trying to understand the mechanism of foldings, but I am but puzzled on why the following snippet won't work:
vim9script
&l:foldcolumn = 2
if &l:foldmethod != 'diff'
&l:foldmethod =...
1
vote
2
answers
68
views
Manual fold vs. expr fold
I think I do not have a very clear idea of the use case for foldmethod=expr, so for folding my C,C++ and Verilog code for which I use use the following indentations:
C,C++
if (a_condition) {
// a ...
1
vote
1
answer
94
views
How to enable fold by indent [closed]
I would like to enable content folding by indent.
e.g.
aaaa
bbbb
bbbb
cccc
can be fold to
aaaa
bbbb
bbbb
or even further
aaaa
So far I have set in .vimrc
set shiftwidth=0
set tabstop=2
...
1
vote
1
answer
107
views
Highlighting lines containing fold-markers when fold is open
When Vim/Neovim is configured to use markers as foldmethod, it highlights the line containing the marker if the fold is closed. When the fold is opened, the lines containing the markers look the same ...
0
votes
1
answer
39
views
Open top level fold while keeping inner ones closed
I used :%g /{/ normal! zf% to recursively create folds in a very unusual header file which is parsed by an application. It is supposed to be manually edited but is currently +8k lines and for ...
1
vote
0
answers
407
views
New foldtext syntax highlighting in Neovim 0.10
I really like the new vim.o.foldtext="" functionality that enables syntax highlighting. However, I am unsure how to modify it to show not only the first line of the fold but also the number ...
0
votes
1
answer
43
views
What does this command do?
In vim fandom wiki I found this command:
nnoremap \z :setlocal foldexpr=(getline(v:lnum)=~@/)?0:(getline(v:lnum-1)=~@/)\\|\\|(getline(v:lnum+1)=~@/)?1:2 foldmethod=expr foldlevel=0 foldcolumn=2<CR&...
0
votes
1
answer
26
views
How to set the foldlevel differently for function and class when loading a Python file?
To have an overview of a Python script I like to have:
The global functions folded (foldlevel 0)
The classes unfolded and all their methods folded (foldlevel 1)
def foo():
print("foo")
...
4
votes
2
answers
512
views
Disable Vim folding for short files
From the multiple questions on various SE sites, I can disable all folding by e.g. putting set nofoldenable in ~/.vimrc. Is there a way to have folding enabled for large files, say >100 lines, and ...
0
votes
2
answers
122
views
How to see all the sections when folding Markdown?
I use Neovim without any extra Markdown plugin.
With the option let g:markdown_folding = 1 my Markdown document is automatically folded, but only the h1 headers are displayed. I'd like all the headers ...
2
votes
2
answers
106
views
Is it possible to totally hide folded lines?
As title , folded lines usually displays as one line , with the content configurable; is it possible to hide folded lines totally?
And of course, I’d hope there’s still a way to unfold them, for ...
0
votes
1
answer
94
views
Is there a setting for maximum indent level?
After setting manual fold by indent with set foldmethod=indent, I found that seems the max indent level is around 20, i.e. more than 20 levels will collapse together.
May I know if there is a setting ...