---
title: Keyboard shortcuts
project: TotalSQL
version: Latest
section: reference
language: en
license: 
url: https://totaljs.es/docs/totalsql/latest/reference/shortcuts/
updated: 2026-12-02T15:40:26.075Z
---

# Keyboard shortcuts

> The keys of TotalSQL, for the Mac and for Windows and Linux.

## In the window

| Action | Mac | Windows and Linux |
| --- | --- | --- |
| New query, in an open connection | ⌘T | Ctrl+T |
| Close the tab in front. With none, the connection, and then the window | ⌘W | |
| Close the window | ⇧⌘W | Alt+F4 |
| Close a dialog or a menu | Esc | Esc |

Before something that is not saved is lost, TotalSQL asks.

## In a query

| Action | Mac | Windows and Linux |
| --- | --- | --- |
| Run the selection, or everything | ⌘↵ | Ctrl+Enter |
| Offer words and tables | ⌥I or ⌃Space | Ctrl+Space |
| Take the word offered | ↵ | Enter |
| Comment the lines, or take the comment away | ⌘/ | Ctrl+/ |
| Move the line up or down | ⌥↑ and ⌥↓ | Alt+↑ and Alt+↓ |
| Copy the line above or below | ⇧⌥↑ and ⇧⌥↓ | Shift+Alt+↑ and Shift+Alt+↓ |
| Delete the line | ⇧⌘K | Ctrl+Shift+K |
| Indent the lines, or the opposite | Tab and ⇧Tab | Tab and Shift+Tab |
| Undo | ⌘Z | Ctrl+Z |
| Redo | ⇧⌘Z | Ctrl+Y |

Tab writes in the editor. To leave the editor with the keyboard, press Esc and then Tab.

## In the rows

Press Tab to enter the grid. It has one active cell, or one active column name.

| Action | Mac | Windows and Linux |
| --- | --- | --- |
| Move a cell | The arrows | The arrows |
| Go to the first or last row | ⌘↑ and ⌘↓ | Ctrl+↑ and Ctrl+↓ |
| Go to the first or last column | ⌘← and ⌘→ | Ctrl+← and Ctrl+→ |
| Go to the first or last column | Home and End | Home and End |
| Go to the first or last cell of all | ⌘Home and ⌘End | Ctrl+Home and Ctrl+End |
| Move a screen | Page Up and Page Down | Page Up and Page Down |
| [Change the value](/totalsql/latest/guides/edit-rows/#change-a-value) | ↵ or F2 | Enter or F2 |
| Copy the value | ⌘C | Ctrl+C |
| Open the menu of the cell | ⇧F10 | Shift+F10 or the menu key |

## In the names of the columns

Go up from the first row to reach them.

| Action | Mac | Windows and Linux |
| --- | --- | --- |
| Sort by the column, in a table | ↵ | Enter |
| Move the column | ⌥← and ⌥→ | Alt+← and Alt+→ |
| Make it narrower or wider | ⇧⌥← and ⇧⌥→ | Shift+Alt+← and Shift+Alt+→ |

The last two also work from any cell of the column.
