165

I want the same behaviour Firefox has, when you use the scroll button in the mouse to zoom in and out on the current view. Is there something like it for eclipse?

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
Yossale
  • 14,165
  • 22
  • 82
  • 109

18 Answers18

111

There is a project from a guy called 'tarlog' that made a plugin for eclipse at this google code site: 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 for eclipse, amongst which is Ctrl++ and Ctrl+- to change the font size, it's frickin' awesome.

Marcel Valdez Orozco
  • 2,985
  • 1
  • 25
  • 24
  • 1
    It doesn't work with Indigo. Changed Zoom Out and Zoom In key bindings to something else, still couldn't make it work. – Cengiz Can Jan 10 '12 at 18:29
  • 5
    This has got to be my least technical answer, yet its the one with the most upvotes, lol – Marcel Valdez Orozco Jan 04 '13 at 00:56
  • 7
    Ctrl++ and Ctrl+- works (using Eclipse 4.2.1 Win 7 64bit) Nice plugin, Thanks! – Crocodile Jan 10 '13 at 06:31
  • I've just downloaded this plugin: how do I run/use it? – George Tomlinson Oct 01 '13 at 14:41
  • 11
    Great, thanks for sharing. To install the plugin, all you have to do in Eclipse 3.7 is to copy the JAR into /eclipse/dropins. – Marcel Valdez Orozco Oct 03 '13 at 02:47
  • The tarlog plugin, combined with removing -Dorg.eclipse.swt.internal.carbon.smallFonts from eclipse.ini, helps my tired eyes on MacOS Yosemite with Eclipse Luna (4.4). Problem: Didn't work for me for a PyDev foo.py Python file. Workaround: Open a file named foo.java - change the font size. Go back to foo.py and voila!! - the python font size matches the java font size. – Jeff Taylor Feb 02 '15 at 18:18
  • 1
    Just a note: make sure you hold down shift when hitting Ctrl++ ...should be obvious, but it wasn't to me (and apparently others commenting in the documentation). – levininja Aug 28 '15 at 21:38
  • 8
    Using Eclipse Neon milestone 4 or later, the Zoom In/Out shortcuts are provided "out-of-the-box" by Eclipse Platform with a reliable implementation. The shortcuts are Ctrl+/Ctrl= and Ctrl- and the commands are accessible in the "Quick Search" field beside the perspective switcher. Those are shortcuts for editing the font description in the Preferences > General > Colors & Fonts page. – Mickael Apr 18 '16 at 20:46
  • 2
    It is now a official feature in Neon: https://www.eclipse.org/eclipse/news/4.6/platform.php – gustavovelascoh Nov 26 '16 at 01:42
87

Too late but it could be helpful :

Go to Window Menu > Preferences > General > Appearance > Colors and Fonts

then go to Java > Java Editor Text Font > Edit

Mifmif
  • 3,132
  • 18
  • 23
  • 14
    Thanks for sharing the only 100% reliable option! – jpaugh Aug 14 '15 at 15:25
  • 1
    This is correct, no need of extra plugin. I am puzzled why this answer isnt at the top of all answers! – anubhs Jun 29 '18 at 17:08
  • 1
    @anubhs The common use-case is to enable easily and quickly switching between font sizes when browsing code. This is likely going to be a mostly mouse-driven activity, and even pressing `Ctrl+"+", Ctrl+"-"` is undesirable, never mind digging into a settings menu. – kdb Oct 02 '20 at 11:24
65

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

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 FontsFeature as in the following image:

Eclipse extension installation screen capture

Complete the installation and restart Eclipse, then you should see the A toolbar 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 screen capture with the font size toolbar buttons circled

To get Ctrl+MouseWheel zooming, you can use AutoHotkey with the following script:

; 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
Woody
  • 145
  • 1
  • 4
Naveed Ahmad
  • 6,627
  • 2
  • 58
  • 83
  • 5
    I think this should be the answer. The one the OP chose does not work for many of the eclipse releases. – Ambar Jun 15 '14 at 15:16
  • 1
    Worked perfectly! Thanks for the AHK Script as well, +1. – Aaronias Jul 11 '14 at 18:57
  • @Thupten you will change font sizes by the following method: On the eclipse toolbar, select Window ! Preferences Set the font size (General → Appearance → Colors and Fonts → Java Editor text font). Save the preferences. – Naveed Ahmad Aug 22 '14 at 05:36
  • +1 for Eclipse Fonts but the autohotkey thing is so inelengant..! Can't believe Eclipse doesn't yet work with mouse wheel natively? – Redoman Jan 31 '15 at 02:59
  • Apparently, the URL is not working anymore, Error 404 – Jesé Abraham Chavez Rivas Oct 22 '20 at 21:41
