我对页面向上,页面向下的intellij中的滚动行为不满意。感觉不对劲。总觉得我好像离开了范围。
是否可以调整向上翻页的页面大小?也许是半页或类似的。
答案 0 :(得分:3)
无法通过设置控制此操作。你可以做的是编写一个插件,以你喜欢的方式执行滚动。这很简单:您需要做的就是复制现有的PageUpAction / PageDownAction类及其调用的方法(EditorActionUtil。moveCaretPageUp / Down),以便根据需要滚动。
答案 1 :(得分:2)
我接受了@yole的回答,并执行了他在单独的插件中描述的所有动作:
无法通过设置来控制此设置。您可以做的是编写一个插件,以您喜欢的方式执行滚动。这很简单:您需要做的就是复制现有的 PageUpAction / PageDownAction类及其调用的方法 (EditorActionUtil.moveCaretPageUp / Down)进行任意滚动。
此插件实现了“部分向上翻页”和“部分向下翻页”新动作,使它们能够在通常的IDEA设置对话框中滚动定义可定义的屏幕大小。
official JetBrains repository中有一个可安装的插件版本。
答案 2 :(得分:2)
由于许多人对此进行了询问,因此对于 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应用程序,并根据需要调整首选项。
这可能会在Mac上产生其他后果,因此您可能需要调整其他内容,因为page_up / down不再是page_up / down ,而是鼠标滚动。