如何在 Eclipse IDE 编辑器中设置一行代码的快捷方式

How to set shortcut to a line of code in Eclipse IDE editor(如何在 Eclipse IDE 编辑器中设置一行代码的快捷方式)

本文介绍了如何在 Eclipse IDE 编辑器中设置一行代码的快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找 Eclipse 中的一个功能,它允许我为一行分配一个快捷方式(比如第 55 行),然后转到同一个文件中的其他位置并点击快捷方式,然后 IDE 向我显示第 55 行.我用过Delphi IDE 中的此功能.使用 CNTL + 数字键 [1,2,...,0] 将创建光标所在行的快捷方式.此快捷方式仅在编辑器内有效,每个打开的文件都有自己的快捷方式.eclipse有这样的功能吗?是否有任何插件可以将此功能添加到eclipse?

I'm after a feature in eclipse that allows me to allocate a shortcut to a line (say line number 55) then go somewhere else in the same file and hit the shortcut then IDE shows me the line 55. I have used this feature in Delphi IDE. Using CNTL + number keys[1,2,...,0] a shortcut to line where the curser is will be created. This shortcut only has effect within the editor and each opened file would have its own shortcuts. Is there such a feature in eclipse? Is there any plugins out there which adds this feature to eclipse?

问候,

阿里

推荐答案

默认情况下,没有为此任务定义快捷方式.我用来在 Eclipse 中定义我的快捷方式,在过滤器文本中的Windows/Preferences/General/Keys"中键入书签,然后选择要定义快捷方式的命令.

By default there is no shortcut defined for this task. I use to define my shortcuts in Eclipse in "Windows/Preferences/General/Keys" type bookmark in the filter text and select the commands you want to define the shortcuts.

我目前的快捷方式是:

  1. Alt+Shift+B、Alt+Shift+A:添加书签;
  2. Alt+Shift+B、Alt+Shift+V:显示视图(书签);
  1. Alt+Shift+B, Alt+Shift+A: Add Bookmark;
  2. Alt+Shift+B, Alt+Shift+V: Show View (BookMarks);

但是,我同意,仍然不如 Delphi 预定义的快捷方式快.

But, I agree, still is not fast as the Delphi predefined shortcuts.

更新 1:这个插件(或其继承者)似乎提供了这个选项.从他们的网站:

Update 1: This plugin (or its sucessor) seems to offer the option. From their site:

  • 在光标处添加编号书签:Alt>+[digit].这创建了一个使用单次"按键快速添加指定编号的书签.工作区中只能存在一个给定编号的书签.再次设置相同的号码书签将清除之前的实例.

  • Add a numbered bookmark at the cursor: Alt>+[digit]. This creates a quick bookmark with the specified number using a "single" keypress. Only one bookmark of the given number can be present in the workspace. Setting the same number bookmark again will clear the earlier instance.

转到编号书签:Alt+Shift+[数字].移至书签为它是使用 Alt+[digit] 设置的.

Goto a numbered bookmark: Alt+Shift+[digit]. Moves to the bookmark as it was set using Alt+[digit].

更新 2:经过测试(Eclipse Indigo),它就像一个魅力.

Update 2: Tested (Eclipse Indigo) and it worked like a charm.

这篇关于如何在 Eclipse IDE 编辑器中设置一行代码的快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何在 Eclipse IDE 编辑器中设置一行代码的快捷方式