34

Starting from tonight nightly build of 4.6/Neon, the Eclipse Platform includes a way to increase/decrease font size on text editors using Ctrl+ and Ctrl- (on Windows or Linux, Cmd= and Cmd- on Mac OS X) : https://www.eclipse.org/eclipse/news/4.6/M4/#text-zoom-commands . The implementation is shipped with any product using a recent build of the platform, and is more reliable that the one in the alternative plugins mentioned above. It will be more widely available within weeks, when the IDE packages for Neon M4 will be available, and it will be part of the public Neon release in June 2016.

Jim DeLaHunt
  • 10,960
  • 3
  • 45
  • 74
Mickael
  • 3,506
  • 1
  • 21
  • 33
  • 1
    I have just (04.07.2016) installed Eclipse Neon from the official site, but Ctrl+ and Ctrl- and Ctrl+mousewheel do not work. Do I have to allow it somewhere in the options? – Honza Zidek Jul 07 '16 at 08:20
  • Ctrl+Mousewheel is not supposed to work. There should be nothing to enable to have Ctrl+/Ctrl- working, so it's most likely a bug (in the Zoom operation or in the editor you're currently using). Please report it to http://bugs.eclipse.org/ – Mickael Jul 07 '16 at 08:49
  • 4
    The +/- keys on the numpad wouldn't work for me, but the regular +/- keys worked. – jgoeders Aug 18 '16 at 21:11
  • @jgoeders: that's interesting. Could you report this to http://bugs.eclipse.org so it has a chance to get investigated? – Mickael Aug 19 '16 at 07:31
  • This IS the dream answer ! Thanks, Neon. – Trunk Jun 16 '17 at 19:31
22

I've answered it here. How can I change font size in Eclipse for Java text editors?

For Eclipse Neon

To Increase Ctrl +

To reduce Ctrl - enter image description here

ChandraBhan Singh
  • 2,841
  • 1
  • 22
  • 27
18

For Zoom In: CTRL + SHIFT + +
For Zoom Out: CTRL + SHIFT + -

desu sai venkat
  • 275
  • 3
  • 10
16

To zoom on Eclipse you can use : CTRL SHIFT + OR -

Wozniak
  • 161
  • 1
  • 2
12

As per the recent changes you can use: (1) Ctrl/Shift/(+) for Zoom-in (2) Ctrl/Shift/(-) for Zoom-out

navis1692
  • 298
  • 2
  • 13
8

As mentioned in another answer, this plugin

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

makes Ctrl-+ and Ctrl-- zoom in and out. On MacOS that would be ⌘+ and ⌘-.

But at least on MacOS Lion and Eclipse Helios, ⌘- worked but not ⌘+ – no key combination (and I tried a bunch, including ⌘= and variants with Ctrl and Shift) would increase font size. However, by changing the key bindings, I was able to get it to work.

Preferences => General => Keys

Commands "Zoom Out" and "Decrease Font" were already set to ⌘- (and that seemed to work), so I set "Zoom In" and "Increase Font" to ⌘= (one of them was that and the other was ⌘+), and that worked.

AmigoNico
  • 6,652
  • 1
  • 35
  • 45
  • 3
    This is not a discussion forum, don't post "the previous answer worked for me" answers. (Also, the name of the '⌘' key is *Command*, abbreviated as "Cmd" in keyboard shortcuts if you don't want to copy-paste it from somewhere like http://www.fileformat.info/info/unicode/char/2318/index.htm.) – millimoose Dec 08 '11 at 22:17
  • 4
    I see: answers need to stand alone, and mine did not (I really just wanted to add a comment to Marcel's answer, but don't have the necessary privileges). I tried to make it stand alone now; thanks for teaching me the difference. – AmigoNico Dec 12 '11 at 07:31
  • It's a common mistake for new folks since they are not allowed to answer before they can comment (kind of strange really). And I'll add your tip helped me :). – studgeek Jan 11 '13 at 17:44
  • I've just downloaded this plugin: how do I run/use it? – George Tomlinson Oct 01 '13 at 14:45
  • Check out this page: https://code.google.com/p/tarlog-plugins/issues/detail?id=17 – AmigoNico Oct 01 '13 at 20:47
  • 1
    Unfortunately I'm not able to get this to work in Indigo; I've tried both plugins and dropins, but no luck. – AmigoNico Oct 01 '13 at 21:27
