DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Boosting React.js Development Productivity With Google Code Assist
  • Chat with Your Oracle Database: SQLcl MCP + GitHub Copilot
  • Mastering GitHub Copilot in VS Code: Ask, Edit, Agent and the Build–Refine–Verify Workflow
  • Theia Deep Dive, Part 2: Mastering Customization

Trending

  • Beyond Manual Annotation: Engineering Self-Correcting Pseudo-Labeling Pipelines
  • Building a Production-Ready AI Agent in 2026: Beyond the Hello World Demo
  • Ujorm3: A New Lightweight ORM for JavaBeans and Records
  • Multi-Scale Feature Learning in CNN and U-Net Architectures
  1. DZone
  2. Coding
  3. Tools
  4. Setting Custom Shortcuts in Visual Studio Code

Setting Custom Shortcuts in Visual Studio Code

How to take advantage of customizing your keyboard shortcuts in Visual Studio Code.

By 
Vipul Malhotra user avatar
Vipul Malhotra
·
Jul. 23, 16 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
215.6K Views

Join the DZone community and get the full member experience.

Join For Free

I have been using Visual Studio for the last 4 years for all sorts of learning and development projects. Now that I have moved my focus a bit towards Node.js and switched to Microsoft's Visual Studio Code, I feel a bit of uneasiness at times due to the different shortcut keys.

Visual Studio Code provides us a feature to can change the shortcut keys according to our preference, and that is the scope of this blog.

In Visual Studio, the shortcut for Code Formatting is Ctrl+k Ctrl+D but in Visual Studio Code, it's Shift+Alt+F. 

Let's try and change it to Ctrl+k Ctrl+D

Step 1: In your Visual Studio Code windows, go to File->Preferences->Keyboard Shortcut

Image title

This will open two files beside each other like in the screenshot below:

Image title

Step 2: Now, on the window on the right i.e. the keybindings.json file, you can define your own shortcut in the below format: 

// Place your key bindings in this file to overwrite the defaults  
[ {  
    "key": "ctrl+k ctrl+d", "command":"editor.action.format"  

}  
] 

In the above code, we have defined that the set of keys, Ctrl+k Ctrl+D, will fulfill the command of formatting the code in the code editor. 

Now both the commands, Ctrl+K Ctrl+D and Shift+Alt+F work as code format keys in Visual Studio Code. 

Hope this article, helped in making coding with Visual Studio Code easier.

Visual Studio Code

Opinions expressed by DZone contributors are their own.

Related

  • Boosting React.js Development Productivity With Google Code Assist
  • Chat with Your Oracle Database: SQLcl MCP + GitHub Copilot
  • Mastering GitHub Copilot in VS Code: Ask, Edit, Agent and the Build–Refine–Verify Workflow
  • Theia Deep Dive, Part 2: Mastering Customization

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook