在 Eclipse 中更改字体大小的键盘快捷键?

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

Keyboard shortcut to change font size in Eclipse?

eclipsefontsfont-size

提问by Doug

It is relatively straightforward to change font sizes in Eclipse through preferences (and answered several times in this forum).

在 Eclipse 中通过首选项更改字体大小相对简单(并在本论坛中多次回答)。

However I'd like to change font size quickly (e.g., with Ctrl++and Ctrl+-like in Linux terminal or Ctrl+mouse wheelin MS Office apps). Is there a way to do this in Eclipse?

但是我想快速更改字体大小(例如,在 Linux 终端中使用Ctrl++Ctrl+-或在 MS Office 应用程序中使用Ctrl+ mouse wheel)。有没有办法在 Eclipse 中做到这一点?

回答by ROMANIA_engineer

Eclipse Neon (4.6)

日食霓虹灯 (4.6)

Zoom In

放大

Ctrl++

Ctrl++

or

或者

Ctrl+=

Ctrl+=

Zoom Out

缩小

Ctrl+-

Ctrl+-

This feature is described here:

此处描述此功能:

In text editors, you can now use Zoom In (Ctrl++or Ctrl+=)and Zoom Out (Ctrl+-)commands to increase and decrease the font size. Like a change in the General > Appearance > Colors and Fonts preference page, the commands persistently change the font size in all editors of the same type. If the editor type's font is configured to use a default font, then that default font will be zoomed.

