如何告诉 PHPEclipse 使用空格而不是制表符
我刚刚从 PDT 切换回 PHPEclipse(因为 PDT 对我来说太不稳定),但现在我遇到的问题是我不知道如何告诉 PHPEclipse 用空格而不是制表符缩进 PHP 代码。我已在以下首选项位置启用了空格的使用:
PHPEclipse/PHP/Formatter/ (Unchecked "Indentation is represented by a tab")
General/Editors/Text Editors/ (Checked "Insert spaces for tabs")
*.php 文件仅与 PHPEclipse 编辑器和标准文本编辑器关联。 PHPEclipse 首选项页面显示“一些常规首选项现在位于文本编辑器页面上”,因此听起来 PHPEclipse 应该使用常规文本编辑器首选项。但它就是行不通。 PHPEclipse 始终使用制表符而不是空格。
有什么提示可以让它使用空格吗?
I just switched back from PDT to PHPEclipse (Because PDT is too unstable for my taste) but now I have the problem that I can't find out how to tell PHPEclipse to indent PHP code with spaces instead of tabs. I have enabled the usage of spaces in the following preference locations:
PHPEclipse/PHP/Formatter/ (Unchecked "Indentation is represented by a tab")
General/Editors/Text Editors/ (Checked "Insert spaces for tabs")
*.php Files are only associated with the PHPEclipse editor and the standard text editor. The PHPEclipse preferences page says "Some general preferences now live on the Text Editors pages" so it sounds like PHPEclipse should use the general text editor preferences. But it just doesn't work. PHPEclipse always uses tabs instead of spaces.
Any hints how I can get it to use spaces?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
刚刚将 PHPEclipse 添加到我的 Eclipse 中,似乎以下内容应该对您有帮助:
“键入”是选项卡的名称。有设置“为制表符插入空格(请参阅代码格式化程序首选项页面”,选中它,您将得到空格而不是制表符;)
just added PHPEclipse to my Eclipse, seems that the following should help you:
"Typing" is name of tab. There is setting "Insert spaces for tab (see Code Formatter preference page", check it and you will get spaces instead of tabs ;)
我尝试了 eclipse-php 3.0.2:
I tried ok for eclipse-php 3.0.2:
以下内容对我有用(也安装了 PHP Symfony)。
我的Eclipse版本:Eclipse SDK 4.2.2
安装的
说明
Eclipse内置配置文件在预览中具有制表符缩进;而 Symfony 内置配置文件每个缩进有 4 个空格。
The following worked for me (PHP Symfony also installed).
My version of Eclipse: Eclipse SDK 4.2.2
Installed
Instructions
The Eclipse built-in profile had tab indents in the preview; whereas the Symfony built-in profile has 4 spaces for each indent.
我正在使用 Eclipse 3.8.1。
以下对我有用:
I'm using eclipse 3.8.1.
Following worked for me: