creator-keyboard-shortcuts.qdoc 17.8 KB
Newer Older
1 2
/****************************************************************************
**
3
** Copyright (c) 2014 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
**
****************************************************************************/

// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************

/*!
26
    \contentspage {Qt Creator Manual}
27 28
    \previouspage creator-cli.html
    \page creator-keyboard-shortcuts.html
29
    \nextpage creator-editor-external.html
30 31 32 33 34 35

    \title Keyboard Shortcuts

    \QC provides various keyboard shortcuts to speed up your development
    process.

36
    To view all keyboard shortcuts defined in \QC, and to change them, select
37 38
    \gui {Tools > Options > Environment > Keyboard}. The shortcuts are listed by
    category. To find a keyboard
39 40 41 42 43
    shortcut in the list, enter a function name or shortcut in the \gui Filter
    field.

    \image qtcreator-keyboard-shortcuts.png

44 45 46 47 48 49 50 51 52 53 54 55
    The shortcuts that are displayed in red color are associated with several
    functions. \QC executes the function that is available in the current
    context. If several functions are available for the same shortcut at a
    time, there is a conflict and \QC cannot execute any function.

    A keyboard shortcut might also conflict with a shortcut that a Window
    manager uses for its own purposes. In that case, \QC shortcuts do not work.
    Typically, you can configure the shortcuts in the window manager, but if
    that is not allowed, you can change the \QC shortcuts. For example, Unity on
    Ubuntu 11.10 uses \key F10 in its window manager, and therefore the default
    \QC keyboard shortcut \key F10 (Step Over) does not work on that system.

56 57 58 59 60 61
    \section1 Configuring Keyboard Shortcuts

    To customize a keyboard shortcut:

    \list 1

62
        \li Select \gui Tools > \gui Options > \gui Environment > \gui Keyboard.
63

64
        \li Select a command from the list.
65

66
        \li In \gui{Key Sequence} enter the shortcut key you want to associate
67 68
            with the selected command.

69
        \li To revert to the default shortcut, select \gui Reset.
70 71 72 73 74 75 76

    \endlist

    \QC allows you to use different keyboard shortcut mapping schemes:

    \list

77
        \li To import a keyboard shortcut mapping scheme, click \gui Import
78
            and select the .kms file containing the keyboard shortcut mapping scheme
79 80
            you want to import.

81
        \li To export the current keyboard shortcut mapping scheme, click
82
            \gui Export and select the location where you want to save the
83
            exported .kms file.
84 85 86 87 88 89 90 91 92 93 94 95

    \endlist

    \section1 Default Keyboard Shortcuts

    The following tables list the default keyboard shortcuts. They are
    categorized by actions.

    \section2 General Keyboard Shortcuts

    \table
        \header
96 97
            \li  Action
            \li  Keyboard shortcut
98
        \row
99 100
            \li  Open file or project
            \li  Ctrl+O
101
        \row
102 103
            \li  New file or project
            \li  Ctrl+N
104
        \row
105 106
            \li  Open in external editor
            \li  Alt+V, Alt+I
107
        \row
108 109
            \li  Select all
            \li  Ctrl+A
110
        \row
111 112
            \li  Delete
            \li  Del
113
        \row
114 115
            \li  Cut
            \li  Ctrl+X
116
        \row
117 118
            \li  Copy
            \li  Ctrl+C
119
        \row
120 121
            \li  Paste
            \li  Ctrl+V
122
        \row
123 124
            \li  Redo
            \li  Ctrl+Y
125
        \row
126 127
            \li  Print
            \li  Ctrl+P
128
        \row
129 130
            \li  Save
            \li  Ctrl+S
131
        \row
132 133
            \li  Save all
            \li  Ctrl+Shift+S
134
        \row
135 136
            \li  Close window
            \li  Ctrl+W
137
        \row
138 139
            \li  Close all
            \li  Ctrl+Shift+W
140
        \row
141 142
            \li  Close current file
            \li  Ctrl+F4
143
        \row
144 145
            \li  Go back
            \li  Alt+Left
146
        \row
147 148
            \li  Go forward
            \li  Alt+Right
149
        \row
150 151
            \li  Go to line
            \li  Ctrl+L
152
        \row
153 154
            \li  Next open document in history
            \li  Ctrl+Shift+Tab
155
        \row
156 157
            \li  Go to other split
            \li  Ctrl+E, O
158
        \row
159 160
            \li  Previous open document in history
            \li  Ctrl+Tab
161
        \row
162 163
            \li  Activate \gui Locator
            \li  Ctrl+K
164
        \row
165 166
            \li  Switch to \gui Welcome mode
            \li  Ctrl+1
167
        \row
168 169
            \li  Switch to \gui Edit mode
            \li  Ctrl+2
170
        \row
171 172
            \li  Switch to \gui Design mode
            \li  Ctrl+3
173
        \row
174 175
            \li  Switch to \gui Debug mode
            \li  Ctrl+4
176
        \row
177 178
            \li  Switch to \gui Projects mode
            \li  Ctrl+5
179
        \row
180 181
            \li  Switch to \gui Analyze mode
            \li  Ctrl+6
Leena Miettinen's avatar
Leena Miettinen committed
182
        \row
183 184
            \li  Switch to \gui Help mode
            \li  Ctrl+7
185
        \row
186
            \li  Toggle \gui{Issues} pane
187
            \li  Alt+1 (Cmd+1 on OS X)
188
        \row
189
            \li  Toggle \gui{Search Results} pane
190
            \li  Alt+2 (Cmd+2 on OS X)
191
        \row
192
            \li  Toggle \gui{Application Output} pane
193
            \li  Alt+3 (Cmd+3 on OS X)
194
        \row
195
            \li  Toggle \gui{Compile Output} pane
196
            \li  Alt+4 (Cmd+4 on OS X)
197
        \row
198
            \li  Toggle other output panes
199
            \li  Alt+number (Cmd+number on OS X)
200 201

            Where the number is the number of the output pane.
202
        \row
203 204
            \li  Activate \gui Bookmarks pane
            \li  Alt+M
205
        \row
206 207
            \li  Activate \gui{File System} pane
            \li  Alt+Y
208
        \row
209 210
            \li  Activate \gui{Open Documents} pane
            \li  Alt+O
211
        \row
212 213
            \li  Maximize output panes
            \li  Alt+9
214
        \row
215 216
            \li  Move to next item in output panes
            \li  F6
217
        \row
218 219
            \li  Move to previous item in output panes
            \li  Shift+F6
220
        \row
221 222
            \li  Activate \gui Projects pane
            \li  Alt+X
223
        \row
224 225
            \li  Full screen
            \li  Ctrl+Shift+F11
226
        \row
227
            \li  Toggle the sidebar
228
            \li  Alt+0 (Cmd+0 on OS X)
229
        \row
230 231
            \li  Undo
            \li  Ctrl+Z
232
        \row
233
            \li  Move to \gui Edit mode
234 235 236

               In \gui Edit mode:
               \list
237 238
                \li  The first press moves focus to the editor
                \li  The second press closes secondary windows
239
               \endlist
240
            \li  Esc
241
        \row
242 243
            \li  Exit \QC
            \li  Ctrl+Q
244 245 246 247 248 249
    \endtable

    \section2 Editing Keyboard Shortcuts

    \table
        \header
250 251
            \li  Action
            \li  Keyboard shortcut
252
        \row
253 254
            \li  Auto-indent selection
            \li  Ctrl+I
255
        \row
256 257
            \li  Collapse
            \li  Ctrl+<
258
        \row
259 260
            \li  Expand
            \li  Ctrl+>
261
        \row
262 263
            \li  Trigger a completion in this scope
            \li  Ctrl+Space
264
        \row
265 266
            \li  Copy line
            \li  Ctrl+Ins
267
        \row
268 269
            \li  Copy line down
            \li  Ctrl+Alt+Down
270
        \row
271 272
            \li  Copy line up
            \li  Ctrl+Alt+Up
273
        \row
274 275
            \li  Paste from the clipboard history
            \li  Ctrl+Shift+V
276 277

               Subsequent presses move you back in the history
278
        \row
279 280
            \li  Cut line
            \li  Shift+Del
281
        \row
282 283
            \li  Join lines
            \li  Ctrl+J
284
        \row
285 286
            \li  Insert line above current line
            \li  Ctrl+Shift+Enter
287
        \row
288 289
            \li  Insert line below current line
            \li  Ctrl+Enter
290
        \row
291 292
            \li  Decrease font size
            \li  Ctrl+- (Ctrl+Roll mouse wheel down)
293
        \row
294 295
            \li  Increase font size
            \li  Ctrl++ (Ctrl+Roll mouse wheel up)
296
        \row
297 298
            \li  Reset font size
            \li  Ctrl+0
299
        \row
300 301
            \li  Toggle Vim-style editing
            \li  Alt+V, Alt+V
302
        \row
303 304
            \li  Split
            \li  Ctrl+E, 2
305
        \row
306 307
            \li  Split side by side
            \li  Ctrl+E, 3
308
        \row
309 310
            \li  Remove all splits
            \li  Ctrl+E, 1
311
        \row
312 313
            \li  Remove current split
            \li  Ctrl+E, 0
314
        \row
315 316
            \li  Select all
            \li  Ctrl+A
317
        \row
318 319
            \li  Go to block end
            \li  Ctrl+]
320
        \row
321 322
            \li  Go to block start
            \li  Ctrl+[
323
        \row
324 325
            \li  Go to block end with selection
            \li  Ctrl+}
326
        \row
327 328
            \li  Go to block start with selection
            \li  Ctrl+{
329
        \row
330 331
            \li  Move current line down
            \li  Ctrl+Shift+Down
332
        \row
333 334
            \li  Move current line up
            \li  Ctrl+Shift+Up
335
        \row
336 337
            \li  Trigger a refactoring action in this scope
            \li  Alt+Enter
338
        \row
339 340
            \li  Rewrap paragraph
            \li  Ctrl+E, R
341
        \row
342
            \li  Select the current block
343 344

               The second press extends the selection to the parent block
345
            \li  Ctrl+U
346
        \row
347 348
            \li  Enable text wrapping
            \li  Ctrl+E, Ctrl+W
349
        \row
350 351
            \li  Toggle comment for selection
            \li  Ctrl+/
352
        \row
353 354
            \li  Visualize whitespace
            \li  Ctrl+E, Ctrl+V
355
        \row
356 357
            \li  Adjust size
            \li  Ctrl+J
358
        \row
359 360
            \li  Lay out in a grid
            \li  Ctrl+G
361
        \row
362 363
            \li  Lay out horizontally
            \li  Ctrl+H
364
        \row
365 366
            \li  Lay out vertically
            \li  Ctrl+L
367
        \row
368 369
            \li  Preview
            \li  Alt+Shift+R
370
        \row
371 372
            \li  Edit signals and slots
            \li  F4
373
        \row
374 375
            \li  Toggle bookmark
            \li  Ctrl+M
376
        \row
377 378
            \li  Go to next bookmark
            \li  Ctrl+.
379
        \row
380 381
            \li  Go to previous bookmark
            \li  Ctrl+,
382
        \row
383 384
            \li  Fetch snippet
            \li  Alt+C, Alt+F
385
        \row
386 387
            \li  Paste snippet
            \li  Alt+C, Alt+P
388
        \row
389 390
            \li  Find usages
            \li  Ctrl+Shift+U
391
        \row
392
            \li  Follow symbol under cursor
393

394
               Works with namespaces, classes, functions, variables, include
395
               statements and macros
396
            \li  F2
397
        \row
398 399
            \li  Rename symbol under cursor
            \li  Ctrl+Shift+R
400
        \row
401
            \li  Switch between function declaration and definition
402
            \li  Shift+F2
403
        \row
404 405
            \li  Open type hierarchy
            \li  Ctrl+Shift+T
406
        \row
407 408
            \li  Switch between header and source file
            \li  F4
409
        \row
410 411
            \li  Turn selected text into lowercase
            \li  Alt+U
412
        \row
413 414
            \li  Turn selected text into uppercase
            \li  Alt+Shift+U
415
        \row
416 417
            \li  Run static checks on JavaScript code to find common problems
            \li  Ctrl+Shift+C
418
        \row
419 420
            \li  Find and replace
            \li  Ctrl+F
421
        \row
422 423
            \li  Find next
            \li  F3
424
        \row
425 426
            \li  Find previous
            \li  Shift+F3
427
        \row
428 429
            \li  Find next occurrence of selected text
            \li  Ctrl+F3
430
        \row
431 432
            \li  Find previous occurrence of selected text
            \li  Ctrl+Shift+F3
433
        \row
434 435
            \li  Replace next
            \li  Ctrl+=
Leena Miettinen's avatar
Leena Miettinen committed
436
        \row
437 438
            \li  Open advanced find
            \li  Ctrl+Shift+F
439
        \row
440 441
            \li  Record a text-editing macro
            \li  Alt+(
442
        \row
443 444
            \li  Stop recording a macro
            \li  Alt+)
445
        \row
446 447
            \li  Play last macro
            \li  Alt+R
448
        \row
449 450
            \li  Show Qt Quick toolbars
            \li  Ctrl+Alt+Space
451
        \row
452 453
            \li  Execute user actions in FakeVim mode
            \li  Alt+V, n, where n is the number of the user action, from 1 to 9
454 455 456 457 458 459
    \endtable

    \section2 Image Viewer Shortcuts

    \table
        \header
460 461
            \li  Action
            \li  Keyboard shortcut
462
        \row
463 464
            \li  Switch to background
            \li  Ctrl+[
465
        \row
466 467
            \li  Switch to outline
            \li  Ctrl+]
468
        \row
469 470
            \li  Zoom in
            \li  Ctrl++
471
        \row
472 473
            \li  Zoom out
            \li  Ctrl+-
474
        \row
475 476
            \li  Fit to screen
            \li  Ctrl+=
477
        \row
478 479
            \li  Original size
            \li  Ctrl+0
480 481 482 483 484 485
    \endtable

    \section2 Qt Quick Designer Keyboard Shortcuts

    \table
        \header
486 487
            \li  Action
            \li  Keyboard shortcut
Leena Miettinen's avatar
Leena Miettinen committed
488
        \row
489 490
            \li  Open the QML file that defines the selected component
            \li  F2
Leena Miettinen's avatar
Leena Miettinen committed
491
        \row
492 493
            \li  Move between code editor and visual editor
            \li  F4
494
        \row
495 496
            \li  Toggle left sidebar
            \li  Ctrl+Alt+0
497
        \row
498 499
            \li  Toggle right sidebar
            \li  Ctrl+Alt+Shift+0
500 501 502 503 504 505
    \endtable

    \section2 Debugging Keyboard Shortcuts

    \table
        \header
506 507
            \li  Action
            \li  Keyboard shortcut
508
        \row
509 510
            \li  Start or continue debugging
            \li  F5
511
        \row
512 513
            \li  Exit debugger
            \li  Shift+F5
514
        \row
515 516
            \li  Step over
            \li  F10
517
        \row
518 519
            \li  Step into
            \li  F11
520
        \row
521 522
            \li  Step out
            \li  Shift+F11
523
        \row
524 525
            \li  Toggle breakpoint
            \li  F9
526
        \row
527 528
            \li  Run to selected function
            \li  Ctrl+F6
529
        \row
530 531
            \li  Run to line
            \li  Ctrl+F10
532
        \row
533 534
            \li  Reverse direction
            \li  F12
535 536 537 538 539 540
    \endtable

    \section2 Project Keyboard Shortcuts

    \table
        \header
541 542
            \li  Action
            \li  Keyboard shortcut
543
        \row
544 545
            \li  Build project
            \li  Ctrl+B
546
        \row
547 548
            \li  Build all
            \li  Ctrl+Shift+B
549
        \row
550 551
            \li  New project
            \li  Ctrl+Shift+N
552
        \row
553 554
            \li  Open project
            \li  Ctrl+Shift+O
555
        \row
556 557
            \li  Select the \l{glossary-buildandrun-kit}{kit} to build and run your project with
            \li  Ctrl+T
558
        \row
559 560
            \li  Run
            \li  Ctrl+R
561 562 563 564 565 566
    \endtable

    \section2 Help Keyboard Shortcuts

    \table
        \header
567 568
            \li  Action
            \li  Keyboard shortcut
569
        \row
570 571
            \li  View context-sensitive help
            \li  F1
572
        \row
573 574
            \li  Activate contents in \gui Help mode
            \li  Ctrl+T
575
        \row
576 577
            \li  Add bookmark in \gui Help mode
            \li  Ctrl+M
578
        \row
579 580
            \li  Activate index in \gui Help mode
            \li  Ctrl+I
581
        \row
582 583
            \li  Reset font size
            \li  Ctrl+0
584
        \row
585 586
            \li  Activate search in \gui Help mode
            \li  Ctrl+S
587 588 589 590 591 592
    \endtable

    \section2 Version Control Keyboard Shortcuts

    \table
        \header
593 594
            \li  {1,2} Action
            \li  {6,1} Version control system
595
        \header
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614
            \li  Bazaar
            \li  CVS
            \li  Git
            \li  Mercurial
            \li  Perforce
            \li  Subversion
        \row
            \li  Add
            \li
            \li  Alt+C, Alt+A
            \li  Alt+G, Alt+A
            \li
            \li  Alt+P, Alt+A
            \li  Alt+S, Alt+A
        \row
            \li  Commit/Submit
            \li  Alt+Z, Alt+C
            \li  Alt+C, Alt+C
            \li  Alt+G, Alt+C
615
            \li  Alt+G, Alt+C
616 617 618 619 620 621 622
            \li  Alt+P, Alt+S
            \li  Alt+S, Alt+C
        \row
            \li  Diff
            \li  Alt+Z, Alt+D
            \li  Alt+C, Alt+D
            \li  Alt+G, Alt+D
623
            \li  Alt+G, Alt+D
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646
            \li
            \li  Alt+S, Alt+D
        \row
            \li  Diff project
            \li
            \li
            \li  Alt+G, Alt+Shift+D
            \li
            \li  Alt+P, Alt+D
            \li
        \row
            \li  Blame/Annotate
            \li
            \li
            \li  Alt+G, Alt+B
            \li
            \li
            \li
        \row
            \li  Log/Filelog
            \li  Alt+Z, Alt+L
            \li
            \li  Alt+G, Alt+L
647
            \li  Alt+G, Alt+L
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662
            \li  Alt+P, Alt+F
            \li
        \row
            \li  Log project
            \li
            \li
            \li  Alt+G, Alt+K
            \li
            \li
            \li
        \row
            \li  Status
            \li  Alt+Z, Alt+S
            \li
            \li
663
            \li  Alt+G, Alt+S
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689
            \li
            \li
        \row
            \li  Undo changes/Revert
            \li
            \li
            \li  Alt+G, Alt+U
            \li
            \li  Alt+P, Alt+R
            \li
        \row
            \li  Edit
            \li
            \li
            \li
            \li
            \li  Alt+P, Alt+E
            \li
        \row
            \li  Opened
            \li
            \li
            \li
            \li
            \li  Alt+P, Alt+O
            \li
690 691
    \endtable
*/