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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Architectural Collapse: How Extension Poisoning, Node Vulnerabilities, and Infrastructure Fog Enabled the GitHub Repository Breach
  • I Built a VS Code Extension to Debug Azure AI Foundry Agents Without Leaving My Editor
  • Boosting React.js Development Productivity With Google Code Assist
  • Chat with Your Oracle Database: SQLcl MCP + GitHub Copilot

Trending

  • Claude Code Superpowers: The 5-Tool Stack That Ends Limits and Context Amnesia
  • Idempotency Under Concurrency: Why Your Application Check Isn't the Last Line of Defense
  • Build Software Faster With Three Simple Principles
  • Building a Practical Cloud-Native Golden Path: A Guide to Kubernetes-Based Service Delivery, Self-Service, and Developer-Friendly Defaults

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
Jul. 23, 16 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
215.8K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

  • Architectural Collapse: How Extension Poisoning, Node Vulnerabilities, and Infrastructure Fog Enabled the GitHub Repository Breach
  • I Built a VS Code Extension to Debug Azure AI Foundry Agents Without Leaving My Editor
  • Boosting React.js Development Productivity With Google Code Assist
  • Chat with Your Oracle Database: SQLcl MCP + GitHub Copilot

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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