> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sherloqdata.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Keyboard Shorcuts

> Keyboard shortcuts directly on your SQL and code editor

Sherloq seamlessly integrates with your editor, allowing you to streamline your workflow and enhance productivity with powerful keyboard shortcuts.&#x20;

Below is a list of available shortcuts and their functionalities:

## Save Query from Editor

To save a query directly from the editor:

1. Highlight the text you want to save.

2. Right-click and select **Save in Sherloq**, or use the keyboard shortcut:

   * **Cmd/Ctrl + Shift + 9**

3. Sherloq will open and save the query.

Learn more about saving queries [here](https://docs.sherloqdata.io/newquery).

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://mintcdn.com/sherloq-31da1dfe/ZD1BvcX8WQjPZQn2/images/sherloq_save_from_editor.mp4?fit=max&auto=format&n=ZD1BvcX8WQjPZQn2&q=85&s=144ab1f05b77482fa459b278a367740f" data-path="images/sherloq_save_from_editor.mp4" />

## Update an Existing Query

To update a previously saved query:

1. Highlight the text you want to update.

2. Right-click and select **Update Query**, or use the keyboard shortcut:

   * **Cmd/Ctrl + Shift + 7**

3. A list of your recent queries will appear, prioritizing the most recently created, viewed, or copied queries for quick access.

Learn more about updating queries [here](https://docs.sherloqdata.io/updatequery).

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://mintcdn.com/sherloq-31da1dfe/14lmDNYXu1QSdw0y/images/update_query.mp4?fit=max&auto=format&n=14lmDNYXu1QSdw0y&q=85&s=ae64450506ba531e05cd532e8b3e92dc" data-path="images/update_query.mp4" />

## Snippets code insertion

To quickly insert stored queries as snippets:

1. Type **`@@`** in the editor.

2. A list of your saved Sherloq queries will appear, ordered by recent activity and customization.

3. Press **Enter** to insert the selected query.

**Tip:** You can create **sub-queries** for commonly used clauses (e.g., `WHERE` or `JOIN` conditions) to speed up query writing and enhance productivity.

Learn more about snippets [here](https://docs.sherloqdata.io/snippets).

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://mintcdn.com/sherloq-31da1dfe/ZD1BvcX8WQjPZQn2/images/snippet_feature_new.mp4?fit=max&auto=format&n=ZD1BvcX8WQjPZQn2&q=85&s=f547f9bb2d2c03fb6aa40989158cf069" data-path="images/snippet_feature_new.mp4" />

## SQL Formatting

To format SQL queries for improved readability:

1. Right-click and select **Format Query**, or use the keyboard shortcut:

   * **Cmd/Ctrl + Shift + 0**

2. The code will be beautified with proper indentation and structure.

Learn more about formatting [here](https://docs.sherloqdata.io/formatting).

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://mintcdn.com/sherloq-31da1dfe/tD9AIrHANoNaF5Xm/images/formatting_new.mp4?fit=max&auto=format&n=tD9AIrHANoNaF5Xm&q=85&s=74f3022906168c86b882d051eee5110f" data-path="images/formatting_new.mp4" />

## Keyboard Shortcuts Not Working?

If your keyboard shortcuts are not working, it could be due to conflicts with multiple editors using the same key combinations. You can modify or remove conflicting shortcuts in **VS Code** and **DataGrip** by following these steps:

1. Open **Settings**.

2. Navigate to **Keymap**.

3. Use the search bar to filter for **"toggle bookmark"**.

4. Right-click the conflicting shortcut and select **Remove** to free up the key combination for Sherloq.

Once removed, you can use the Sherloq shortcuts as intended without conflicts.

<img src="https://mintcdn.com/sherloq-31da1dfe/tD9AIrHANoNaF5Xm/images/keyboard_keymap.png?fit=max&auto=format&n=tD9AIrHANoNaF5Xm&q=85&s=e08afae89c3310d131093baf78988452" alt="Keyboard shorcuts modifications" width="400" data-path="images/keyboard_keymap.png" />

Need more help? Visit our [help center](https://docs.sherloqdata.io/contactus).

***
