标签: folding

如何在vim中折叠{{{和}}}之间的所有代码

我有很多这样的代码

#{{{
code here
#}}}

#{{{
more code here
#}}}

etc...
Run Code Online (Sandbox Code Playgroud)

我想折叠所有这些而不是去每一#{{{行并输入zfa{.

我阅读了 vim 文档并尝试输入,set foldmethod={{{但出现错误E474: Invalid argument: foldmethod={{{

我在键盘上按什么来告诉 vim 在#{{{和之间折叠所有代码#}}}

我要按什么来再次扩展它们?

vim folding

1
推荐指数
2
解决办法
2923
查看次数

在linux上展开文件

我有一个巨大的文本文件,在liux上有大约400,000行80个字符.

需要"展开"文件,将四行合并成一行,最后有1/4行,每行80*4行长.

有什么建议?

linux file folding

0
推荐指数
1
解决办法
1093
查看次数

PHP文本格式化:检测连续的几个符号

我有一种奇怪的事情,我真的需要我的文本格式化.不要问我为什么我做了这个奇怪的事情!;-)

所以,我的PHP脚本用一个像"|"这样的特殊符号替换所有行折叠"\n".当我将文本数据插入数据库时​​,PHP脚本用符号"|"替换所有行折叠 当脚本从数据库中读取文本数据时,它将替换所有特殊符号"|" 用折叠线"\n".

如果在每个分隔文本中使用超过2行折叠,我想限制文本格式以剪切行折叠.

以下是我希望脚本格式化的文本示例:

this is text... this is text... this is text...this is text...this is text... this is text... this is text... this is text... this is text... this is text...

this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text... this is text...
Run Code Online (Sandbox Code Playgroud)

我想重写格式,如:

this is text... this is text... this is text...this is text...this is text... this is …
Run Code Online (Sandbox Code Playgroud)

php formatting line folding str-replace

0
推荐指数
1
解决办法
372
查看次数

Vim缩进折叠依赖项

我正在尝试启用vim缩进折叠.从我在网上看到的,设置:set fdm=indent应该正常工作.对我来说,它什么都不做.我可以手动折叠,但我对缩进代码非常严格,所以缩进折叠是理想的.我使用空格缩进(每个级别两个空格)

我的〜/ .vimrc看起来像这样:

set foldmethod=indent
Run Code Online (Sandbox Code Playgroud)

并且肯定被装载(根据:scriptnames)

vim是否以某种方式折叠取决于文件类型?我正在写C CUDA,所以扩展名是.cu.我是否必须为缩进折叠安装某种插件?我知道这是一个广泛的问题,但这似乎是基本的功能,我不知道它为什么不起作用.

vim indentation folding

0
推荐指数
1
解决办法
1103
查看次数

标签 统计

folding ×4

vim ×2

file ×1

formatting ×1

indentation ×1

line ×1

linux ×1

php ×1

str-replace ×1