如何在 Eclipse 中启用列选择模式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1053725/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 18:49:06  来源:igfitidea点击:

How do I enable the column selection mode in Eclipse?

eclipseidetext-editoreclipse-3.5

提问by vobject

News wrote that Eclipse 3.5 finally supports column selection. Unfortunately I don't know HOW to enable it. I tried pressing the ALT-key like I am used to in Visual Studio and all other Microsoft products but that had no effect.

新闻写道,Eclipse 3.5 终于支持列选择。不幸的是,我不知道如何启用它。我尝试像在 Visual Studio 和所有其他 Microsoft 产品中习惯的那样按下 ALT 键,但没有任何效果。

How can I mark a vertical block in Eclipse?

如何在 Eclipse 中标记垂直块?

回答by RichieHindle

To activatethe cursor and select the columns you want to select use:

激活光标并选择要选择的列,请使用:

Windows: Alt+Shift+A

Mac: command+ option+ A

Linux-based OS: Alt+Shift+A

Windows系统: Alt+ Shift+A

苹果:command+ option+A

基于Linux的操作系统: Alt+ Shift+A

To deactivate, press the keys again.

停用,请再次按下这些键。

This information was taken from DJ's Java Blog.

此信息取自DJ 的 Java 博客

回答by Geoffrey Wiseman

On Windows and Linux, it's AltShiftA, as RichieHindle pointed out. On OSX it's OptionCommandA(??A). It's also worth noting that the two modes can have different font preferences, so if you've changed the default text font, it can be jarring to toggle block selection modes and see the font change.

在 Windows 和 Linux 上AltShiftA,正如 RichieHindle 指出的那样。在 OSX 上是OptionCommandA( ??A)。还值得注意的是,这两种模式可以具有不同的字体首选项,因此如果您更改了默认文本字体,则切换块选择模式并查看字体更改可能会很刺耳。

Finally, the "search commands" (Ctrl3or Command3) pop-up will find it for you if you type block. This is useful if you use the feature just frequently enough to forget the hotkey.

最后,如果您键入 block ,“搜索命令”(Ctrl3Command3)弹出窗口将为您找到它。如果您使用该功能的频率足以忘记热键,这将非常有用。

回答by Peter Ajtai

As RichieHindle pointed outthe shortcut for column (block) selection is Alt+Shift+A. The problem I ran into is that the Android SDK on Eclipse uses 3 shortcuts that all start with Alt+Shift+A, so if you type that, you'll be given a choice of continuing with D, S, or R.

正如 RichieHindle 指出的列(块)选择的快捷方式是Alt+Shift+A. 我遇到的问题是,在Android SDK的Eclipse使用3个快捷键,所有的下手Alt+Shift+A,所以如果你键入,你会得到与持续的选择DSR

To solve this I redefined the column selection as Alt+Shift+A,A(Alt, Shift, Apressed together and then followed by a subsequent A). To do this go to Windows > Preferencesthen type keysor navigate to General > Keys. Under the Keysenter the filter textof block selectionto quickly find the shortcut listing for toggle block selection. Here you can adjust the shortcut for column selection as you wish.

为了解决这个问题,我将列选择重新定义为Alt+Shift+A,A( Alt, Shift,A压在一起,然后是后续的A)。为此,请转到Windows > Preferences然后键入keys或导航到General > Keys。在Keys 下输入filter textofblock selection以快速找到 的快捷方式列表toggle block selection。您可以在此处根据需要调整列选择的快捷方式。

回答by Jawad Zeb

First of all your mouse key must be focus in editor to enable Toggle Block Selection Mode

首先你的鼠标键必须在编辑器中聚焦以启用切换块选择模式

enter image description here

在此处输入图片说明

Click on toggleButtonas shown in figure and it will enable Vertical selection. After selection toggle it again.

toggleButton如图点击,就会出现enable Vertical selection。选择后再次切换。

回答by javamonkey79

Additionally, you can change the keys view window -> preferences then type: 'keys' and when the key preference page opens you can type 'toggle block selection' and voila!

此外,您可以更改键视图窗口 -> 首选项,然后键入:“键”,当键首选项页面打开时,您可以键入“切换块选择”,瞧!

回答by jklp

You can enable and disable column editing mode via the keyboard shortcut ALT-SHIFT-A.

您可以通过键盘快捷键启用和禁用列编辑模式ALT-SHIFT-A

Once enabled you can then use either the mouse to select a block of text, or the keyboard using SHIFT(like a normal keyboard select, except the selection will now be in a block).

启用后,您可以使用鼠标选择文本块,或使用键盘SHIFT(与普通键盘选择一样,但选择现在位于块中)。

If you've changed your default font for text editing, entering column editing mode will probably change your screen font to the default column editing font (which is probably different to your changed font. To change the font when in column editing mode, go to the menu and select Window -> Preferences, then in the tree on the left hand side, pick General -> Appearance -> Colors and Fonts, and then pick Basic -> Text Editor Block Selection Fonton the right hand side tree. You can then select the font to be consistent with your "not in column editing mode" font.

如果您更改了文本编辑的默认字体,进入列编辑模式可能会将您的屏幕字体更改为默认的列编辑字体(这可能与您更改的字体不同。要在列编辑模式下更改字体,请转到菜单并选择Window -> Preferences,然后在树的左侧,挑General -> Appearance -> Colors and Fonts,再挑Basic -> Text Editor Block Selection Font上右手边的树。然后,您可以选择字体要与你的“不列编辑模式”字体一致。

回答by HRJ

A different approach:

一种不同的方法:

The vrapperplugin emulates viminside the Eclipse editor. One of its features is visual blockmode which works fine inside Eclipse.

vrapper插件模拟vimEclipse编辑器内。它的功能之一是visual block在 Eclipse 中运行良好的模式。

It is by default mapped to Ctrl-Vwhich interferes with the paste command in Eclipse. You can either remap the visual blockmode to a different shortcut, or remap the pastecommand to a different key. I chose the latter: remapped the pastecommand to Ctrl-Shift-Vto match my terminal's behavior.

它默认映射到Ctrl-V干扰 Eclipse 中的粘贴命令。您可以将visual block模式重新映射到不同的快捷键,或者将paste命令重新映射到不同的键。我选择了后者:重新映射paste命令Ctrl-Shift-V以匹配我终端的行为。

回答by S Krishna

  • Press Alt + Shift + A
  • Observe that the screen zooms out
  • Make selection using the mouse
  • Press Alt + Shift + A to go back to the old mode. enter image description here
  • 按 Alt + Shift + A
  • 观察屏幕缩小
  • 使用鼠标进行选择
  • 按 Alt + Shift + A 返回旧模式。 在此处输入图片说明