1

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?

4
  • Logical EOL? Physical EOL? Commented Oct 23, 2019 at 12:36
  • Physical but either will work for me Commented Oct 23, 2019 at 12:42
  • This can be done with a macro but I have never been successfulat overriding the enter key for a custom keybinding. Would you like to see the macro that you could set for your own, non-enter key, keybinding? Like Alt+Right for example. Commented Oct 23, 2019 at 17:38
  • Sure. If you post the macro I can go from there. Commented Oct 23, 2019 at 23:58

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.