向上或向下跳转光标 X 行数

问题描述 投票:0回答:2

在 Visual Studio/Resharper 中是否可以使用快捷键(如 Ctrl+向上/向下箭头)将光标跳转 x 行数,以使向上或向下更快/更容易?我知道您可以使用 ctrl+g 指定您想要转到的行号,但这不是我要找的。

visual-studio resharper
2个回答
1
投票

您可以使用我的 Visual Commander 扩展创建一个简单的命令并为其分配快捷方式:

public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) 
{
    for(int x = 0; x < 5; ++x)
        DTE.ExecuteCommand("Edit.LineDown");
}

0
投票

我不想安装整个 VS 扩展来完成这样一个简单的任务,所以改为使用 AutoHotKey 脚本:

; Ctrl+Arrows to scroll multiple lines in VS
#IfWinActive, ahk_exe devenv.exe
#IfWinNotActive ahk_class ToolWindowSelect
^Up:: Send {UP 10}
^Down:: Send {DOWN 10}
#IfWinNotActive
#IfWinActive
© www.soinside.com 2019 - 2024. All rights reserved.