DEV Community

Cover image for VS Code- Shortcuts for Web Developers
Tabassum Khanum
Tabassum Khanum

Posted on Edited on

VS Code- Shortcuts for Web Developers

Hey Coders!
If you are doing web development or are into programming then you might have heard about VS Code or Visual Studio Code, one of the best modern IDE from Microsoft for modern developers.

Visual Studio Code is a fast and lightweight cross-platform code editor for writing modern web and cloud applications. You can use VS Code not only on Windows, Linux but also on Mac. In this article, I'm going to go through 15 VS Code and HTML shortcuts that I find the most convenient for me when I'm coding.

1. Open integrated terminal

Windows/ Linux : Ctrl + `
Mac : Cmd + `
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

2. Close all open editor tabs

Windows/ Linux : Ctrl + k  + w
Mac : Cmd + k + w
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

3. Opens the palette to search for a file

Windows/ Linux : Ctrl + p
Mac : Cmd + p
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

4. Move line up or down

Windows/ Linux : Alt + Up/Down
Mac : Option + Up/Down
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

5. Split editor view

Windows/ Linux : Ctrl + \
Mac : Cmd + \
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

6. Format document

Windows: Shift + Alt + F
Linux : Ctrl + Shift + I
Mac : Shift + Option + F
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

7. Toggle Sidebar

Windows/ Linux : Ctrl + B
Mac : Cmd + B
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

HTML Shortcuts

8. ID and Class Attributes

- div#header
<div id="header"></div>

- div.header
<div class="header"></div>

- div#id1.class1
<div id="id1" class=class1"></div>

- p.class1.class2.class3
<p class="class1 class2 class3"></p>

💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

9. Multiplication

- ul>li*2

<ul>
     <li></li>
     <li></li>
</ul>
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

10. Child

- nav>ul>li

<nav>
   <ul><li></li></ul>
</nav>
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

11. Sibling

- div+p+a

<div><div>
<p></p>
<a></a>
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

12. Text

- a{Click Me}

<a href="">Click Me</a>
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

13. Grouping

- div>(header>ul>li*2>a)+footer>p

<div>
   <header>
      <ul>
           <li><a href=" "></a><li>
           <li><a href=" "></a><li>
      </ul>
    </header>
<footer>
  <p></p>
</footer>
</div>
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

14. Item Numbering

-ul>li.item$*5

<ul>
    <li class="items1"><li>
    <li class="items2"><li>
    <li class="items3"><li>
    <li class="items4"><li>
    <li class="items5"><li>
</ul>
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

15. Implicit tag Names

-ul>class

<ul>
   <li class="class"></li>
</ul>

- table>.row>.col

<table>
   <tr class="row">
      <td class="col"></td>
   </tr>
</table>
💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: codewithtee/vs code shortcuts for web developers d - ประเด็นร้อน

Conclusion

VS Code has a large number of shortcuts to increase our coding speed. This article only includes some must-know shortcuts for every web developer who works with VS Code. I'll make part 2 of this, if needed.

I hope you found some exciting shortcuts in this list to make your coding more efficient. If there are any other tips of your own, don't forget to share them in the comments.

For daily web development threads, updates and content follow me on Twitter.
https://twitter.com/codewithtee

Thanks for reading 🐼
Happy Coding!

gif

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.