aboutsummaryrefslogtreecommitdiffstats
path: root/doc/qtcreator/src/howto/creator-keyboard-shortcuts.qdoc
blob: 661d8495bab779b5bbf9db2ac1174c7f53ebb173 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
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
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

// **********************************************************************
// 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.
// **********************************************************************

/*!
    \contentspage index.html
    \page creator-keyboard-shortcuts.html
    \if defined(qtdesignstudio)
    \previouspage studio-platforms.html
    \nextpage creator-coding.html
    \else
    \previouspage creator-cli.html
    \nextpage creator-editor-external.html
    \endif

    \title Keyboard Shortcuts

    \QC provides various keyboard shortcuts to speed up your development
    process. In addition, you can specify your own keyboard shortcuts for some
    functions that can be easily performed with a mouse, and therefore do not
    appear in menus or have default keyboard shortcuts. For example, selecting
    and deleting words or lines in an editor.

    To view all functions available in \QC and the keyboard shortcuts defined
    for them, select
    \uicontrol Tools > \uicontrol Options > \uicontrol Environment >
    \uicontrol Keyboard. The shortcuts are listed by category. To find a keyboard
    shortcut in the list, enter a function name or shortcut in the \uicontrol Filter
    field.

    \image qtcreator-keyboard-shortcuts.png

    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.
    \if defined(qtcreator)
    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.
    \endif


    To override the platform default value that determines whether
    keyboard shortcuts are shown in the labels of context menu items,
    select \uicontrol Tools > \uicontrol Options > \uicontrol Environment >
    \uicontrol Interface. The label of the \uicontrol {Show keyboard shortcuts
    in context menus} check box indicates whether the platform default value
    is \c on or \c off.

    \image qtcreator-options-environment-interface.png "Interface tab in the Environment options"

    \section1 Configuring Keyboard Shortcuts

    To customize a keyboard shortcut:

    \list 1

        \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Environment
            > \uicontrol Keyboard.

        \li Select a command from the list.

        \li In the \uicontrol{Key Sequence} field, you have the following
            options:

            \list

                \li Enter the shortcut key you want to associate with the
                    selected command.

                \li Select \uicontrol Record, press the keys to use as the
                    keyboard shortcut, and select \uicontrol {Stop Recording}
                    when you are done.

            \endlist

        \li To revert to the default shortcut, select \uicontrol Reset.

    \endlist

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

    \list

        \li To import a keyboard shortcut mapping scheme, click \uicontrol Import
            and select the .kms file containing the keyboard shortcut mapping scheme
            you want to import.

        \li To export the current keyboard shortcut mapping scheme, click
            \uicontrol Export and select the location where you want to save the
            exported .kms file.

    \endlist

    \section1 Default Keyboard Shortcuts

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

    \section2 General Keyboard Shortcuts

    \table
        \header
            \li  Action
            \li  Keyboard shortcut
        \row
            \li  Open file or project
            \li  Ctrl+O
        \row
            \li  New file or project
            \li  Ctrl+N
        \row
            \li  Open in external editor
            \li  Alt+V, Alt+I
        \row
            \li  Select all
            \li  Ctrl+A
        \row
            \li  Delete
            \li  Del
        \row
            \li  Cut
            \li  Ctrl+X
        \row
            \li  Copy
            \li  Ctrl+C
        \row
            \li  Paste
            \li  Ctrl+V
        \row
            \li  Redo
            \li  Ctrl+Y
        \row
            \li  Print
            \li  Ctrl+P
        \row
            \li  Save
            \li  Ctrl+S
        \row
            \li  Save all
            \li  Ctrl+Shift+S
        \row
            \li  Close window
            \li  Ctrl+W
        \row
            \li  Close all
            \li  Ctrl+Shift+W
        \row
            \li  Close current file
            \li  Ctrl+F4
        \row
            \li  Go back
            \li  Alt+Left
        \row
            \li  Go forward
            \li  Alt+Right
        \row
            \li  Go to line
            \li  Ctrl+L
        \row
            \li  Next open document in history
            \li  Ctrl+Shift+Tab
        \row
            \li  Go to other split
            \li  Ctrl+E, O
        \row
            \li  Previous open document in history
            \li  Ctrl+Tab
        \row
            \li  Activate \uicontrol Locator
            \li  Ctrl+K
        \row
            \li  Switch to \uicontrol Welcome mode
            \li  Ctrl+1
        \row
            \li  Switch to \uicontrol Edit mode
            \li  Ctrl+2
        \row
            \li  Switch to \uicontrol Design mode
            \li  Ctrl+3
        \row
            \li  Switch to \uicontrol Debug mode
            \li  Ctrl+4
        \row
            \li  Switch to \uicontrol Projects mode
            \li  Ctrl+5
        \row
            \li  Switch to \uicontrol Help mode
            \li  Ctrl+6
        \row
            \li  Toggle \uicontrol{Issues} pane
            \li  Alt+1 (Cmd+1 on \macos)
        \row
            \li  Toggle \uicontrol{Search Results} pane
            \li  Alt+2 (Cmd+2 on \macos)
        \row
            \li  Toggle \uicontrol{Application Output} pane
            \li  Alt+3 (Cmd+3 on \macos)
        \row
            \li  Toggle \uicontrol{Compile Output} pane
            \li  Alt+4 (Cmd+4 on \macos)
        \row
            \li  Toggle other output panes
            \li  Alt+number (Cmd+number on \macos)

            Where the number is the number of the output pane.
        \if defined(qtcreator)
        \row
            \li  Activate \uicontrol Bookmarks view
            \li  Alt+M
        \endif
        \row
            \li  Activate \uicontrol{File System} view
            \li  Alt+Y
        \row
            \li  Activate \uicontrol{Open Documents} view
            \li  Alt+O
        \row
            \li  Maximize output panes
            \li  Alt+9
        \row
            \li  Move to next item in output panes
            \li  F6
        \row
            \li  Move to previous item in output panes
            \li  Shift+F6
        \row
            \li  Activate \uicontrol Projects view
            \li  Alt+X
        \row
            \li  Full screen
            \li  Ctrl+Shift+F11
        \row
            \li  Toggle the sidebar
            \li  Alt+0 (Cmd+0 on \macos)
        \row
            \li  Undo
            \li  Ctrl+Z
        \row
            \li  Move to \uicontrol Edit mode

               In \uicontrol Edit mode:
               \list
                \li  The first press moves focus to the editor
                \li  The second press closes secondary windows
               \endlist
            \li  Esc
        \row
            \li  Exit \QC
            \li  Ctrl+Q
    \endtable

    \section2 Editing Keyboard Shortcuts

    \table
        \header
            \li  Action
            \li  Keyboard shortcut
        \row
            \li  Auto-indent selection
            \li  Ctrl+I
        \row
            \li  Collapse
            \li  Ctrl+<
        \row
            \li  Expand
            \li  Ctrl+>
        \row
            \li  Trigger a completion in this scope
            \li  Ctrl+Space
        \row
            \li  Copy line
            \li  Ctrl+Ins
        \row
            \li  Copy line down
            \li  Ctrl+Alt+Down
        \row
            \li  Copy line up
            \li  Ctrl+Alt+Up
        \row
            \li  Paste from the clipboard history
            \li  Ctrl+Shift+V

               Subsequent presses move you back in the history
        \row
            \li  Cut line
            \li  Shift+Del
        \row
            \li  Join lines
            \li  Ctrl+J
        \row
            \li  Insert line above current line
            \li  Ctrl+Shift+Enter
        \row
            \li  Insert line below current line
            \li  Ctrl+Enter
        \row
            \li  Decrease font size
            \li  Ctrl+- (Ctrl+Roll mouse wheel down)
        \row
            \li  Increase font size
            \li  Ctrl++ (Ctrl+Roll mouse wheel up)
        \row
            \li  Reset font size
            \li  Ctrl+0
        \row
            \li  Toggle Vim-style editing
            \li  Alt+V, Alt+V
        \row
            \li  Split
            \li  Ctrl+E, 2
        \row
            \li  Split side by side
            \li  Ctrl+E, 3
        \row
            \li  Remove all splits
            \li  Ctrl+E, 1
        \row
            \li  Remove current split
            \li  Ctrl+E, 0
        \row
            \li  Select all
            \li  Ctrl+A
        \row
            \li  Go to block end
            \li  Ctrl+]
        \row
            \li  Go to block start
            \li  Ctrl+[
        \row
            \li  Go to block end and select the lines between the current cursor
                 position and the end of the block
            \li  Ctrl+Shift+]
        \row
            \li  Go to block start and select the lines between the current
                 cursor position and the beginning of the block
            \li  Ctrl+Shift+[
        \row
            \li  Select the current block

                 The second press extends the selection to the parent block. To
                 enable this behavior, select \uicontrol Tools >
                 \uicontrol Options > \uicontrol {Text Editor} >
                 \uicontrol Behavior >
                 \uicontrol {Enable smart selection changing}.
            \li  Ctrl+U
        \row
            \li  Undo the latest smart block selection
            \li  Ctrl+Alt+Shift+U
        \row
            \li  Move current line down
            \li  Ctrl+Shift+Down
        \row
            \li  Move current line up
            \li  Ctrl+Shift+Up
        \row
            \li  Trigger a refactoring action in this scope
            \li  Alt+Enter
        \row
            \li  Rewrap paragraph
            \li  Ctrl+E, R
        \row
            \li  Enable text wrapping
            \li  Ctrl+E, Ctrl+W
        \row
            \li  Toggle comment for selection
            \li  Ctrl+/
        \row
            \li  Visualize whitespace
            \li  Ctrl+E, Ctrl+V
        \row
            \li  Adjust size
            \li  Ctrl+J
        \row
            \li  Lay out in a grid
            \li  Ctrl+G
        \row
            \li  Lay out horizontally
            \li  Ctrl+H
        \row
            \li  Lay out vertically
            \li  Ctrl+L
        \row
            \li  Preview
            \li  Alt+Shift+R
        \if defined(qtcreator)
        \row
            \li  Edit signals and slots
            \li  F4
        \row
            \li  Toggle bookmark
            \li  Ctrl+M
        \row
            \li  Go to next bookmark
            \li  Ctrl+.
        \row
            \li  Go to previous bookmark
            \li  Ctrl+,
        \row
            \li  Fetch snippet
            \li  Alt+C, Alt+F
        \row
            \li  Paste snippet
            \li  Alt+C, Alt+P
        \endif
        \row
            \li  Find references to symbol under cursor
            \li  Ctrl+Shift+U
        \row
            \li  Follow symbol under cursor

               Works with namespaces, classes, functions, variables, include
               statements and macros
            \li  F2
        \row
            \li  Rename symbol under cursor
            \li  Ctrl+Shift+R
        \row
            \li  Switch between function declaration and definition
            \li  Shift+F2
        \row
            \li  Open type hierarchy
            \li  Ctrl+Shift+T
            \if defined(qtcreator)
        \row
            \li  Switch between header and source file
            \li  F4
        \endif
        \row
            \li  Turn selected text into lowercase
            \li  Alt+U
        \row
            \li  Turn selected text into uppercase
            \li  Alt+Shift+U
        \row
            \li  Run static checks on JavaScript code to find common problems
            \li  Ctrl+Shift+C
        \row
            \li  Find and replace
            \li  Ctrl+F
        \row
            \li  Find next
            \li  F3
        \row
            \li  Find previous
            \li  Shift+F3
        \row
            \li  Find next occurrence of selected text
            \li  Ctrl+F3
        \row
            \li  Find previous occurrence of selected text
            \li  Ctrl+Shift+F3
        \row
            \li  Replace next
            \li  Ctrl+=
        \row
            \li  Open advanced find
            \li  Ctrl+Shift+F
        \if defined(qtcreator)
        \row
            \li  Record a text-editing macro
            \li  Alt+(
        \row
            \li  Stop recording a macro
            \li  Alt+)
        \row
            \li  Play last macro
            \li  Alt+R
        \row
            \li  Show Qt Quick toolbars
            \li  Ctrl+Alt+Space
        \row
            \li  Execute user actions in FakeVim mode
            \li  Alt+V, n, where n is the number of the user action, from 1 to 9
        \endif
    \endtable

    \if defined(qtcreator)
    \section3 Emacs Shortcuts

    You can specify shortcuts for executing actions in a way that is familiar to
    \l{https://www.gnu.org/software/emacs/manual/html_node/emacs/index.html}
    {Emacs} editor users. The actions are not bound to any key combinations by
    default. The following actions are available:

    \list
        \li Copy
        \li Cut
        \li Delete Character
        \li Exchange Cursor and Mark
        \li Go to File End
        \li Go to File Start
        \li Go to Line End
        \li Go to Line Start
        \li Go to Next Character
        \li Go to Next Line
        \li Go to Next Word
        \li Go to Previous Character
        \li Go to Previous Line
        \li Go to Previous Word
        \li Insert Line and Indent
        \li Kill Line
        \li Kill Word
        \li Mark
        \li Scroll Half Screen Down
        \li Scroll Half Screen Up
        \li Yank
    \endlist

    \section2 Image Viewer Shortcuts

    \table
        \header
            \li  Action
            \li  Keyboard shortcut
        \row
            \li  Switch to background
            \li  Ctrl+[
        \row
            \li  Switch to outline
            \li  Ctrl+]
        \row
            \li  Zoom in
            \li  Ctrl++
        \row
            \li  Zoom out
            \li  Ctrl+-
        \row
            \li  Fit to screen
            \li  Ctrl+=
        \row
            \li  Original size
            \li  Ctrl+0
    \endtable
    \endif

    \section2 Design Mode Keyboard Shortcuts

    You can use the following keyboard shortcuts when editing QML files in the
    Design mode.

    \table
        \header
            \li  Action
            \li  Keyboard shortcut
        \row
            \li  Open the QML file that defines the selected component
            \li  F2
        \row
            \li  Move between \uicontrol {Text Editor} and
                 \uicontrol {Form Editor}
            \li  F4
        \row
            \li  Toggle left sidebar
            \li  Ctrl+Alt+0
        \row
            \li  Toggle right sidebar
            \li  Ctrl+Alt+Shift+0
    \endtable

    \section2 Debugging Keyboard Shortcuts

    \table
        \header
            \li  Action
            \li  Keyboard shortcut
        \row
            \li  Start or continue debugging
            \li  F5
        \row
            \li  Exit debugger
            \li  Shift+F5
        \row
            \li  Step over
            \li  F10
        \row
            \li  Step into
            \li  F11
        \row
            \li  Step out
            \li  Shift+F11
        \row
            \li  Toggle breakpoint
            \li  F9
        \row
            \li  Run to selected function
            \li  Ctrl+F6
        \row
            \li  Run to line
            \li  Ctrl+F10
        \row
            \li  Reverse direction
            \li  F12
    \endtable

    \section2 Project Keyboard Shortcuts

    \table
        \header
            \li  Action
            \li  Keyboard shortcut
        \if defined(qtcreator)
        \row
            \li  Build project
            \li  Ctrl+B
        \row
            \li  Build all
            \li  Ctrl+Shift+B
        \endif
        \row
            \li  New project
            \li  Ctrl+Shift+N
        \row
            \li  Open project
            \li  Ctrl+Shift+O
        \row
            \li  Select the \l{glossary-buildandrun-kit}{kit} to build and run your project with
            \li  Ctrl+T
        \row
            \li  Run
            \li  Ctrl+R
    \endtable

    \section2 Help Keyboard Shortcuts

    \table
        \header
            \li  Action
            \li  Keyboard shortcut
        \row
            \li  View context-sensitive help
            \li  F1
        \row
            \li  Activate contents in \uicontrol Help mode
            \li  Ctrl+T
        \row
            \li  Add bookmark in \uicontrol Help mode
            \li  Ctrl+M
        \row
            \li  Activate index in \uicontrol Help mode
            \li  Ctrl+I
        \row
            \li  Reset font size
            \li  Ctrl+0
        \row
            \li  Activate search in \uicontrol Help mode
            \li  Ctrl+S
    \endtable

    \section2 Version Control Keyboard Shortcuts

    \if defined(qtcreator)
    \table
        \header
            \li  {1,2} Action
            \li  {6,1} Version control system
        \header
            \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
            \li  Alt+G, Alt+C
            \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
            \li  Alt+G, Alt+D
            \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
            \li  Alt+G, Alt+L
            \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
            \li  Alt+G, Alt+S
            \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
    \endtable
    \else
    \table
        \header
            \li Action
            \li Keyboard shortcut
        \row
            \li Stage file for commit
            \li Alt+G, Alt+A
        \row
            \li Commit
            \li Alt+G, Alt+C
        \row
            \li Diff current file
            \li Alt+G, Alt+D
        \row
            \li Diff project
            \li Alt+G, Alt+Shift+D
        \row
            \li Blame
            \li Alt+G, Alt+B
        \row
            \li Log current file
            \li Alt+G, Alt+L
        \row
            \li Log project
            \li Alt+G, Alt+K
        \row
            \li Reset
            \li Alt+G, Alt+U
    \endtable
    \endif
*/