![Buy Me A Coffee](https://res.cloudinary.com/practicaldev/image/fetch/s--zQj764Ae--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.buymeacoffee.com/buttons/default-orange.png)
The keyboard keeps you more productive if you have to handle a lot of text every day.
It doesn't matter much what the text represents: code, post, note, etc.
In this article, I want to share hotkeys that I'm using daily while working in the Visual Studio Code.
Worth to note, that the list of shortcuts is available by this combination Ctrl + K Ctrl + S.
Spread cursor selection over several lines
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + Alt + Up |
Option + Command + Up |
Add cursor above |
Ctrl + Alt + Down |
Option + Command + Down |
Add cursor below |
![Select and edit two strings via Ctrl + Alt + Down Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--oybJqNsQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ksazcjiihng5so72ht25.gif)
Select entries starting from the word under the cursor
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + D |
Command + D |
Add Selection To Next Find Match |
![Select and edit matches via Ctrl + D Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--QnhW7x9Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/s975tq4k7trxspjkrpp2.gif)
Change all occurrences of the word under the cursor
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + F2 |
Command + F2 |
Change All Occurrences |
![Change all occurrences via Ctrl + F2 Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--Ao3vxjay--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kvoukarl1n1900uippj1.gif)
Tell editor to treat document in the selected format
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + K M |
Command + K M |
Change Language Mode |
![Change language mode via Ctrl + K M Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--yQUi1W_y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ubd069044ig4ohnudxjf.gif)
Copy active line up or down without altering the clipboard
Shortcut Windows |
Shortcut Mac |
Effect |
Shift + Alt + Down |
Shift + Option + Down |
Copy Line Down |
Shift + Alt + Up |
Shift + Option + Up |
Copy Line Up |
![Copy lines via Shift + Alt + Down Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--uMTQUuDt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9r322528cyvnmrhs4mpj.gif)
Delete line without altering the clipboard
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + Shift + K |
Command + Shift + K |
Delete Line |
![Delete line via Ctrl + Shift + K Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--Zia6Hd4l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/iviyj9uwz2wncbfz57gs.gif)
Move focus to the open editors' view
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + K E |
Command + K E |
Focus On Open Editors View |
![Select editor via Ctrl + K E Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--5HRTDxqZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jn8vcn5a0bckkun1ugr3.gif)
Compare file with the clipboard
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + K C |
Command + K C |
Compare Active File With Clipboard |
![Compare file with clipboard via Ctrl + K C Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--nsyrfIZ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1wyf9x2qhi5pbsoirvx4.gif)
Fast navigation within the file
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + Shift + . |
Command + Shift + . |
Focus Breadcrumbs |
![Fast navigation within the file via Ctrl + Shift + . Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--WKo5YH_e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rb6ai4oxofz7qnd2sizx.gif)
Fold/unfold section
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + Shift + [ |
Option + Command + [ |
Fold |
Ctrl + Shift + ] |
Option + Command + ] |
Unfold |
Ctrl + K Ctrl + 0 |
Command + K Command + 0 |
Fold All |
Ctrl + K Ctrl + J |
Command + K Command + J |
Unfold All |
![Folding capabilities Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--_r9yD18R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/vknspu5cpyhd92qy6uo5.gif)
Format document/section
Shortcut Windows |
Shortcut Mac |
Effect |
Shift + Alt + F |
Shift + Option + F |
Format Document |
Ctrl + K Ctrl + F |
Command + K Command + F |
Format Section |
![Format document via Shift + Alt + F Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--Xxpav-sk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ca8ssi3k0rd8vsdfh1rg.gif)
Go to matching bracket
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + Shift + \ |
Command + Shift + \ |
Go To Bracket |
![Jump to matching bracket via Ctrl + Shift + \ Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--PI7Im7ls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/v2xfjhzue4doatbeuvnm.gif)
Move line up/down
Shortcut Windows |
Shortcut Mac |
Effect |
Alt + Up |
Option + Up |
Move line up |
Alt + Down |
Option + Down |
Move line down |
![Move lines up and down Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--6Dd4Fb6W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/a72btwgh7tj5pmf01hl9.gif)
Rename symbol globally
Shortcut Windows |
Shortcut Mac |
Effect |
F2 |
F2 |
Rename symbol |
![Rename symbol via F2 Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--QCSzGHba--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/c2drk6e7rzvbzzbpcv8n.gif)
Toggle terminal
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + ` |
Control + ` |
Toggle Integrated Terminal |
![Toggle terminal via Ctrl + ` Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--oxHf-oKF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6g8rata10cm4fwcn7bec.gif)
Split terminal and switching between terminals (updated)
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + Shift + 5 |
Command + \ |
Split Terminal |
Alt + Up |
Option + Command + Up |
Focus Previous Pane |
Alt + Left |
Option + Command + Left |
Focus Previous Pane |
Alt + Down |
Option + Command + Down |
Focus Next Pane |
Alt + Right |
Option + Command + Right |
Focus Next Pane |
Thanks to fernandomaia and einav7 I've got shortcuts for the Mac!
![Split terminal and switching between two terminals Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--tatfY-23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/y6yokh0xudk8wnpw3c4y.gif)
Create a new terminal
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + Shift + ` |
Control + Shift + ` |
Create New Integrated Terminal |
![Create new terminal via Ctrl + Shift + ` Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--t5WNjZI5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9djtuetwy1q56rgo7n20.gif)
Split/move editor
Shortcut Windows |
Shortcut Mac |
Effect |
Ctrl + \ |
Command + \ |
Split Editor |
Shift + Alt + 0 |
Option + Command + 0 |
Toggle Vertical/Horizontal Editor Layout |
Ctrl + Alt + Left |
Command + K Shift + Command + Left |
Move Editor Into Previous Group |
Ctrl + Alt + Right |
Command + K Shift + Command + Right |
Move Editor Into Next Group |
![Split/move editor Alt Text](https://res.cloudinary.com/practicaldev/image/fetch/s--WaO6xD2Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q4ulfdhn6ca9cl3978qm.gif)
Conclusion
I hope that these shortcuts will help to boost your productivity as they are helping me.
All examples are given for the Windows-compatible keyboard, but they will also work on Mac. Simply replace Alt with Option and Ctrl with Control.
If you know some other helpful shortcuts, please, feel free to share them in the comments!
Want to know how I've drawn the cover image? Check this article.
Top comments (33)
Awesome post. Thanks Yuriy!
My favourite shortcuts are Ctrl + Backspace and Ctrl + Delete. These both delete an entire word, and have basically changed how I type. The best thing is, they work just about anywhere!
On MacOS:
Option + Delete = remove from the end of the word to beginning.
Option + Fn + Delete = remove from the beginning to the end of the word.
😬
These shortcuts are indeed useful! Thanks for sharing! 👍
You're welcome!
Deleting the whole word is much faster! 👍
And really satisfying!
I didn't know this backspace trick awesome ! Thank you and thank to Yuriy :)
Thanks Yuriy, I've learned some new stuff from your post.
If you want to update the post:
Focus Previous Pane
Focus Next Pane
Thank you very much! I will update this post soon!
I am incredibly thankful for this article! Especially that you took the time to show a gif (with the key captions) showcasing the various commands. Thank you so much!
You're welcome!
Amazing post! thanks Yuriy! How about adding MacOS shortcuts too, what do you think?
You're welcome! 👍
I can add MacOS shortcuts too. The only problem is that I don't have any Apple products at hand.
But, I will look at how to get them.
Or, somebody can send them to me.
Neither way, I will update this post.
Thank you for the idea! 🙌
I've found a list of default shortcuts for Visual Studio Code:
go.microsoft.com/fwlink/?linkid=83...
I'll update the post soon!
Great article, thank you for sharing! I'll definitely be trying to add some of them to my daily flow.
You're welcome! 👍
Nice
Thank you! 🙌
Thanks For This Great Piece!
Truly Valuable for Productivity 🔥
You're welcome! 👍
These are incredibly helpful and the animations make it easy to see how to use them. Thanks!
You're welcome!
There are a lot of other helpful shortcuts but article is not a book! 😁
It’s very useful and handy guide for keyboard shortcuts. Thank you 👍
You're welcome!
Thank You so much for this article Yuriy. It would help me out a lot in dealing with my day to day work.
You're welcome!
Thanks Yuriy!
I wrote a similar blog for copy and pasting shortcuts in vs code :)
medium.com/swlh/5-advanced-copy-an...
Cool! 👍
Love it ! thank you Yuriy!
To split terminal on the mac is the same as split the editor - command + \
move between panes - option + command + arrows
toggle pane - command + J
hope this helps :)
You're my saviour! I'll update my post with this info very soon! Thank you! 👍👍
very cool, thank you Yuriy!
You're welcome! 😊
I love CTRL+D shortcut in Sublime. I haven't tried the VSC yet but after this article I will give it a try. Thanks a lot!
You're welcome! I'm always experimenting with the new stuff because it's funny! 👍