Eclipse/Aptana IDE 下的 Tab 缩进
如何在 Aptana/Eclipse IDE 下启用 Tab 缩进?我很欣赏 Emacs 通过按 TAB 键来缩进代码行的方式,而与当前光标的位置无关。
How to enable tab indentation under Aptana/Eclipse IDEs? I appreciate the way that my Emacs indents lines code by pressing TAB key independently of the current cursor's position.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我通常剪切一些代码,然后将其粘贴到新位置,执行此操作时,代码具有与之前相同的缩进。
要修复此问题,我执行以下操作:
选择一个代码块并按
(将代码移至右侧)选择一个代码块并按
+
(将代码移至左侧)I usually cut some code and then paste it into its new place, when doing this the code has the same indentation that had before.
To fix it I do the following:
Select a block of code and press
<Tab>
(To move the code to the right)Select a block of code and press
<Shift> + <Tab>
(To move the code to the left)如果您位于一行的中间,您可以通过按
Ctrl+i
来缩进,当然,您也可以通过选择文本块并按Ctrl+i< /代码>。
如果是在java文件中,您可以设置更多格式化规则(
Window > Preferences > Java > Code Style > Formatter
),并且可以将其设置为每次保存时自动格式化前往Window >首选项>爪哇>编辑>保存操作
。If you are in the middle of a line you can indent it by pressing
Ctrl+i
, and of course you can do it for a block of text by selecting it and pressingCtrl+i
.If it is in java files, you can set many more formatting rules (
Window > Preferences > Java > Code Style > Formatter
) and you can set it to auto-format whenever you save by going toWindow > Preferences > Java > Editor > Save Actions
.来自eclipse的文档(参见Eclipse 操作)您将找到并进入“智能缩进模式”。如果您在编辑器中按
CTRL + SHIFT + INSERT
,下面的模型行应显示智能缩进
而不是缩进。该模式的首选项在Window > 中定义。首选项>爪哇>编辑>正在输入
。Tab
缩进部分中的复选框表示:“Tab 键调整当前行的缩进”。这听起来不错,但它对我不起作用:-( 我没有找到任何 Eclipse 错误数据库的迹象表明这里有东西被破坏。也许它对你有用。
From the documentation of eclipse (see Eclipse actions) you will find and entry "Smart Indent Mode". If you press
CTRL + SHIFT + INSERT
when inside an editor, the modeline below should showSmart Indent
instead of indent. The preferences of that mode are defined inWindow > Preferences > Java > Editor > Typing
. The checkbox in the section indentation forTab
says: "Tab key adjust the indentation of the current line".That sounds pretty well, but it did not work for me :-( I did not find any indication of the bug database of eclipse that something is broken here. Perhaps it works for you.
在 Aptana 下,您可以通过点击 CTRL + Shift + F 来缩进代码。
Under Aptana, you can indent your code by taping CTRL + Shift + F.