eclipse 在eclipse / aptana中“取消标签”(向左移动一段代码)的键盘快捷键?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1052772/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Keyboard shortcut to "untab" (move a block of code to the left) in eclipse / aptana?
提问by Keith Bentrup
Well, hopefully the question is self-explanatory.
好吧,希望这个问题是不言自明的。
It's so easy to select a block of code and tab out, but how about the reverse?
选择一个代码块并跳出非常容易,但反过来呢?
Currently, I just search & replace for whitespace at the beginning of the line. Anything faster?
目前,我只是在行首搜索并替换空格。有什么更快的吗?
回答by nbevans
In Visual Studio and most other half decent IDEs you can simply do SHIFT+TAB. It does the opposite of just TAB.
在 Visual Studio 和大多数其他不错的 IDE 中,您只需执行SHIFT+ TAB. 它与 just 做相反的事情TAB。
I would think and hope that the IDEs you mention support this as well.
我认为并希望您提到的 IDE 也支持这一点。
回答by Jeremy Smyth
Shift-tab outdents again :)
Shift-tab 再次缩进 :)
Here's where the standard shortcut keys are covered:
以下是标准快捷键的介绍:
http://wiki.eclipse.org/User_Interface_Guidelines#Standard_Accelerators
http://wiki.eclipse.org/User_Interface_Guidelines#Standard_Accelerators
You'll find many of the more esoteric ones here:
你会在这里找到许多更深奥的:
http://wiki.eclipse.org/FAQ_What_editor_keyboard_shortcuts_are_available%3F
http://wiki.eclipse.org/FAQ_What_editor_keyboard_shortcuts_are_available%3F
回答by Ohad Aloni
This workaround works most of the time. It uses eclipse's 'smart insert' features instead:
此解决方法在大多数情况下都有效。它使用 Eclipse 的“智能插入”功能:
- Control X to erase the selected block of text, and keep it for pasting.
- Control+Shift Enter, to open a new line for editing above the one you are at.
- You might want to adjust the tabbing position at this point. This is where tabbing will start, unless you are at the beginning of the line.
- Control V to paste back the buffer.
- 控制 X 擦除选定的文本块,并保留以供粘贴。
- Control+Shift Enter,在您所在的行上方打开一个新行进行编辑。
- 此时您可能需要调整 Tab 键位置。这是 Tab 开始的地方,除非你在行的开头。
- 控制 V 粘贴回缓冲区。
Hope this helps until Shift+TAB is implemented in Eclipse.
希望在 Eclipse 中实现 Shift+TAB 之前这会有所帮助。
回答by mynameistechno
Shift-tab doesn't seem to work on multi-lines in Aptana. It also doesn't work on single lines with a single preceding space. Any workarounds? I use shift-tab (outdent) to fix badly formatted code all the time.
Shift-tab 似乎不适用于 Aptana 中的多行。它也不适用于带有单个前面空格的单行。任何解决方法?我一直使用 shift-tab (outdent) 来修复格式错误的代码。
I miss NetBeans ...
我想念 NetBeans ...
UPDATE: it works on multi-newlines, if the multi-lines have the same level of indentation. It should just continue outdenting the other lines that haven't reached the beginning of the new line yet. Is there an option to change this I wonder?
更新:如果多行具有相同的缩进级别,它适用于多换行符。它应该继续缩小尚未到达新行开头的其他行。我想知道有没有办法改变这一点?
回答by Sanky Cse
In Pycharm Just use Shift+Tab to move a block of code left.
在 Pycharm 中只需使用 Shift+Tab 将代码块向左移动。
回答by Shubham Sharma
Here is a general answer for untab :-
这是 untab 的一般答案:-
In Python IDLE :- Ctrl + [
在 Python IDLE 中:- Ctrl + [
In elipse :- Shitft + Tab
在椭圆中:- Shitft + Tab
In Visual Studio :- Shift+ Tab
在 Visual Studio 中:- Shift+ Tab
回答by Richard Walton
Shift-tab does that in Flex Builder (Based on Eclipse) - SO it hopefully should work in regular eclipse :)
Shift-tab 在 Flex Builder(基于 Eclipse)中做到这一点 - 所以它希望应该在常规 Eclipse 中工作 :)
回答by Luis Parada
In general Shift + Tab works for any environment.
通常 Shift + Tab 适用于任何环境。
回答by Johnny Wales
Don't know if anyone is still looking here, but you can do this by going to Window menu > Preferences, then open the General list, choose keys. Scroll down the list of keys until you see "Shift Left". Click that. Below that you'll see some boxes, one of which lets you bind a key. It won't accept Shift-Tab, so I bound it to Shift-`. Apply-and-close and you're all set.
不知道是否有人还在看这里,但您可以通过转到“窗口”菜单 >“首选项”,然后打开“常规”列表,选择键来完成此操作。向下滚动键列表,直到看到“Shift Left”。单击那个。在其下方您会看到一些框,其中一个框可以让您绑定一个键。它不会接受 Shift-Tab,所以我将它绑定到 Shift-`。申请并关闭,一切就绪。