]> git.lyx.org Git - lyx.git/blob - lib/bind/mac.bind
#7292 make the modifiers Option and Control act on there own on mac - adjust the...
[lyx.git] / lib / bind / mac.bind
1 # This file is part of
2 # ==================================================================
3 #
4 #                     LyX, the High Level Word Processor
5 #
6 #         Copyright (C) 1995-1997 Asger Alstrup & The LyX Team
7 #
8 # ==================================================================
9
10 #
11 # This is the Mac flavour bind file for LyX/Mac 2.0.x, based on
12 # bindings found in the Mac world.
13 #
14 # DO NOT CHANGE THIS DEFAULT BINDING FILE! It will be replaced
15 # with every new install of LyX and your changes will be lost.
16 # Instead, customize a copy of this file placed in
17 # ~/.lyx/bind/.
18 #
19 # Happy tuning!
20
21 # Free bindings:
22
23 #\bind "C-j"
24 #\bind "C-y"
25
26
27 ###
28
29 Format 1
30
31 # based on the table at http://support.apple.com/kb/HT1343
32 # Note: these bindings assume the swapped Meta and Control modifiers standard of Qt
33 # Command - C
34 # Option  - A
35 # Control - M
36
37 # Status: "Key combination"            What it does
38 #  +: "Command-Space"                # Show or hide the Spotlight search field (if multiple languages are installed, may rotate through enabled script systems)
39 #  +: "Option-Command-Space"         # Show the Spotlight search results window (if multiple languages are installed, may rotate through keyboard layouts and input methods within a script)
40 #  +: "Command-esc"                  # Open Front Row (if installed)
41 #  +: "Option-Eject"                 # Eject from secondary optical media drive (if one is installed)
42 #  +: "Control-Eject"                # Show shutdown dialog
43 #  +: "Option-Command-Eject"         # Put the computer to sleep
44 #  +: "Control-Command-Eject"        # Quit all applications (after giving you a chance to save changes to open documents), then restart the computer
45 #  +: "Control Option-Command-Eject" # Quit all applications (after giving you a chance to save changes to open documents), then shut down the computer
46 #  +: "Command-Tab"                  # Move forward to the next most recently used application in a list of open applications
47 #  +: "Shift-Command-Tab"            # Move backward through a list of open applications (sorted by recent use)
48 #  -: "Control-A"                    # Move to beginning of line/paragraph
49 # used by menu.bind - paragraph-params
50 #  +: "Control-B"                    # Move one character backward
51 \bind "M-b"                          "char-backward"
52 #  +: "Control-D"                    # Delete the character in front of the cursor
53 \bind "M-d"                          "char-delete-forward"
54 #  +: "Control-E"                    # Move to end of line/paragraph
55 \bind "M-e"                          "line-end"
56 #  +: "Control-F"                    # Move one character forward
57 \bind "M-f"                          "char-forward"
58 #  +: "Control-H"                    # Delete the character behind the cursor
59 \bind "M-h"                          "char-delete-backward"
60 #  -: "Control-K"                    # Delete from the character in front of the cursor to the end of the line/paragraph
61 # used by menu.bind - keymap
62 #  +: "Control-L"                    # Center the cursor/selection in the visible area
63 \bind "M-l"                          "screen-recenter"
64 \bind "F5"                           "screen-recenter"
65 #  +: "Control-N"                    # Move down one line
66 \bind "M-n"                          "down"
67 #  +: "Control-O"                    # Insert a new line after the cursor
68 \bind "M-o"                          "break-paragraph"
69 #  -: "Control-P"                    # Move up one line
70 # used by menu.bind - layouts
71 #  -: "Control-T"                    # Transpose the character behind the cursor and the character in front of the cursor
72 #  +: "Control-V"                    # Move down one page
73 \bind "M-v"                          "scroll page up"
74 #  -: "Shift-Tab"                    # Navigate through controls in a reverse direction
75 #  +: "Control-Tab"                  # Move focus to the next grouping of controls in a dialog or the next table (when Tab moves to the next cell)
76 \bind "M-Tab"                        "buffer-next"
77 #  +: "Shift-Control-Tab"            # Move focus to the previous grouping of controls
78 \bind "M-S-BackTab"                  "buffer-previous"
79 #  +: "fn-Delete"                    # Forward Delete (on portable Macs' built-in keyboard)
80 \bind "Delete"                       "char-delete-forward"
81 #  ?: "Control-F1"                   # Toggle full keyboard access on or off
82 #  +: "Control-F2"                   # Move focus to the menu bar
83 #  +: "Control-F3"                   # Move focus to the Dock
84 #  +: "Control-F4"                   # Move focus to the active (or next) window
85 #  +: "Shift-Control-F4"             # Move focus to the previously active window
86 #  -: "Control-F5"                   # Move focus to the toolbar.
87 #  -: "Control-F6"                   # Move focus to the first (or next) panel
88 #  -: "Shift-Control-F6"             # Move focus to the previous panel
89 #  -: "Control-F7"                   # Temporarily override the current keyboard access mode in windows and dialogs
90 #  -: "F9"                           # Tile or untile all open windows
91 #  -: "F10"                          # Tile or untile all open windows in the currently active application
92 #  +: "F11"                          # Hide or show all open windows
93 #  +: "F12"                          # Hide or display Dashboard
94 #  -: "Command-`"                    # Activate the next open window in the frontmost application
95 #  -: "Shift-Command-`"              # Activate the previous open window in the frontmost application
96 #  -: "Option-Command-`"             # Move focus to the window drawer
97 #  +: "Command- - (minus)"           # Decrease the size of the selected item
98 \bind "C-minus"                      "buffer-zoom-out"
99 #  ?: "Shift-Command-="              # Increase the size of the selected item
100 \bind "C-plus"                       "buffer-zoom-in"
101 #  -: "Command-{"                    # Left-align a selection
102 #  -: "Command-}"                    # Right-align a selection
103 #  -: "Command-|"                    # Center-align a selection
104 #  -: "Command-:"                    # Display the Spelling window
105 #  +: "Command-;"                    # Find misspelled words in the document
106 \bind "C-S-semicolon"                "dialog-show spellchecker"
107 #  +: "Command-,"                    # Open the front application's preferences window (if it supports this keyboard shortcut)
108 \bind "C-comma"                      "dialog-show prefs"
109 #  +: "Option-Control-Command-,"     # Decrease screen contrast
110 #  +: "Option-Control-Command-."     # Increase screen contrast
111 #  -: "Command-?"                    # Open the application's help in Help Viewer
112 #  -: "Option-Command-/"             # Turn font smoothing on or off
113 #  +: "Shift-Command-3"              # Capture the screen to a file
114 #  +: "Shift-Control-Command-3"      # Capture the screen to the Clipboard
115 #  +: "Shift-Command-4"              # Capture a selection to a file
116 #  +: "Shift-Control-Command-4"      # Capture a selection to the Clipboard
117 #  +: "Command-A"                    # Highlight every item in a document or window, or all characters in a text field
118 \bind "C-a"                          "command-sequence buffer-begin ; buffer-end-select"
119 \bind "C-M-a"                        "inset-select-all"
120 #  +: "Command-B"                    # Boldface the selected text or toggle boldfaced text on and off
121 \bind "C-M-b"                        "font-boldsymbol"
122 \bind "C-b"                          "font-bold"
123 #  +: "Command-C"                    # Copy the selected data to the Clipboard
124 \bind "C-c"                          "copy"
125 #  -: "Shift-Command-C"              # Display the Colors window
126 #  -: "Option-Command-C"             # Copy the style of the selected text
127 #  -: "Control-Command-C"            # Copy the formatting settings of the selected item and store on the Clipboard
128 #  +: "Option-Command-D"             # Show or hide the Dock
129 #  -: "Command-Control D"            # Display the definition of the selected word in the Dictionary application
130 \bind "C-d"                          "buffer-view dvi"  # 'd' for dvi
131 \bind "C-M-d"                        "master-buffer-view dvi"
132 \bind "C-S-D"                        "buffer-update dvi"        # 'd' for dvi
133 #  -: "Command-E"                    # Use the selection for a find
134 \bind "C-e"                          "font-emph"
135 #  +: "Command-F"                    # Open a Find window
136 \bind "C-f"                          "dialog-show findreplace"
137 \bind "C-S-f"                        "dialog-show findreplaceadv"
138 #  -: "Option-Command-F"             # Move to the search field control
139 #  +: "Command-G"                    # Find the next occurrence of the selection
140 \bind "C-g"                          "word-find-forward"
141 #  +: "Shift-Command-G"              # Find the previous occurrence of the selection
142 \bind "C-S-g"                        "word-find-backward"
143 #  +: "Command-H"                    # Hide the windows of the currently running application
144 #  +: "Option-Command-H"             # Hide the windows of all other running applications
145 #  -: "Command-I"                    # Italicize the selected text or toggle italic text on or off
146 \bind "C-i"                          "inset-toggle" # 'i' for Inset
147 #  -: "Option-Command-I"             # Display an inspector window
148 #  -: "Command-J"                    # Scroll to a selection
149 \bind "C-k"                          "line-delete-forward"
150 #  -: "Command-M"                    # Minimize the active window to the Dock
151 #  -: "Option-Command-M"             # Minimize all windows of the active application to the Dock
152 \bind "C-m"                          "math-mode"
153 \bind "C-S-M"                        "math-display"
154 \bind "C-M-n"                        "command-sequence math-display; math-number-toggle;"
155 #  +: "Command-N"                    # Create a new document in the frontmost application
156 \bind "C-n"                          "buffer-new"
157 \bind "C-S-N"                        "buffer-new-template"
158 #  +: "Command-O"                    # Display a dialog for choosing a document to open in the frontmost application
159 \bind "C-o"                          "file-open"
160 #  +: "Command-P"                    # Display the Print dialog
161 \bind "C-p"                          "dialog-show print"
162 #  -: "Shift-Command-P"              # Display a dialog for specifying printing parameters (Page Setup)
163 \bind "C-S-P"                        "font-typewriter" # 'P' for Program
164 #  +: "Command-Q"                    # Quit the frontmost application
165 \bind "C-q"                          "lyx-quit"
166 \bind "C-r"                          "buffer-view"
167 #  +: "Command-S"                    # Save the active document
168 \bind "C-s"                          "buffer-write"
169 #  +: "Shift-Command-S"              # Display the Save As dialog
170 \bind "C-S-S"                        "buffer-write-as"
171 #  -: "Command-T"                    # Display the Fonts window
172 \bind "C-t"                          "buffer-view pdf"
173 \bind "C-M-t"                        "master-buffer-view pdf"
174 #  -: "Option-Command-T"             # Show or hide a toolbar
175 #  -: "Command-U"                    # Underline the selected text or turn underlining on or off
176 \bind "C-u"                          "font-underline"
177 #  +: "Command-V"                    # Paste the Clipboard contents at the insertion point
178 \bind "C-v"                          "paste"
179 \bind "C-S-v"                        "clipboard-paste"
180 #  -: "Option-Command-V"             # Apply the style of one object to the selected object (Paste Style)
181 #  -: "Option-Shift-Command-V"       # Apply the style of the surrounding text to the inserted object (Paste and Match Style)
182 #  -: "Control-Command-V"            # Apply formatting settings to the selected object (Paste Ruler Command)
183 \bind "C-M-v"                        "primary-selection-paste"
184 #  ?: "Command-W"                    # Close the frontmost window
185 \bind "C-w"                          "buffer-close" # should be "window-close"
186 #  +: "Shift-Command-W"              # Close a file and its associated windows
187 \bind "C-S-w"                        "buffer-close"
188 #  +: "Option-Command-W"             # Close all windows in the application without quitting it
189 \bind "C-A-w"                        "buffer-close-all"
190 #  +: "Command-X"                    # Remove the selection and store in the Clipboard
191 \bind "C-x"                          "cut"
192 \bind "M-x"                          "command-execute"
193 #  -: "Command-Z"                    # Undo previous command (some applications allow for multiple Undos)
194 \bind "C-z"                          "undo"
195 #  -: "Shift-Command-Z"              # Redo previous command (some applications allow for multiple Redos)
196 \bind "C-S-Z"                        "redo"
197 #  -: "Control-Right Arrow"          # Move focus to another value or cell within a view, such as a table
198 #  -: "Control-Left Arrow"           # Move focus to another value or cell within a view, such as a table
199 #  -: "Control-Down Arrow"           # Move focus to another value or cell within a view, such as a table
200 #  -: "Control-Up Arrow"             # Move focus to another value or cell within a view, such as a table
201 #  +: "Command-Right Arrow"          # Move the text insertion point to the end of the current line
202 \bind "C-Right"                      "line-end"
203 #  +: "Command-Left Arrow"           # Move the text insertion point to the beginning of the current line
204 \bind "C-Left"                       "line-begin"
205 #  +: "Command-Down Arrow"           # Move the text insertion point to the end of the document
206 \bind "C-Down"                       "buffer-end"
207 \bind "M-A-Down"                     "inset-end" 
208 #  +: "Command-Up Arrow"             # Move the text insertion point to the beginning of the document
209 \bind "C-Up"                         "buffer-begin"
210 \bind "M-A-Up"                       "inset-begin" 
211 #  +: "Shift-Command-Right Arrow"    # Select text between the insertion point and the end of the current line (*)
212 \bind "S-C-Right"                    "line-end-select"
213 #  +: "Shift-Command-Left Arrow"     # Select text between the insertion point and the beginning of the current line (*)
214 \bind "S-C-Left"                     "line-begin-select"
215 #  +: "Shift-Right Arrow"            # Extend text selection one character to the right (*)
216 \bind "S-Right"                      "char-right-select"
217 #  +: "Shift-Left Arrow"             # Extend text selection one character to the left (*)
218 \bind "S-Left"                       "char-left-select"
219 #  +: "Shift-Command-Up Arrow"       # Select text between the insertion point and the beginning of the document (*)
220 \bind "S-C-Up"                       "buffer-begin-select"
221 #  +: "Shift-Command-Down Arrow"     # Select text between the insertion point and the end of the document (*)
222 \bind "S-C-Down"                     "buffer-end-select"
223 #  +: "Shift-Up Arrow"               # Extend text selection to the line above, to the nearest character boundary at the same horizontal location (*)
224 \bind "S-Up"                         "up-select"
225 #  +: "Shift-Down Arrow"             # Extend text selection to the line below, to the nearest character boundary at the same horizontal location (*)
226 \bind "S-Down"                       "down-select"
227 #  +: "Shift-Option-Right Arrow"     # Extend text selection to the end of the current word, then to the end of the following word if pressed again (*)
228 \bind "A-Right"                      "word-right"
229 \bind "S-A-Right"                    "word-right-select"
230 #  +: "Shift-Option-Left Arrow"      # Extend text selection to the beginning of the current word, then to the beginning of the following word if pressed again (*)
231 \bind "A-Left"                       "word-left"
232 \bind "S-A-Left"                     "word-left-select"
233 #  +: "Shift-Option-Down Arrow"      # Extend text selection to the end of the current paragraph, then to the end of the following paragraph if pressed again (*)
234 \bind "A-Down"                       "paragraph-down"
235 \bind "S-A-Down"                     "paragraph-down-select"
236 \bind "S-M-A-Down"                   "inset-end-select" 
237 #  +: "Shift-Option-Up Arrow"        # Extend text selection to the beginning of the current paragraph, then to the beginning of the following paragraph if pressed again (*)
238 \bind "A-Up"                         "paragraph-up"
239 \bind "S-A-Up"                       "paragraph-up-select"
240 \bind "S-M-A-Up"                     "inset-begin-select" 
241 #  -: "Control-Space"                # Toggle between the current and previous input sources
242 #  -: "Option-Control-Space"         # Toggle through all enabled input sources
243 #  +: "Option-Command-esc"           # Force Quit
244
245 # Additional commands
246
247 \bind "C-S-O"                        "font-strikeout"
248 \bind "C-S-T"                        "buffer-update pdf" # (pdflatex; was "ps")
249 \bind "C-S-R"                        "buffer-update"
250 \bind "C-M-S-T"                      "master-buffer-update pdf"
251 \bind "C-M-S-D"                      "master-buffer-update dvi"
252
253 \bind "C-S-E"                        "changes-track" # it's what MS Word uses
254 \bind "~S-M-quotedbl"                "quote-insert single"
255 \bind "~S-C-quotedbl"                "self-insert \""
256 \bind "C-S-underscore"               "command-alternatives math-macro-fold;specialchar-insert hyphenation"
257 \bind "C-M-minus"                    "specialchar-insert nobreakdash"
258 \bind "M-C-Right"                    "depth-increment"
259 \bind "M-C-Left"                     "depth-decrement"
260 \bind "C-S-L"                        "specialchar-insert ligature-break"
261 \bind "C-l"                          "ert-insert"               # 'l' for LaTeX
262 \bind "C-S-I"                        "info-insert"
263
264 #bind "F1"                           "help"         # Not yet implemented!
265 #bind "C-F1"                         "help-context" # Not yet implemented!
266 \bind "F2"                           "buffer-write"
267 \bind "C-F4"                         "buffer-close"
268 \bind "C-A-Up"                       "scroll line up"
269 \bind "C-A-Down"                     "scroll line down"
270 \bind "C-A-Prior"                    "scroll page up"
271 \bind "C-A-Next"                     "scroll page down"
272 \bind "F7"                           "dialog-show spellchecker"
273 \bind "S-F7"                         "thesaurus-entry"
274
275 \bind "C-M-o"                        "dialog-show toc"
276
277 #
278 # Additional Motion group
279 #
280
281 \bind "C-~S-greater"                 "label-goto"
282 \bind "C-~S-less"                            "bookmark-goto 0"
283
284 #
285 # Additional Motion + select group
286 #
287
288 \bind "S-Prior"                      "screen-up-select"
289 \bind "S-Next"                       "screen-down-select"
290 \bind "C-Insert"                     "copy"
291 \bind "S-Insert"                     "paste"
292 \bind "S-Delete"                     "cut"
293
294 # Numeric keypad (if Shift+KP_XXX does not switch the NumLock state)
295 \bind "S-KP_Right"                   "char-right-select"
296 \bind "S-KP_Left"                    "char-left-select"
297 \bind "S-KP_Up"                      "up-select"
298 \bind "S-KP_Down"                    "down-select"
299 \bind "S-M-KP_Right"                 "word-right-select"
300 \bind "S-M-KP_Left"                  "word-left-select"
301 \bind "S-M-KP_Up"                    "paragraph-up-select"
302 \bind "S-M-KP_Down"                  "paragraph-down-select"
303 \bind "S-KP_Home"                    "line-begin-select"
304 \bind "S-KP_End"                     "line-end-select"
305 \bind "S-KP_Prior"                   "screen-up-select"
306 \bind "S-KP_Next"                    "screen-down-select"
307 \bind "S-C-KP_Home"                  "buffer-begin-select"
308 \bind "S-C-KP_End"                   "buffer-end-select"
309 \bind "S-C-KP_Prior"                 "buffer-begin-select"
310 \bind "S-C-KP_Next"                  "buffer-end-select"
311 \bind "C-KP_Insert"                  "copy"
312 \bind "S-KP_Insert"                  "paste"
313 \bind "S-KP_Delete"                  "cut"
314
315 #
316 # bookmarks
317 #
318
319 \bind "C-~S-1"                       "bookmark-goto 1"
320 \bind "C-~S-2"                       "bookmark-goto 2"
321 \bind "C-~S-3"                       "bookmark-goto 3"
322 \bind "C-~S-4"                       "bookmark-goto 4"
323 \bind "C-~S-5"                       "bookmark-goto 5"
324 \bind "C-~S-6"                       "bookmark-goto 6"
325 \bind "C-~S-7"                       "bookmark-goto 7"
326 \bind "C-~S-8"                       "bookmark-goto 8"
327 \bind "C-~S-9"                       "bookmark-goto 9"
328 \bind "C-M-~S-1"                     "bookmark-save 1"
329 \bind "C-M-~S-2"                     "bookmark-save 2"
330 \bind "C-M-~S-3"                     "bookmark-save 3"
331 \bind "C-M-~S-4"                     "bookmark-save 4"
332 \bind "C-M-~S-5"                     "bookmark-save 5"
333 \bind "C-M-~S-6"                     "bookmark-save 6"
334 \bind "C-M-~S-7"                     "bookmark-save 7"
335 \bind "C-M-~S-8"                     "bookmark-save 8"
336 \bind "C-M-~S-9"                     "bookmark-save 9"
337
338 #
339 # Additional Edit group
340 #
341
342 \bind "M-Delete"                     "word-delete-forward"
343 \bind "M-BackSpace"                  "word-delete-backward"
344 \bind "M-Return"                     "break-paragraph inverse"
345 \bind "C-Return"                     "newline-insert newline"
346 \bind "C-S-Return"                   "newline-insert linebreak"
347 \bind "M-space"                      "space-insert protected"
348 \bind "nobreakspace"                 "space-insert protected"
349 \bind "C-M-space"                    "space-insert normal"
350 \bind "S-M-space"                    "space-insert thin"
351 \bind "C-~S-slash"                   "specialchar-insert slash"
352 \bind "C-period"                     "specialchar-insert end-of-sentence"
353 \bind "M-period"                     "specialchar-insert dots"
354 \bind "Escape"                       "cancel"
355 \bind "C-M-Up"                       "paragraph-move-up"
356 \bind "C-M-Down"                     "paragraph-move-down"
357 #\bind "F9"                          "meta-prefix"
358
359 # Include menu and math bindings
360
361 \bind_file menus.bind
362 \bind_file math.bind
363 \bind_file latinkeys.bind
364 \bind_file cyrkeys.bind
365 \bind_file greekkeys.bind