Change editor font size actions

Are there keymapable actions to increase & descrease the editors font size? I know the ctrl+mousewheel shortcut, but when I'm on the laptop sans-mouse can I map keys to increase & decrease the size too?

Would find this mostly useful when presenting.

3 comments

Hi Richard,

No, there are no such actions. You can workaround that via intellij-eval plugin and directly call its setFontSize() method.

Dens

0

Oh OK.

Haven't tried it but was thinking I could possibly create a new theme with bigger font defaults and use the quick switch scheme.

0

So something like this. Relies on intellijeval activation first.

import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.impl.*; import com.intellij.openapi.actionSystem.AnActionEvent import static intellijeval.PluginUtil.* def DEFAULT_FONT_SIZE = currentEditorIn(event.project).getColorsScheme().editorFontSize registerAction("FontBigger", "ctrl alt EQUALS") { AnActionEvent event ->     def editor = currentEditorIn(event.project)     def editorImpl = (editor as EditorImpl)     def fontSize = editorImpl.getColorsScheme().editorFontSize;     editorImpl.setFontSize(fontSize + 1); } registerAction("FontSmaller", "ctrl alt MINUS") { AnActionEvent event ->     def editor = currentEditorIn(event.project)     def fontSize = editor.getColorsScheme().editorFontSize;     editor.setFontSize(fontSize - 1); } registerAction("FontReset", "ctrl alt 0") { AnActionEvent event ->     def editor = currentEditorIn(event.project)     editor.setFontSize(DEFAULT_FONT_SIZE); }

show("Editor font sizing actions bound to. ctrl+alt+'+', ctrl+alt+'-', ctrl+alt+'0'.")

0

Please sign in to leave a comment.