Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij IDEA, control page up, page down scroll size

I am not satisfied with the scrolling behaviour in intellij for page up, page down. It doesn't feel right. It always feels as if I get out of the scope.

Is it possible to adjust the scroll size of page up, page down? Perhaps to half a page or similar.

like image 938
mjs Avatar asked Dec 22 '14 20:12

mjs


People also ask

How do I scroll in IntelliJ?

Horizontal scrolling can be enabled in 'File | Settings | Editor | General | Appearance'. Click-to-scroll toggle mode can be disabled in 'File | Settings | Editor | General | Appearance'. Mouse shortcut can be customized in 'File | Settings | Keymap | Plugins | Fast Mouse Scrolling | Start Fast Mouse Scrolling'.

How do I increase the number of open tabs in IntelliJ?

IntelliJ IDEA limits number of tabs that you can open in the editor simultaneously (the default tab limit is 10). In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | General | Editor Tabs. In the Tab closing policy section, adjust the settings according to your preferences and click OK.

Where is context menu in IntelliJ?

On Windows, you can use the dedicated "context menu" key to the right of the spacebar. On other operating systems, there is no default shortcut, but you can assign one if you search for "Show context menu" in Settings | Keymap.


3 Answers

I had taken @yole's answer and implemented all of the actions he had described in a separate plugin:

There is no way to control this through the settings. What you can do is write a plugin that performs scrolling in the way that you prefer. It's fairly easy: all you need to do is copy the existing PageUpAction/PageDownAction classes and the methods they call (EditorActionUtil.moveCaretPageUp/Down) to scroll by as much as you want.

This plugin implements new actions "Partial Page Up" and "Partial Page Down" which allow one to scroll a configurable size of screen definable in the usual IDEA settings dialog.

There's an installable version of the plugin in official JetBrains repository.

like image 167
Andrey Cizov Avatar answered Oct 19 '22 15:10

Andrey Cizov


There is no way to control this through the settings. What you can do is write a plugin that performs scrolling in the way that you prefer. It's fairly easy: all you need to do is copy the existing PageUpAction/PageDownAction classes and the methods they call (EditorActionUtil.moveCaretPageUp/Down) to scroll by as much as you want.

like image 32
yole Avatar answered Oct 19 '22 16:10

yole


Since many are inquiring about this, for mac users this can be controlled globally instead by instead scrolling on page up/down using karabiner application and adding the following complex rule:

{
    "description": "mmm.karabiner.page.up.down.to.scroll",
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^net.java.openjdk.cmd",
                        "^com.jetbrains.intellij"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "page_up"
            },
            "to": [
                {
                    "mouse_key": {
                        "vertical_wheel": -51
                    }
                }
            ],
            "to_delayed_action": {
                "to_if_invoked": [
                    {
                        "pointing_button": "button1"
                    }
                ]
            },
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^net.java.openjdk.cmd",
                        "^com.jetbrains.intellij"
                    ],
                    "type": "frontmost_application_unless"
                }
            ],
            "from": {
                "key_code": "page_up"
            },
            "to": [
                {
                    "mouse_key": {
                        "vertical_wheel": -51
                    }
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^net.java.openjdk.cmd",
                        "^com.jetbrains.intellij"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "up_arrow",
                "modifiers": {
                    "mandatory": [
                        "fn"
                    ]
                }
            },
            "to": [
                {
                    "mouse_key": {
                        "vertical_wheel": -51
                    }
                }
            ],
            "to_delayed_action": {
                "to_if_invoked": [
                    {
                        "pointing_button": "button1"
                    }
                ]
            },
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^net.java.openjdk.cmd",
                        "^com.jetbrains.intellij"
                    ],
                    "type": "frontmost_application_unless"
                }
            ],
            "from": {
                "key_code": "up_arrow",
                "modifiers": {
                    "mandatory": [
                        "fn"
                    ]
                }
            },
            "to": [
                {
                    "mouse_key": {
                        "vertical_wheel": -51
                    }
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^net.java.openjdk.cmd",
                        "^com.jetbrains.intellij"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "page_down"
            },
            "to": [
                {
                    "mouse_key": {
                        "vertical_wheel": 51
                    }
                }
            ],
            "to_delayed_action": {
                "to_if_invoked": [
                    {
                        "pointing_button": "button1"
                    }
                ]
            },
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^net.java.openjdk.cmd",
                        "^com.jetbrains.intellij"
                    ],
                    "type": "frontmost_application_unless"
                }
            ],
            "from": {
                "key_code": "page_down"
            },
            "to": [
                {
                    "mouse_key": {
                        "vertical_wheel": 51
                    }
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^net.java.openjdk.cmd",
                        "^com.jetbrains.intellij"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "from": {
                "key_code": "down_arrow",
                "modifiers": {
                    "mandatory": [
                        "fn"
                    ]
                }
            },
            "to": [
                {
                    "mouse_key": {
                        "vertical_wheel": 51
                    }
                }
            ],
            "to_delayed_action": {
                "to_if_invoked": [
                    {
                        "pointing_button": "button1"
                    }
                ]
            },
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^net.java.openjdk.cmd",
                        "^com.jetbrains.intellij"
                    ],
                    "type": "frontmost_application_unless"
                }
            ],
            "from": {
                "key_code": "down_arrow",
                "modifiers": {
                    "mandatory": [
                        "fn"
                    ]
                }
            },
            "to": [
                {
                    "mouse_key": {
                        "vertical_wheel": 51
                    }
                }
            ],
            "type": "basic"
        }
    ]
},

Also do note, to get smooth scrolling, consider down loading Mos application and adjust the preferences if desired.

https://mos.caldis.me/

This might have other consequences on your Mac so you might need to have to adjust other things since your page_up/down is no longer a page_up/down but mouse scrolls instead.

like image 1
mjs Avatar answered Oct 19 '22 15:10

mjs