]> git.lyx.org Git - lyx.git/blob - lib/bind/sciword.bind
fix bug 9
[lyx.git] / lib / bind / sciword.bind
1 # This file is part of LyX
2
3 # LyX keyboard definitions similar to those of Scientific Word.
4 # Prepared by Serge Winitzki. Version 1.2
5 # Somewhat updated by Jean-Marc Lasgouttes (I'm sure that I simplified it, 
6 #    but I'm not sure that I did not break it :)
7
8 # Tip: to find the "LyX name" for a key, look at the status bar after
9 # typing some non-existent key combination. E.g. to find how "Ctrl-&" is
10 # referenced, press Ctrl-S Ctrl-&: the status bar shows "C-s S-C-ampersand."
11
12 #\bind "C-a"                    "------"
13 #\bind "C-b"                    "font-bold"
14
15 # Copy, paste, etc.: more familiar keys
16 \bind "C-c"     "copy"
17
18 # Display equation toggle: type it in a displayed equation to convert it
19 # back to an inline equation
20 # Sciword mnemonic.
21 \bind "C-d"     "math-display"
22
23 #\bind "C-e"    "------"
24 # Greek for only one character. "math-greek-toggle" is the persistent Greek
25 # toggle which nobody really needs when typing math.
26 # Sciword mnemonic.
27 \bind "C-f"     "math-insert \frac"
28 \bind "C-g"     "math-greek"
29
30 # Do we need this?
31 #\bind "C-h"    "hyphenation-point-insert"
32
33 # Sciword mnemonic.
34 \bind "C-i"     "math-insert \int"
35
36 #\bind "C-j"    "------"
37
38 \bind "C-k"     "line-delete-forward"
39 \bind "C-l"     "screen-recenter"
40
41 # Toggle: in text mode, switch to math, and vice versa. Also C-t.
42 \bind "C-m"     "math-mode"
43 # C-n is numbering equations now. Sciword had "C-Tab" mnemonic which conflicts with many things.
44 # Numbering equations. Should perhaps simplify math-number and math-nonumber into one command since they are used in very different contexts. This and also math-macro stuff should be available in the Lyx menus!
45 \bind "C-n"     "math-number"
46 \bind "S-C-n" "math-nonumber"
47 \bind "C-o"     "inset-toggle"
48
49 # Insert a quote character. Do I need this?
50 # Probably, since we need a way to get a raw quote
51 \bind "C-q"     "self-insert \""
52
53 # Sciword mnemonic.
54 \bind "C-r"     "math-insert \sqrt"
55
56 # This combination is now a gateway to math symbols (C-s ...)
57 #\bind "C-s"    "------"
58
59 # Sciword mnemonic for going between text and math modes.
60 \bind "C-t"     "math-mode"
61 \bind "C-u"     "font-underline"
62 \bind "C-v"     "paste"
63 \bind "C-w"     "buffer-close"
64 \bind "C-x"     "cut"
65 \bind "C-z"     "undo"
66 \bind "S-C-z"   "redo"
67
68
69 # This combination makes an umlaut accent now.
70 #\bind "S-C-quotedbl"           "quote-insert"
71
72 # Bracket delimiters. Sciword mnemonic is to press Control-<bracket key>
73
74 \bind "C-9"     "math-delim ( )"
75 \bind "S-C-parenleft"   "math-delim ( )"
76 \bind "C-0"     "math-delim ( )"
77 \bind "S-C-parenright"  "math-delim ( )"
78
79 \bind "C-bracketleft"           "math-delim [ ]"
80 \bind "C-bracketright"  "math-delim [ ]"
81 \bind "C-S-less"                "math-delim langle rangle"
82 \bind "C-S-greater"             "math-delim langle rangle"
83
84 # The bar bracket: on some keyboards, e.g. British, the bar character is
85 # bound to an Alt-something and on some wayward Unices to "brokenbar".
86 \bind "C-S-bar"         "math-delim | |"
87 \bind "C-S-brokenbar"   "math-delim | |"
88 \bind "C-M-bar"         "math-delim | |"
89
90 \bind "S-C-braceleft"           "math-delim { }"
91 \bind "S-C-braceright"          "math-delim { }"
92
93 # Accents by Sciword mnemonics. Mostly press Ctrl-<accent key>
94 # e.g. Ctrl-. for overdot, Ctrl-' for acute accent, Ctrl-~ for tilde etc.
95 # Some of them seem to work only in math mode?
96
97 \bind "C-period"        "accent-dot"
98 \bind "S-C-colon"       "math-insert \ddot"
99 \bind "C-quoteleft"     "accent-grave"
100 \bind "S-C-asciitilde"  "accent-tilde"
101 \bind "S-C-quotedbl"    "accent-umlaut"
102 \bind "C-apostrophe"    "accent-acute"
103 \bind "S-C-asciicircum" "accent-circumflex"
104 \bind "C-equal"         "math-insert \vec"
105 # Why is it not "accent-bar"?
106 \bind "C-minus" "math-insert \bar"
107 # What is "accent-underbar"?
108 #\bind "S-C-underscore" "accent-underbar"
109
110 # Function keys.
111
112 #\bind "F1"     "help"  # Not yet implemented!
113 #\bind "C-F1"                   "help-context"                  # Not yet implemented!
114 \bind "F2"                     "buffer-write"
115 \bind "F3"                     "find-replace"
116
117 \bind "C-F4"                   "buffer-close"
118 \bind "M-F4"                   "lyx-quit"
119 # F4 to F8 are used to switch fonts. Sciword mnemonic.
120 \bind "F4"                     "font-default"
121 \bind "F5"                     "font-bold"
122 \bind "F6"                     "font-emph"
123 \bind "F7"                     "font-code"
124 \bind "F8"                     "font-noun"
125 # F9 bound below as meta-prefix (useful e.g. if the keyboard doesn't have a working ALT).
126 #\bind "F9"                     "------"
127 #\bind "F10"                    "------"
128
129 # Sciword mnemonics for math editing:
130
131 \bind "M-apostrophe"    "math-insert \prime"
132 \bind "C-Up"            "math-insert ^"
133 \bind "C-Down"          "math-insert _"
134 \bind "C-s d"           "math-insert \partial"
135 \bind "C-s e"           "math-insert \sum"
136 \bind "C-s p"           "math-insert \prod"
137 \bind "C-s i"           "math-insert \infty"
138 \bind "C-s x"           "math-insert \times"
139
140 # My own embellishments for symbols I use often.
141
142 #I'd like to combine math-insert ^ and math-insert prime, but don't know how.
143
144 \bind "C-s apostrophe"  "math-insert \prime"
145 \bind "C-s S-plus"      "math-insert \dagger"
146 \bind "C-s equal"       "math-insert \equiv"
147 \bind "M-equal"         "math-insert \approx"
148 \bind "M-minus"         "math-insert \sim"
149 \bind "C-minus"         "math-insert \rightarrow"
150 \bind "S-M-less"        "math-insert \leq"
151 \bind "S-M-greater"     "math-insert \geq"
152 \bind "C-s S-less"      "math-insert \ll"
153 \bind "C-s S-greater"   "math-insert \gg"
154
155 # usual math bindings
156 \bind_file maths.bind
157
158         ############################
159 ######### Almost no changes below. #########
160         ############################
161
162 #
163 # Motion group
164 #
165
166 \bind "Right"                  "char-forward"
167 \bind "Left"                   "char-backward"
168 \bind "Up"                     "up"
169 \bind "Down"                   "down"
170 \bind "C-Right"                "word-forward"
171 \bind "C-Left"                 "word-backward"
172 # These are now used to insert superscripts and subscripts.
173 #\bind "C-Up"                   "paragraph-up"
174 #\bind "C-Down"                 "paragraph-down"
175 \bind "Home"                   "line-begin"
176 \bind "End"                    "line-end"
177 \bind "Prior"                  "screen-up"
178 \bind "Next"                   "screen-down"
179 \bind "C-Home"                 "buffer-begin"
180 \bind "C-End"                  "buffer-end"
181 \bind "Tab"                    "tab-forward"
182
183 #
184 # Motion + select group
185 #
186
187 \bind "S-Right"                "forward-select"
188 \bind "S-Left"                 "backward-select"
189 \bind "S-Up"                   "up-select"
190 \bind "S-Down"                 "down-select"
191 \bind "S-C-Right"              "word-forward-select"
192 \bind "S-C-Left"               "word-backward-select"
193 \bind "S-C-Up"                 "paragraph-up-select"
194 \bind "S-C-Down"               "paragraph-down-select"
195 \bind "S-Home"                 "line-begin-select"
196 \bind "S-End"                  "line-end-select"
197 \bind "S-Prior"                "screen-up-select"
198 \bind "S-Next"                 "screen-down-select"
199 \bind "S-C-Home"               "buffer-begin-select"
200 \bind "S-C-End"                "buffer-end-select"
201 \bind "C-Insert"               "copy"
202 \bind "S-Insert"               "paste"
203 \bind "S-Delete"               "cut"
204
205 # Numeric keypad (if Shift+KP_XXX does not switch the NumLock state)
206 \bind "S-KP_Right"              "forward-select"
207 \bind "S-KP_Left"               "backward-select"
208 \bind "S-KP_Up"                 "up-select"
209 \bind "S-KP_Down"               "down-select"
210 \bind "S-C-KP_Right"            "word-forward-select"
211 \bind "S-C-KP_Left"             "word-backward-select"
212 \bind "S-C-KP_Up"               "paragraph-up-select"
213 \bind "S-C-KP_Down"             "paragraph-down-select"
214 \bind "S-KP_Home"               "line-begin-select"
215 \bind "S-KP_End"                "line-end-select"               
216 \bind "S-KP_Prior"              "screen-up-select"
217 \bind "S-KP_Next"               "screen-down-select"
218 \bind "S-C-KP_Home"             "buffer-begin-select"
219 \bind "S-C-KP_End"              "buffer-end-select"
220 \bind "S-C-KP_Prior"            "buffer-begin-select"
221 \bind "S-C-KP_Next"             "buffer-end-select"
222 \bind "C-KP_Insert"             "copy"
223 \bind "S-KP_Insert"             "paste"
224 \bind "S-KP_Delete"             "cut"
225
226
227 #
228 # Edit group
229 #
230
231 \bind "Delete"                 "delete-forward"
232 \bind "BackSpace"              "delete-backward"
233 \bind "C-Delete"               "word-delete-forward"
234 \bind "C-BackSpace"            "word-delete-backward"
235 \bind "Return"                 "break-paragraph"
236 \bind "M-Return"               "break-paragraph-keep-layout"
237 \bind "C-Return"               "break-line"
238 \bind "C-S-L"                  "ligature-break-insert"
239 \bind "C-space"                "protected-space-insert"
240 \bind "Escape"                 "cancel"
241 \bind "F9"                     "meta-prefix"
242
243
244 #
245 # The menus
246 #
247
248 \bind_file menus.bind
249
250 # this clashes with M-x so we can't use it. M-x is more
251 # important (reported by Serge Winitzki <winitzki@yahoo.com>)
252 # \bind "M-x c"                  "screen-recenter"
253
254 \bind "M-x"                     "command-execute"
255
256
257 \bind_file latinkeys.bind
258 \bind_file cyrkeys.bind
259 \bind_file greekkeys.bind