Difference between revisions of "Lazarus IDE Shortcuts"

From Lazarus wiki
Jump to navigationJump to search
(Updated; added IDE Window dialog links; fixed broken external links)
 
(58 intermediate revisions by 11 users not shown)
Line 1: Line 1:
=Key mapping=
+
{{Lazarus IDE Shortcuts}}
  
All shortcuts can be edited in Environment / Editor Options / Key mapping. See [[IDE_ Window:_Editor_Options#Key_Mappings|Key Mapping]].
+
== Key mappings ==
  
==Mac OS X==
+
All shortcuts can be edited in the [[IDE Window: Editor Options Keymap|Tools > Options > Editor > Key Mappings]] and the preset schemes can be loaded using the [[IDE_Window:_Choose_Key_Mapping_Scheme|Choose Key Mapping Scheme]] dialog.
  
Mac OS X has quite different key policies. For example most F keys are used by the OS, there are no menu Alt shortcuts and there are large guidelines (contrary to linux and windows where only a few keys work the same under all programs).
+
For what does each shortcut does, see the [[Lazarus_Tutorial|Lazarus tutorial]].
  
The apple human interface guidelines for key bindings can be seen here:
+
=== Gnome ===
[http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGUserInput/chapter_12_section_3.html]
 
  
===Conflicts with default lazarus key map===
+
The default key mapping for Windows fits quite well under Gnome.
  
Here is the list with the conflicts of the default lazarus key mapping:
+
=== KDE ===
{| BORDER="1" CELLSPACING="0"
+
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''Keys'''
+
The default key mapping for Windows fits quite well under KDE. Some keys like F9 are used by KDE.
!COLSPAN="1" STYLE="background:#ffdead;"|'''Function defined by Apple'''
+
 
!COLSPAN="1" STYLE="background:#ffdead;"|'''Conflict with lazarus default'''
+
=== macOS, Apple style ===
!COLSPAN="1" STYLE="background:#ffdead;"|'''Resolution'''
+
 
 +
macOS has quite different key policies. For example most F keys are used by the OS, there are no menu Alt shortcuts and there are substantial guidelines (contrary to Linux and Windows where only a few keys are standardised to work the same under all programs).
 +
 
 +
The Apple [https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/keyboard/ ''Human Interface Guidelines'' - keyboard section] deals with key bindings for macOS.
 +
 
 +
Xcode is Apple's own integrated development environment. Here are the Xcode shortcuts: [[file:Xcode Shortcuts B W.png|1100px]]
 +
 
 +
([http://www.1729.us/xcode/Xcode%20Shortcuts%20B_W.png Image Source]).
 +
 
 +
=== macOS, Lazarus style ===
 +
 
 +
A macOS key map is available for Lazarus and can be set via [[IDE_Window:_Editor_Options_Keymap|Tools > Options > Editor > Key Mappings / Load a scheme]] which opens the [[IDE_Window:_Choose_Key_Mapping_Scheme|Choose Key Mapping Scheme]] dialog. This preset scheme is based on the "macOS, Apple style" with some keys overridden ([[#Overidden "Apple style" keys|see below]]).
 +
 
 +
{| class="wikitable"
 +
! Keys !! Function defined by Apple !! Conflict with lazarus default !! Solution
 
|---- class="working"
 
|---- class="working"
|F1||misc||help||Cmd-?
+
|F1||misc||help||Apple: Cmd-[Shift]-?
 
|---- class="working"
 
|---- class="working"
|Ctrl-Shift-F1||misc||help editor||
+
|Ctrl-Shift-F1||misc||help editor||Mattias: Cmd-Alt-[Shift]-?
 
|---- class="working"
 
|---- class="working"
|Ctrl-F2||misc||stop program||
+
|Ctrl-F2||misc||stop program||Xcode: Shift-Cmd-Enter
 
|---- class="working"
 
|---- class="working"
|F3||misc||find next||Cmd-G
+
|F3||misc||find next||Apple: Cmd-G
 
|---- class="working"
 
|---- class="working"
|Shift-F3||misc||find previous||Cmd-Shift-G
+
|Shift-F3||misc||find previous||Apple: Cmd-Shift-G
 
|---- class="working"
 
|---- class="working"
|F4||misc||run to cursor||
+
|F4||misc||run to cursor||Apple: misc, Mattias: no shortcut for 'run to cursor'
 
|---- class="working"
 
|---- class="working"
|Ctrl-F4||misc||close file||Cmd-Shift-W
+
|Ctrl-F4||misc||close file||Apple: Cmd-Shift-W
 
|---- class="working"
 
|---- class="working"
|F5||misc||add breakpoint||
+
|F5||misc||add breakpoint||Xcode: Ctrl-P
 
|---- class="working"
 
|---- class="working"
|Ctrl-F5||misc||add watch||
+
|Ctrl-F5||misc||add watch||Apple: misc, Mattias: no shortcut for add watch
 
|---- class="working"
 
|---- class="working"
|Ctrl-F8||misc||jump next error||
+
|Ctrl-F8||misc||jump next error||Xcode: Cmd-+
 
|---- class="working"
 
|---- class="working"
|Ctrl-Shift-F8||misc||jump previous error||
+
|Ctrl-Shift-F8||misc||jump previous error||Xcode: Cmd-Shift-+
 
|---- class="working"
 
|---- class="working"
|F7||misc||step into||
+
|F7||misc||step into||Mattias: Cmd-Alt-R
 
|---- class="working"
 
|---- class="working"
|Ctrl-F7||misc||evaluate||
+
|Ctrl-F7||misc||evaluate||Ctrl-Shift-E
 
|---- class="working"
 
|---- class="working"
|F8||misc||step over||
+
|F8||misc||step over||Mattias: Cmd-Shift-R
 
|---- class="working"
 
|---- class="working"
|F9||misc||run||
+
|F9||misc||run||Xcode: Cmd-R
 
|---- class="working"
 
|---- class="working"
|Ctrl-F9||misc||build||
+
|Ctrl-F9||misc||build||Xcode: Cmd-B
 
|---- class="working"
 
|---- class="working"
|F11||misc||toggle OI||
+
|F11||misc||toggle OI||Mattias: Alt-Cmd-I
 
|---- class="working"
 
|---- class="working"
|Shift-F11||misc||add unit to project||
+
|Shift-F11||misc||add unit to project||Xcode: Alt-Cmd-A
 
|---- class="working"
 
|---- class="working"
|Ctrl-F11||misc||open project||
+
|Ctrl-F11||misc||open project||Apple: misc, Mattias: no key for 'open project'
 
|---- class="working"
 
|---- class="working"
|Ctrl-Shift-F11||misc||project options||
+
|Ctrl-Shift-F11||misc||project options||Mattias: no key for 'project options'
 
|---- class="working"
 
|---- class="working"
|F12||misc||toggle unit/form||
+
|F12||misc||toggle unit/form||Apple: misc, Mattias: Cmd-Alt-F
 
|---- class="working"
 
|---- class="working"
|Ctrl-F12||misc||view units||
+
|Ctrl-F12||misc||view units||Mattias: Ctrl-Alt-U
 
|---- class="working"
 
|---- class="working"
|Shift-F12||misc||view forms||
+
|Shift-F12||misc||view forms||Mattias: Ctrl-Shift-U
 
|---- class="working"
 
|---- class="working"
 
|[Shift]-Up,Down,Right,Left||move cursor||||
 
|[Shift]-Up,Down,Right,Left||move cursor||||
Line 69: Line 82:
 
|Alt-[Shift]-Left/Right||jump to next word||||
 
|Alt-[Shift]-Left/Right||jump to next word||||
 
|---- class="working"
 
|---- class="working"
|Alt-Up/Down||jump to start/end of paragraph||find declaration||
+
|Alt-Up/Down||jump to start/end of paragraph (laz: Ctrl Q,B)||find declaration||Mattias: find declaration
 
|---- class="working"
 
|---- class="working"
|Cmd-[Shift]-Left/Right||jump to start/end of line||jump next word||Alt-Left/Right
+
|Cmd-[Shift]-Left/Right||jump to start/end of line (laz:Home/End)||jump next word||Apple: jump to start/end of line
 
|---- class="working"
 
|---- class="working"
|Cmd-Up/Down||jump to start/end of file||scroll one up/down||
+
|Cmd-Alt-Left/Right||||||Xcode: switch file
 
|---- class="working"
 
|---- class="working"
|Cmd-Shift-Up/Down||select to start/end of file||method jump||
+
|Cmd-Alt-Up/Down||||||Xcode: jump source/header
 
|---- class="working"
 
|---- class="working"
|Cmd-?||show context help||||
+
|Cmd-Up/Down||jump to start/end of file (laz:Ctrl-Home)||scroll one up/down||Apple: jump to start/end of file
 +
|---- class="working"
 +
|Ctrl-Up/Down||||||Mattias: scroll one up/down
 +
|---- class="working"
 +
|Cmd-Shift-Up/Down||select to start/end of file (laz:Shift-Ctrl-Home)||method jump||Apple: select to start/end of file
 +
|---- class="working"
 +
|Ctrl-Shift-Up/Down||||||Mattias: method jump
 +
|---- class="working"
 +
|Cmd-[Shift]-?||show context help||||
 
|---- class="working"
 
|---- class="working"
 
|Delete/Backspace||delete char||||
 
|Delete/Backspace||delete char||||
Line 83: Line 104:
 
|[Shift]-PageUp/Down||jump page up/down||||
 
|[Shift]-PageUp/Down||jump page up/down||||
 
|---- class="working"
 
|---- class="working"
|Home/End||jump to start/end of file||jump to start/end of line||
+
|[Shift]-Home/End||jump to start/end of file (laz:Ctrl-Home)||jump to start/end of line||Apple: jump to start/end of file
 
|---- class="working"
 
|---- class="working"
|Cmd-[Shift]-Tab||switch application||jump prev/next file||
+
|Cmd-[Shift]-Tab||switch application||jump prev/next file||Apple: switch app
 
|---- class="working"
 
|---- class="working"
|Cmd-Alt-D||show/hide dock||||
+
|Ctrl-[Shift]-Tab||jump to next control||||
 +
|---- class="working"
 +
|Cmd-*-Space||spotlight, apple reserved||identifier completion||Apple: misc
 +
|---- class="working"
 +
|Ctrl-Space||Xcode: set mark||||Mattias: identifier completion
 
|---- class="working"
 
|---- class="working"
|Cmd-Ctrl-D||dictionary||||
+
|Shift-Ctrl-Space||||||Mattias: code context
 
|---- class="working"
 
|---- class="working"
|Cmd-*-Space||spotlight, apple reserved||||
+
|Alt-Ctrl-Space||||||Mattias: word completion
 
|---- class="working"
 
|---- class="working"
 
|Cmd-Alt-Escape||force quit||||
 
|Cmd-Alt-Escape||force quit||||
Line 98: Line 123:
 
|---- class="working"
 
|---- class="working"
 
|Cmd-C||copy||||
 
|Cmd-C||copy||||
 +
|---- class="working"
 +
|Cmd-Alt-D||show/hide dock||||
 +
|---- class="working"
 +
|Cmd-Ctrl-D||dictionary||||
 
|---- class="working"
 
|---- class="working"
 
|Cmd-E||find word at cursor||incremental find||find is smart to auto use word at cursor. incremental find.
 
|Cmd-E||find word at cursor||incremental find||find is smart to auto use word at cursor. incremental find.
Line 103: Line 132:
 
|Cmd-F||find||||
 
|Cmd-F||find||||
 
|---- class="working"
 
|---- class="working"
|Cmd-Alt-F||incremental search||||
+
|Cmd-Alt-F||Xcode: view details||||Mattias: Toggle Unit/Form
 
|---- class="working"
 
|---- class="working"
|Cmd-G||find next||goto line||
+
|Cmd-G||find next (laz:F3)||goto line||Apple: find next
 
|---- class="working"
 
|---- class="working"
|Cmd-Shift-G||find previous||insert guid||
+
|Cmd-Shift-G||find previous (laz:Shift-F3)||insert guid||
 
|---- class="working"
 
|---- class="working"
|Cmd-[Alt]-H||hide app||jump back||
+
|Ctrl-Shift-G||||insert guid||Mattias: insert guid
 +
|---- class="working"
 +
|Cmd-[Alt]-H||hide app||jump back||Apple: hide app
 +
|---- class="working"
 +
|Ctrl-[Shift]-H||||||Mattias: jump history backward/forward
 +
|---- class="working"
 +
|Ctrl-I||||indent selection||Xcode: indent selection
 +
|---- class="working"
 +
|Ctrl-U||||unindent selection||Xcode: unindent selection
 +
|---- class="working"
 +
|Cmd-L||||||Xcode: goto line
 
|---- class="working"
 
|---- class="working"
 
|Cmd-M||minimize window||||
 
|Cmd-M||minimize window||||
Line 116: Line 155:
 
|---- class="working"
 
|---- class="working"
 
|Cmd-N||new file||||
 
|Cmd-N||new file||||
 +
|---- class="working"
 +
|Cmd-Shift-N||||||Tom: Insert line
 
|---- class="working"
 
|---- class="working"
 
|Cmd-O||open file||||
 
|Cmd-O||open file||||
 
|---- class="working"
 
|---- class="working"
|Cmd-Q||quit||goto line||
+
|Cmd-Q||quit (laz: none)||goto line||Apple: quit
 
|---- class="working"
 
|---- class="working"
 
|Cmd-Shift-Q||log out||||
 
|Cmd-Shift-Q||log out||||
 +
|---- class="working"
 +
|Cmd-R||Xcode: build and run||search and replace||Xcode: run
 +
|---- class="working"
 +
|Cmd-Shift-R||||||Mattias: step over
 +
|---- class="working"
 +
|Cmd-Alt-R||||||Mattias: step into
 
|---- class="working"
 
|---- class="working"
 
|Cmd-S||save||||
 
|Cmd-S||save||||
 
|---- class="working"
 
|---- class="working"
|Cmd-Shift-S||Save As||save all||Cmd-Alt-S
+
|Cmd-Shift-S||Save As (laz: none)||save all||Apple: Cmd-Shift-S
 
|---- class="working"
 
|---- class="working"
 
|Cmd-Alt-S||Save All||||
 
|Cmd-Alt-S||Save All||||
Line 131: Line 178:
 
|Cmd-V||paste||||
 
|Cmd-V||paste||||
 
|---- class="working"
 
|---- class="working"
|Cmd-W||close window||word completion||
+
|Cmd-W||close window (laz: none)||word completion||Apple: close window
 
|---- class="working"
 
|---- class="working"
|Cmd-Shift-W||close file||||
+
|Cmd-Shift-W||Xcode: close file||||
 
|---- class="working"
 
|---- class="working"
 
|Cmd-Alt-W||close all files||||
 
|Cmd-Alt-W||close all files||||
 
|---- class="working"
 
|---- class="working"
 
|Cmd-X||cut||||
 
|Cmd-X||cut||||
 +
|---- class="working"
 +
|Cmd-Y||||||Tom: delete to end of line
 
|---- class="working"
 
|---- class="working"
 
|Cmd-Z||undo||||
 
|Cmd-Z||undo||||
Line 143: Line 192:
 
|Control||The control modifier is used by cocoa in text fields. So it is free for designer and source editor functions||||
 
|Control||The control modifier is used by cocoa in text fields. So it is free for designer and source editor functions||||
 
|---- class="working"
 
|---- class="working"
|Control-1-9||create special chars on some layouts||bookmark commands||
+
|Alt-1-9||create special chars on some layouts||||
 
|---- class="working"
 
|---- class="working"
|Cmd-*-1-9||apple functions like capture screen||bookmark commands||
+
|Ctrl-1-9||||jump to bookmark||
 +
|---- class="working"
 +
|Ctrl-Shift-1-9||||set bookmark||
 +
|---- class="working"
 +
|Cmd-*-1-9||apple functions like capture screen||||
 
|}
 
|}
  
===XCode===
+
==== Overidden "Apple style" keys ====
XCode is Apple's own development environment. Here are the XCode shortcuts: [http://www.1729.us/xcode/Xcode%20Shortcuts%20B_W.png]
+
 
 +
The "Apple style" scheme of keys can be hard on Lazarus users who work with Lazarus on multiple platforms because many of them are very different from the FreeBSD, Linux and Windows schemes. To minimize this problem the "macOS, Lazarus style" scheme was created (based on the default "macOS, Apple style" scheme, but with some changes to have keys similar to those on other platforms. Below are the keys which differ from the standard "macOS, Apple style" scheme:
 +
 
 +
{| class="wikitable"
 +
! Keys !! Function in Apple style !! Function in Lazarus style
 +
|---- class="working"
 +
|Home/End||jump to start/end of file||jump to start/end of line
 +
|}

Latest revision as of 05:22, 11 August 2020

English (en) 한국어 (ko)

Key mappings

All shortcuts can be edited in the Tools > Options > Editor > Key Mappings and the preset schemes can be loaded using the Choose Key Mapping Scheme dialog.

For what does each shortcut does, see the Lazarus tutorial.

Gnome

The default key mapping for Windows fits quite well under Gnome.

KDE

The default key mapping for Windows fits quite well under KDE. Some keys like F9 are used by KDE.

macOS, Apple style

macOS has quite different key policies. For example most F keys are used by the OS, there are no menu Alt shortcuts and there are substantial guidelines (contrary to Linux and Windows where only a few keys are standardised to work the same under all programs).

The Apple Human Interface Guidelines - keyboard section deals with key bindings for macOS.

Xcode is Apple's own integrated development environment. Here are the Xcode shortcuts: Xcode Shortcuts B W.png

(Image Source).

macOS, Lazarus style

A macOS key map is available for Lazarus and can be set via Tools > Options > Editor > Key Mappings / Load a scheme which opens the Choose Key Mapping Scheme dialog. This preset scheme is based on the "macOS, Apple style" with some keys overridden (see below).

Keys Function defined by Apple Conflict with lazarus default Solution
F1 misc help Apple: Cmd-[Shift]-?
Ctrl-Shift-F1 misc help editor Mattias: Cmd-Alt-[Shift]-?
Ctrl-F2 misc stop program Xcode: Shift-Cmd-Enter
F3 misc find next Apple: Cmd-G
Shift-F3 misc find previous Apple: Cmd-Shift-G
F4 misc run to cursor Apple: misc, Mattias: no shortcut for 'run to cursor'
Ctrl-F4 misc close file Apple: Cmd-Shift-W
F5 misc add breakpoint Xcode: Ctrl-P
Ctrl-F5 misc add watch Apple: misc, Mattias: no shortcut for add watch
Ctrl-F8 misc jump next error Xcode: Cmd-+
Ctrl-Shift-F8 misc jump previous error Xcode: Cmd-Shift-+
F7 misc step into Mattias: Cmd-Alt-R
Ctrl-F7 misc evaluate Ctrl-Shift-E
F8 misc step over Mattias: Cmd-Shift-R
F9 misc run Xcode: Cmd-R
Ctrl-F9 misc build Xcode: Cmd-B
F11 misc toggle OI Mattias: Alt-Cmd-I
Shift-F11 misc add unit to project Xcode: Alt-Cmd-A
Ctrl-F11 misc open project Apple: misc, Mattias: no key for 'open project'
Ctrl-Shift-F11 misc project options Mattias: no key for 'project options'
F12 misc toggle unit/form Apple: misc, Mattias: Cmd-Alt-F
Ctrl-F12 misc view units Mattias: Ctrl-Alt-U
Shift-F12 misc view forms Mattias: Ctrl-Shift-U
[Shift]-Up,Down,Right,Left move cursor
Alt-[Shift]-Left/Right jump to next word
Alt-Up/Down jump to start/end of paragraph (laz: Ctrl Q,B) find declaration Mattias: find declaration
Cmd-[Shift]-Left/Right jump to start/end of line (laz:Home/End) jump next word Apple: jump to start/end of line
Cmd-Alt-Left/Right Xcode: switch file
Cmd-Alt-Up/Down Xcode: jump source/header
Cmd-Up/Down jump to start/end of file (laz:Ctrl-Home) scroll one up/down Apple: jump to start/end of file
Ctrl-Up/Down Mattias: scroll one up/down
Cmd-Shift-Up/Down select to start/end of file (laz:Shift-Ctrl-Home) method jump Apple: select to start/end of file
Ctrl-Shift-Up/Down Mattias: method jump
Cmd-[Shift]-? show context help
Delete/Backspace delete char
[Shift]-PageUp/Down jump page up/down
[Shift]-Home/End jump to start/end of file (laz:Ctrl-Home) jump to start/end of line Apple: jump to start/end of file
Cmd-[Shift]-Tab switch application jump prev/next file Apple: switch app
Ctrl-[Shift]-Tab jump to next control
Cmd-*-Space spotlight, apple reserved identifier completion Apple: misc
Ctrl-Space Xcode: set mark Mattias: identifier completion
Shift-Ctrl-Space Mattias: code context
Alt-Ctrl-Space Mattias: word completion
Cmd-Alt-Escape force quit
Cmd-A select all
Cmd-C copy
Cmd-Alt-D show/hide dock
Cmd-Ctrl-D dictionary
Cmd-E find word at cursor incremental find find is smart to auto use word at cursor. incremental find.
Cmd-F find
Cmd-Alt-F Xcode: view details Mattias: Toggle Unit/Form
Cmd-G find next (laz:F3) goto line Apple: find next
Cmd-Shift-G find previous (laz:Shift-F3) insert guid
Ctrl-Shift-G insert guid Mattias: insert guid
Cmd-[Alt]-H hide app jump back Apple: hide app
Ctrl-[Shift]-H Mattias: jump history backward/forward
Ctrl-I indent selection Xcode: indent selection
Ctrl-U unindent selection Xcode: unindent selection
Cmd-L Xcode: goto line
Cmd-M minimize window
Cmd-Alt-M minimize app
Cmd-N new file
Cmd-Shift-N Tom: Insert line
Cmd-O open file
Cmd-Q quit (laz: none) goto line Apple: quit
Cmd-Shift-Q log out
Cmd-R Xcode: build and run search and replace Xcode: run
Cmd-Shift-R Mattias: step over
Cmd-Alt-R Mattias: step into
Cmd-S save
Cmd-Shift-S Save As (laz: none) save all Apple: Cmd-Shift-S
Cmd-Alt-S Save All
Cmd-V paste
Cmd-W close window (laz: none) word completion Apple: close window
Cmd-Shift-W Xcode: close file
Cmd-Alt-W close all files
Cmd-X cut
Cmd-Y Tom: delete to end of line
Cmd-Z undo
Control The control modifier is used by cocoa in text fields. So it is free for designer and source editor functions
Alt-1-9 create special chars on some layouts
Ctrl-1-9 jump to bookmark
Ctrl-Shift-1-9 set bookmark
Cmd-*-1-9 apple functions like capture screen

Overidden "Apple style" keys

The "Apple style" scheme of keys can be hard on Lazarus users who work with Lazarus on multiple platforms because many of them are very different from the FreeBSD, Linux and Windows schemes. To minimize this problem the "macOS, Lazarus style" scheme was created (based on the default "macOS, Apple style" scheme, but with some changes to have keys similar to those on other platforms. Below are the keys which differ from the standard "macOS, Apple style" scheme:

Keys Function in Apple style Function in Lazarus style
Home/End jump to start/end of file jump to start/end of line