Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select to End/Beginning of Line in Visual Studio Code

In most editors (including Visual Studio proper), I can use Shift+End to select all of the text from the cursor location to the end of the current line, and Shift+Home to select all text up to the beginning of the line.

These shortcuts don't seem to work out-of-the box (at least, on the Mac version). Is there some way to enable this, perhaps with a plugin or a setting I'm missing?

like image 744
fr0 Avatar asked Aug 09 '16 19:08

fr0


People also ask

How do you move to the end of line in VS Code?

Mine is Visual Studio Code and the exact command for this is "Add cursors to line ends". The shortcut key is Alt + Shift + I (Windows) or Command + Shift + l (Mac).

How do you go to the beginning of a line in VS Code?

The quickest way to get your cursor to the first or last line of the file is pressing Ctrl + Home (Mac: Control + Home ) to go the beginning and Ctrl + End (Mac: Control + End ) to go to the end.

How do you select the whole line in VS Code?

On Windows: Shift + Alt + Up/Down. On Mac: Shift + Option + Up/Down. On Ubuntu: Ctrl + Shift + Alt + Up/Down.


2 Answers

Strange it should work out of the box. If not, go to File > Preferences > Keyboard Shortcuts and look for cursorEndSelect.

{"key": "shift+end", "command": "cursorEndSelect", "when": "editorTextFocus"} 
like image 132
Dauren Akilbekov Avatar answered Oct 12 '22 06:10

Dauren Akilbekov


I use following inbuilt shortcut (VSCode 1.39.2, MacOS 10.15)

 

⌘ Command + ⇧ Shift + → Right Arrow key combination

 

 


You can access keyboard shortcut reference here: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

You can visit this link anytime from VS Code by navigating to

Help > Keyboard Shortcuts Reference

enter image description here

like image 36
Anon Avatar answered Oct 12 '22 05:10

Anon