Azure Data Studio – Keyboard Shortcuts

Keyboard shortcuts have been a staple for the efficient use of applications for a long time.  Who doesn’t use Ctrl + C for copy and Ctrl + v for paste.  Most, if not all applications have shortcuts.  Azure Data Studio isn’t any different.  What is slightly different is that you can create your own shortcuts or modify existing shortcuts.

Azure Data Studio has an entire form dedicated to short cuts.  You can get it under the File menu.

File –> Preferences –> Keyboard Shortcuts

Or you could use the shortcut, this is a post about shortcuts so I should mention it.

Ctrl + k, Ctrl +s

Regardless of how you open the form you will see what is in the image below.

The first item to point out is the search box at the top. Like most search boxes, when you type something Azure Data Studio will filter the list based on critera if what you have typed appears in either the Command or When columns.  If you type the work “center” slowly you will see the list update with each letter you type.

Once you are done with the search, you can remove the search criteria by clicking the button at the far right on the search bar, see image below.  When you do this, the search box will be cleared and all the Keybindings will appear in the list again.

If you look across the top of the list you will see the column headers, Command, keybinding, When and source.

Command – this is the command we would want to execute when the keyboard shortcut is used.   If you look below the Command you can see that the line highlighted is “Cut” with the common shortcut of Ctrl + x.  While there are many commands, what you can’t do is create new commands.

Keybinding – this the keyboard short cut that is associated with the command.  In this case the Keybinding is Ctrl + x, which of course is the short cut.  If you see just a dash in this column, you can use that shortcut at anytime.

When – this is obviously when the shortcut can be used. For this example, the text input must have focus and it cannot be read only.

Source – this is where the short cut came from.  Mostly this will get set to “default”.  If you add a shortcut or modify and existing short cut it will read “user”.

Change an Existing Shortcut

You can change an existing shortcut to something you feel will work better for you.  To make this change all you have to do is click the pencil to the left of the command and a small form will pop uo.  In this form you will enter the new shortcut combination. Then when you hit enter, the change will be saved and the source will change from “default” to “user”.

Add a new shortcut

The first thing was do when adding a new short cut is to find a command that does not currently have a shortcut assigned to it.  For this example, do a search on the work “center”.    This will return the command for the menu item highlighted below to center the layout. Notice that there is not currently a shortcut assigned to this command on the menu.

This is confirmed when I search in the shortcut list.

So now we need to add a shortcut.  In this case we would like to you alt+a.  But before we do so, we should check to see if that combination is already assigned to a command. We can add the shortcut by clicking the “+” to the left of the command.

When you click the “+” next to the command the window below will pop up.  Although I want to use Alt + a for this shortcute, I wanted to show what will happen if I entered a combination that is already in use.  It will simply tell us at the bottom of the form.  In this case, that specific combination is currently in use in 8 other shortcuts.

If you want to know what shortcuts currently use that combination, click the link and you will be taken to the list.

To enter the desired combination you don’t really type it, you actually hit the keys you want to be in the combination.  In our case we want to use “Alt + a”, which is not currently being used by default.  To enter the combination, we need to actually press the Alt key and the “a” key at the same time.  When you hit enter, Azure Data Studio will save as you see in the image below.

Not only will we see the key combination in the list, but the menu item will also be changed.

To Remove a Shortcut

This is easy, just right click on the command and click “Remove Keybinding”.  This will not only removed the keybinding, but if there was a change to the menu when the shortcut was created, that will also be changed.

While I have not found too many instances when I need to add a shortcut or modify and existing shortcut it is good to know that I have an option if I needed it.

Thanks for visiting my blog!!!