在文本编辑器中,您现在可以使用放大(Ctrl++Ctrl+ =缩小(Ctrl+ -命令来增大和减小字体大小。就像在 General > Appearance > Colors and Fonts 首选项页面中的更改一样,这些命令会在所有相同类型的编辑器中持续更改字体大小。如果编辑器类型的字体配置为使用默认字体,则该默认字体将被缩放。

So, the font size change is not limited to the current file and the new value of the font size is available here Window> Preferences> General> Appearance> Colors and Fonts.

因此,字体大小的更改不仅限于当前文件,字体大小的新值可在Window> Preferences> General> Appearance> Colors and Fonts 中获得

回答by Mohamed El-Beltagy

I know it has been long since the original question was posted, but for future reference: check this project, https://github.com/gkorland/Eclipse-FontsI have used it, and it's very simple and efficient.

我知道自从最初的问题发布以来已经很久了,但为了将来参考:检查这个项目,https: //github.com/gkorland/Eclipse-Fonts我已经使用了它,它非常简单和高效。

回答by Marcel Valdez Orozco

Take a look at this project: http://code.google.com/p/tarlog-plugins/downloads/detail?name=tarlog.eclipse.plugins_1.4.2.jar&can=2&q=

看看这个项目:http: //code.google.com/p/tarlog-plugins/downloads/detail?name=tarlog.eclipse.plugins_1.4.2.jar&can=2&q=

It has some other features, but most importantly, it has Ctrl++and Ctrl+-to change the font size, it's awesome.

它还有一些其他功能,但最重要的是,它有Ctrl++Ctrl+-来改变字体大小,非常棒。

回答by Naveed Ahmad

The Eclipse-Fontsextension will add toolbar buttons and keyboard shortcuts for changing font size. You can then use AutoHotkey to make Ctrl+Mousewheelzoom.

Eclipse的字体扩展将添加工具栏按钮和键盘快捷键改变字体大小。然后您可以使用 AutoHotkey 进行Ctrl+鼠标滚轮缩放。

Under Help | Install New Software...in the menu, paste the update URL (http://eclipse-fonts.googlecode.com/svn/trunk/FontsUpdate/) into the Works with:text box and press Enter. Expand the tree and select FontsFeatureas in the following image:

帮助下 | Install New Software...在菜单中,将更新 URL ( http://eclipse-fonts.googlecode.com/svn/trunk/FontsUpdate/)粘贴到Works with:文本框中,然后按Enter。展开树并选择FontsFeature,如下图所示:

Eclipse extension installation screen capture

Eclipse 扩展安装屏幕截图

Complete the installation and restart Eclipse, then you should see the Atoolbar buttons (circled in red in the following image) and be able to use the keyboard shortcuts Ctrl+-and Ctrl+=to zoom (although you may have to unbind those keys from Eclipse first).

完成安装并重新启动 Eclipse,然后您应该会看到A工具栏按钮(下图中以红色圈出)并且能够使用键盘快捷键Ctrl+-Ctrl+=进行缩放(尽管您可能需要从 Eclipse 取消绑定这些键第一的)。

Eclipse screen capture with the font size toolbar buttons circled

带有圆圈字体大小工具栏按钮的 Eclipse 屏幕截图

To get Ctrl+MouseWheelzooming, you can use AutoHotkeywith the following script:

要获得Ctrl+MouseWheel缩放,您可以使用AutoHotkey和以下脚本:

; Ctrl+MouseWheel zooming in Eclipse.
; Requires Eclipse-Fonts (https://code.google.com/p/eclipse-fonts/).
; Thank you for the unique window class, SWT/Eclipse.
#IfWinActive ahk_class SWT_Window0
    ^WheelUp:: Send ^{=}
    ^WheelDown:: Send ^-
#IfWinActive

回答by pellox

Windows > Preferences > General > Appearance > Colors and Fonts

Windows > 首选项 > 常规 > 外观 > 颜色和字体

Then, to change Java editor font: Java > Java Editor Text Font > EDIT

然后,更改 Java 编辑器字体:Java > Java Editor Text Font > EDIT

There it is.

就是这样。

回答by Hedeer

Oddly, working on a .js file and Ctrl, Shift, +=works to zoom in (and Ctrl-works to zoom out but you have to select 1or 2after Ctrl-). This only works when I'm in the js file but the zoom applies to all my open tabs. Using Eclipse Juno on Ubuntu.

奇怪的是,工作的一个.js文件和CtrlShift+=工程放大(并Ctrl-致力于缩小,但你必须选择12之后Ctrl-)。这仅在我在 js 文件中时有效,但缩放适用于我所有打开的选项卡。在 Ubuntu 上使用 Eclipse Juno。

回答by steve-o

Found a great plugin that works in Juno and Kepler. It puts shortcuts on the quick access bar for increasing or decreasing text size.

找到了一个适用于 Juno 和 Kepler 的优秀插件。它在快速访问栏上放置了用于增加或减少文本大小的快捷方式。

Install New Software -> http://eclipse-fonts.googlecode.com/svn/trunk/FontsUpdate/

安装新软件 -> http://eclipse-fonts.googlecode.com/svn/trunk/FontsUpdate/

回答by Xsasan

In Eclipse Neon.3, as well as in the new Eclipse Photon (4.8.0), I can resize the font easily with Ctrl+ Shift+ +and -, without any plugin or special key binding.

在Eclipse Neon.3,以及在新的Eclipse光子(4.8.0),我可以很容易地调整字体Ctrl+ Shift++-,无需任何插件或特殊的键绑定。

At least in Editor Windows (this does not work in other Views like Console, Project Explorer etc).

至少在编辑器窗口中(这在控制台、项目资源管理器等其他视图中不起作用)。

回答by Abdu

I use an Eclipse plugin (in Eclipse Marketplace) https://marketplace.eclipse.org/content/fontsize

我使用 Eclipse 插件(在 Eclipse Marketplace 中) https://marketplace.eclipse.org/content/fontsize

回答by jamesc1101

Here's a quicker way than multi-layer menus without resorting to plug-ins:

这是一种比多层菜单更快的方法,无需借助插件:

Use the Quick Access tool at the upper left corner.

使用左上角的快速访问工具。

Type in "font", then, from the list that drops down, click on the link for "Preferences->Colors and Fonts->General->Appearance".

输入“字体”,然后从下拉列表中单击“首选项->颜色和字体->常规->外观”链接。

One click replaces the 4 needed to get there through menus. I do it so often, my Quick Access tool pulls it up as a previous choice right at the top of the list so I can just type "font" with a tap on the enter key and Boom!, I'm there.

一键替换通过菜单到达所需的 4 次。我经常这样做,我的快速访问工具将它作为以前的选择拉到列表的顶部,这样我就可以通过点击回车键和 Boom! 来输入“字体”,我就在那里。

If you want a keyboard shortcut, Ctrl+3 sets the focus to the Quick Access tool. Better yet, this even automatically brings up a list with your previous choices. The last one you chose will be on top, in which case a simple Ctrl+3 followed by enter would bring you straight there! I use this all the time to make it bigger during long typing or reading sessions to ease eye strain, or to make it smaller if I need more text on the screen at one time to make it easier to find something.

如果需要键盘快捷键,Ctrl+3 将焦点设置到快速访问工具。更好的是,这甚至会自动显示您之前选择的列表。您选择的最后一个将在顶部,在这种情况下,一个简单的 Ctrl+3 后按 Enter 将直接带您到那里!在长时间打字或阅读期间,我一直使用它来放大它以缓解眼睛疲劳,或者如果我一次需要在屏幕上显示更多文本以便更容易找到某些东西,则将它缩小。

It's not quite as nice as zooming with the scroll wheel or with a simple Ctrl+ or Ctrl-, but it's a lot better than navigating through the menus every time!

它不像使用滚轮或使用简单的 Ctrl+ 或 Ctrl- 缩放那么好,但它比每次都浏览菜单要好得多!