TextMate:删除尾随空格并保存

标签 textmate code-folding

我正在使用脚本删除尾随空格,然后保存文件。

问题是当我使用它时,我所有的代码折叠都会扩展。如何更改命令以保持代码折叠?

最佳答案

您可以使用foldingStartMarker 和foldingStopMarker 来指示TextMate 的折叠。

To define a block that starts with { as the last non-space character on the line and stops with } as the first non-space character on the line, we can use the following patterns:


foldingStartMarker = '\{\s*$';

foldingStopMarker = '^\s*\}';

按 F1 键将折叠存在的任何代码折叠。

引用:http://manual.macromates.com/en/navigation_overview#collapsing_text_blocks_foldings

关于TextMate:删除尾随空格并保存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8785204/

相关文章:

ruby - 使用 Vim Rails,您可以创建一个新的迁移文件并一次性打开它吗?

javascript - 在Textmate中调试javascript

delphi - 当我调用代码格式化程序时,如何避免扩展折叠区域?

vim - 如何在 Vim 上更改折叠部分的颜色

emacs - 与Emacs中的{{{对应的折叠方式是什么?

netbeans - 如何更改 NetBeans 中 html 属性的颜色方案?

ide - Sublime Text 2中是否有与 “Format indenting of selected code”等效的Textmate?

tabs - TextMate 中的选项卡行设置

ios - Xcode 9 展开/折叠大括号/方括号 {} 缺少侧栏

css - 使用@media 为css 条目分组/创建代码折叠时可能会出现任何副作用问题吗?