6

我对 intellij 中向上翻页、向下翻页的滚动行为不满意。感觉不对。总感觉好像我超出了范围。

是否可以调整向上翻页、向下翻页的滚动大小?也许到半页或类似的。

4

3 回答 3

5

我接受了@yole 的回答并实现了他在一个单独的插件中描述的所有操作:

无法通过设置来控制它。您可以做的是编写一个以您喜欢的方式执行滚动的插件。这相当简单:您需要做的就是复制现有的 PageUpAction/PageDownAction 类和它们调用的方法 (EditorActionUtil.moveCaretPageUp/Down) 以根据需要滚动。

这个插件实现了新的动作“Partial Page Up”和“Partial Page Down”,允许用户滚动在通常的 IDEA 设置对话框中可配置的屏幕大小。

JetBrains 官方存储库中有该插件的可安装版本。

于 2019-09-12T13:33:27.963 回答
4

无法通过设置来控制它。您可以做的是编写一个以您喜欢的方式执行滚动的插件。这相当简单:您需要做的就是复制现有的PageUpAction / PageDownAction类和它们调用的方法 ( EditorActionUtil .moveCaretPageUp/Down) 以根据需要滚动。

于 2014-12-22T22:39:21.820 回答
0

由于很多人都在询问这个问题,对于mac 用户,这可以通过使用karabiner应用程序向上/向下滚动页面并添加以下复杂规则来全局控制:

{
    "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"
        }
    ]
},

另请注意,要获得平滑滚动,请考虑下载 Mos 应用程序并根据需要调整首选项。

https://mos.caldis.me/

这可能会对您的 Mac 产生其他后果,因此您可能需要调整其他内容,因为您的 page_up/down 不再是 page_up/down而是鼠标滚动

于 2020-06-26T14:14:40.327 回答