Mikey
Mikey

Reputation: 3017

VSCode: Jump to the end of line

I want to jump to the end of a specific line.

When pressing ctrl/cmd + p, typing ":10" and hitting enter, I'm taken to line 10. Is there some setting or way to automatically go to the end of the line without having to use the End key?

Upvotes: 1

Views: 7202

Answers (1)

Mark
Mark

Reputation: 182591

Using some macro extension like multi-command or another you need this in your settings:

 "multiCommand.commands": [
    {
      "command": "multiCommand.gotoEndOfLine",
      "sequence": [
        "workbench.action.acceptSelectedQuickOpenItem",
        "cursorEnd",
      ]
    }
 }

and some keybinding (in keybindings.json):

{
  "key": "alt+right",
  "command": "extension.multiCommand.execute",
  "args": { "command": "multiCommand.gotoEndOfLine" },
  "when": "inQuickOpen"
},

I could not get it to work with Enter or something using Enter, like Shift+Enter - perhaps some conflict I couldn't figure out.

cursor macro

In the demo I use Ctrl+G to open the QuickInput straight to the goto line functionality but it doesn't matter how you get there. Then trigger the macro with your chosen keybinding.

Upvotes: 2

Related Questions