How to remove unused imports & organize code in vs code editor

As a developer or programmer, organizing code and removing unused imports for optimization is very important. It’s a good practice for coding.

organize code with vs code text editor
md kayesh a senior front end developer

Md Kayesh

6 min readJune 11, 2024

You can use a keyboard shortcut to remove the unused imports in VS Code:


  • on Windows and Linux, press Shift + Alt + O (the letter O, not zero).
  • on macOS, press Shift + Option + O (the letter O, not zero).



# Using the Remove Unused Imports command


  • Ctrl + Shift + P on Windows and Linux
  • Command + Shift + P on macOS



This is how you can organize & remove unused imports in vs code.

Copyright 2024 © Md Kayesh