In this article I want to share some of my favourite and most used VS Code shortcuts that help me save time, make my life a little easier and, as a heavy keyboard user, also allow me to stay in my developer flow.
You may be familiar with some of them already but hopefully you will discover a new shortcut that you can introduce into your workflow starting right now. π€π»
I jotted down the key combinations for Mac users. If youβre a Windows or Linux user, you can find the key bindings for your OS here.
Alright then, so without needing to select the entire line first... (simply place your cursor anywhere on the line you want to edit)
-
βX
- cut a line -
βC
- copy a line -
β§βK
- delete a line -
βL
- select the line
And while your cursor is on a specific line..
-
βEnter
- insert a new line below it -
β§βEnter
- insert a new line above it -
β₯β
andβ₯β
- move the line up/down -
β§β₯β
andβ§β₯β
- duplicate line on the line above/below it -
β]
andβ[
- indent and outdent the line -
β/
- (un)comment out the line
Or within a specific file..
-
βD
- find other instances of selected code -
β₯Z
- toggle word wrap
Lastly, for some editor/window management..
-
βP
- find and go to file (quick open) -
βN
- new editor -
βW
- close editor -
βB
- toggle visibility of the side panel -
β
` - toggle visibility of the integrated terminal -
β2
- split screen into two editor groups -
β§βT
- reopen recently closed editor -
β₯ββ
andβ₯ββ
- view editor tab on the left/right
What are some shortcuts you use frequently and which are not listed here? I'd love to hear from you!
Happy coding!
Top comments (0)