7

go to Eclipse > Prefences > General > Appearance > Color and Fonts > Basic > Text Font

Font problem will resolved I guess.Dont need a any plugin for this.

Yiğit Taş
  • 71
  • 1
  • 2
6

Just by pressing Ctrl + Shift + '+' or '-'.

At least, it worked for me at Eclipse "2020-03" version.

Joel Arnold
  • 61
  • 1
  • 2
3

Here is a cool way of ensuring zoom in and zoom out with mouse scroll-wheel in the Eclipse Editor. This one takes inspiration from the solution above from naveed ahmad which was not working for me.

1) First download Autohotkey from http://www.autohotkey.com/ and install it, then run it.

2) Then download tarlog-plugins from https://code.google.com/p/tarlog-plugins/downloads/list

3) Put the downloaded .jar file in the eclipse/plugins folder.

4) Restart Eclipse.

5) Add the following Autohotkey script, save it then reload it (right click on Autohotkey icon in taskbar and click "Reload this script")

; Ctrl + MouseWheel zooming in Eclipse Editor.
; Requires Tarlog plugins (https://code.google.com/p/tarlog-plugins/).
#IfWinActive ahk_class SWT_Window0
^WheelUp:: Send ^{NumpadAdd}
^WheelDown:: Send ^{NumpadSub}
#IfWinActive

And you should be done. You can now zoom in or zoom out with ctrl+mousewheel up and ctrl+mousewheel down. The only caveat is that Autohotkey must be running for this solution to work so ensure that it starts with Windows or run it just before firing Eclipse up. Works fine in Eclipse Kepler and Luna.

Zek101
  • 203
  • 4
  • 13
1

The googlecode fontsupdate does not work anymore unfortunately. You can however just download the code from github:

https://github.com/gkorland/Eclipse-Fonts

Just download it as .zip, and add it in eclipse:

Adding a local plugin

Then you have the familiar buttons again!

Arnout
  • 341
  • 2
  • 8
  • Or you can use the raw url through the add plugin dialog: https://raw.githubusercontent.com/gkorland/Eclipse-Fonts/master/FontsUpdate/ – phyatt Sep 07 '18 at 04:41
1

On Mac you can do Press 'Command' and '+' buttons to zoom in. press 'Command' and '-' buttons to zoom out.

1

Even more reliable than @mifmif :

Go to Window Menu > Preferences > General > Appearance > Colors and Fonts

then go to Basic.

This section has about 5 different fonts in it, all of which contain a size. If you go to an item in any other section (like Java > Java Editor Text Font as @mifmif suggested) the Edit Default and Go to Default buttons will be enabled. Clicking the latter takes you to the corresponding item in the Basic section. Clicking the former lets you edit that item directly.

Changing the Basic font items will handle not only Java text but just about every other text in Eclipse that can be resized, as far as I can tell.

John Chesshir
  • 590
  • 5
  • 20
0

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.

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.

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

jamesc1101
  • 185
  • 1
  • 8
  • I'd like to know why this was voted down. If anyone can offer me any ideas on what I did wrong, I'd like to learn from my mistake. – jamesc1101 Jul 12 '16 at 19:34
0

What I am doing is using the Windows 10 magnifier. Not the same as zooming on firefox, but it has been quite useful.

-1

The tarlog plugin, combined with removing -Dorg.eclipse.swt.internal.carbon.smallFonts from eclipse.ini, helps my tired eyes on MacOS Yosemite with Eclipse Luna (4.4).

Problem: Didn't work for me for a PyDev foo.py Python file. Workaround: Open a file named foo.java - change the font size. Go back to foo.py and voila!! - the python font size matches the java font size.

Jeff Taylor
  • 471
  • 2
  • 4
  • 11