Keyboard shortcut to “untab” (move a block of code to the left) in eclipse / aptana?

删除回忆录丶 提交于 2019-11-28 13:38:34

问题


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?


回答1:


In Visual Studio and most other half decent IDEs you can simply do SHIFT+TAB. It does the opposite of just TAB.

I would think and hope that the IDEs you mention support this as well.




回答2:


Shift-tab outdents again :)

Here's where the standard shortcut keys are covered:

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




回答3:


This workaround works most of the time. It uses eclipse's 'smart insert' features instead:

  1. Control X to erase the selected block of text, and keep it for pasting.
  2. Control+Shift Enter, to open a new line for editing above the one you are at.
  3. 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.
  4. Control V to paste back the buffer.

Hope this helps until Shift+TAB is implemented in Eclipse.




回答4:


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.

I miss 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?




回答5:


In Pycharm Just use Shift+Tab to move a block of code left.




回答6:


Here is a general answer for untab :-

In Python IDLE :- Ctrl + [

In elipse :- Shitft + Tab

In Visual Studio :- Shift+ Tab




回答7:


Shift-tab does that in Flex Builder (Based on Eclipse) - SO it hopefully should work in regular eclipse :)




回答8:


In general Shift + Tab works for any environment.




回答9:


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.



来源:https://stackoverflow.com/questions/1052772/keyboard-shortcut-to-untab-move-a-block-of-code-to-the-left-in-eclipse-apt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!