IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact
Home » How To » How to Reassign Shortcut Key for Column Selection in Visual Studio Code

How to Reassign Shortcut Key for Column Selection in Visual Studio Code

If you use column selection often in Visual Studio Code, you may find the default shortcut keys combination is a bit too much. By default, to make a column selection or multiple lines in the same horizontal cursor position, you need to press CTRL-SHIFT-ALT and either UP or DOWN arrow depending on the direction of your selections.

Fortunately, you can always assign your own shortcut keys for virtually any functions in this powerful code editor.

So here are the steps to do so.

  1. From the top menu, select File -> Preferences -> Keyboard Shortcuts (or press a combination of CTRL-K CTRL-S) to open the Keyboard Shortcuts windows.

    Visual Studio Code Preferences

  2. Within Keyboard Shorcuts window, look for the following:

     
    cursorColumnSelectDown
    cursorColumnSelectUp
    cursorColumnSelectPageDown
    cursorColumnSelectPageUp
    
  3. Right-click and select Change Keybinding (CTRL-K CTRL-K) and press the key combination you want to use and press ENTER to save it or ESCAPE to cancel. In this example, I use a keyboard combination SHIFT-ALT-ARROW. Repeat this step for each operation.

  4. Once completed, you should see something similar to the screenshot below in your Keyboard Shortcuts window.

    Visual Studio Code Keyboard Shortcuts

That’s it.

If you want to see the configuration in JSON format, you can click on the active link keybindings.json on the top of the Keyboard Shortcuts window (For advanced customizations open and edit keybindings.json), then you’ll see the JavaScript Object Notation that looks similar to the following:

// Place your key bindings in this file to overwrite the defaults
[
    {
        "key": "shift+alt+down",
        "command": "cursorColumnSelectDown",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+down",
        "command": "-cursorColumnSelectDown",
        "when": "editorTextFocus"
    },
    {
        "key": "shift+alt+up",
        "command": "cursorColumnSelectUp",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+up",
        "command": "-cursorColumnSelectUp",
        "when": "editorTextFocus"
    },
    {
        "key": "shift+alt+pagedown",
        "command": "cursorColumnSelectPageDown",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+pagedown",
        "command": "-cursorColumnSelectPageDown",
        "when": "editorTextFocus"
    },
    {
        "key": "shift+alt+pageup",
        "command": "cursorColumnSelectPageUp",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+alt+pageup",
        "command": "-cursorColumnSelectPageUp",
        "when": "editorTextFocus"
    }
]

As indicated on the top banner of Keyboard Shortcuts window, as an advanced user, can always go straight to the keybindings.json and modify the keyboard shortcuts in the json file directly.

Related Articles

How to Make Visual Studio Code Colorize Classic ASP Code
How to Reassign Column Selection Shortcut Keys in Sublime Text

Further Reading

Key Bindings for Visual Studio Code

Download

Visual Studio Code

August 10, 2017 Filed Under: How To Tagged With: Code Editor, Microsoft

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • .NET
  • Coding
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Resources
  • Review
  • WordPress
  • Writing

Recent Posts

  • How to Use Custom Color in SSMS Using Redgate SQL Prompt
  • How to Install Python on Windows Server
  • How to Enable Secure HttpOnly Cookies in IIS
  • How to Create iCloud Mail Email Address
  • How to Import IIS Log to PostgreSQL
Web Hosting

Recent Posts

  • How to Use Custom Color in SSMS Using Redgate SQL Prompt
  • How to Install Python on Windows Server
  • How to Enable Secure HttpOnly Cookies in IIS
  • How to Create iCloud Mail Email Address
  • How to Import IIS Log to PostgreSQL
  • RSS

Tags

.NET Core Access Adobe AdSense Amazon ASP.NET Cdonts Dll Classic ASP Code Editor Connect-It Copywriting ETL Genesis Framework Git Google HP Asset Manager HTML HTML5 Hugo IIS Information Security Internet Internet Information Services iOS Linux macOS Microsoft Microsoft SQL Server MVC Nikon Oracle PHP Simple Mail Transfer Protocol Smtp Server Social Media SQL SQL Server SSIS SSMS SSRS Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2019 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure