Fix: Ctrl + L Not Selecting a Line in VS Code
I enjoy using my keyboard when I code and one those commands that is really helpfull is CTRL + L to select the line that I am on but sometimes in vscode that becomes problematic and might not work properly . So If you're using VS Code and find that Ctrl + L isn't selecting the current line as expected, you're not alone! This issue can be caused by conflicting keybindings, missing commands, or even extensions overriding shortcuts. Here’s how you can fix it.
Edit keybindings.json
- Open Command Palette (
Ctrl + Shift + P
). - Search for “Open Keyboard Shortcuts (JSON)” and select it.
- Add this to your
keybindings.json
file: - look for any conflicts with CTRL + L.
- add these if it is missing
Try this:
[
{
"key": "ctrl+l",
"command": "editor.action.selectLines",
"when": "editorTextFocus"
}
]
Save the file and restart VS Code.
If editor.action.selectLines
is not working, try using expandLineSelection
instead:
[
{
"key": "ctrl+l",
"command": "expandLineSelection",
"when": "editorTextFocus"
}
]
This provides a similar functionality by expanding the selection to the current line.
Your CTRL + L should work now