Visual Studio Code for Vue.js Developers
Plans from $25/month

This lesson is for members. Join us?

Subscribe now to get instant access to this course, plus a full library of Vue.js courses tailored to the plan you choose.

Auto Formatting Files in VS Code (Volar/Built-in or Prettier)

Offloading the work of formatting our code to the editor saves time and headache, plus keeps our code predictable and easy to read.

When working in a Vue.js project, it’s simple to rely on Volar for formatting .vue files and built in VS Code formatters for everything else. However, for a more portable and version control friendly solution consider using the popular formatter Prettier.

In this lesson, I’ll show you to get auto formatting on save setup with both built in formatters and Prettier.

Links

Keyboard Shortcuts

  • Format File
    • Shift+Option+F (Mac)
    • Shift+Alt+F (Windows)
  • Undo
    • Cmd+Z (Mac)
    • Ctrl+Z (Windows)
  • Save
    • Cmd+S (Mac)
    • Ctrl+S (Windows)
  • Open Extensions Panel
    • Cmd+Shift+X (Mac)
    • Ctrl+Shift+X (Windows)