1 -- Authors: Matthieu MOY <Matthieu.Moy@imag.fr>, David Hansen <david.hansen@physik.fu-berlin.de>, Tyranix <tyranix@gmail.com>, Adam Di Carlo <aph@debian.org>
2 -- License: Public domain
3 -- Last Changed: 2007-04-27
5 -- Emacs-like keyboard configuration for Ion, version 3.
6 -- Written by Matthieu MOY (Matthieu.Moy@imag.fr) on February 15, 2005.
9 -- Please note: You will almost certainly want to change Ion3's default
10 -- META binding to Alt (as this will interfere with Emacs).
11 -- See the FAQ or the wiki entries on this subject.
12 -- Use cfg_debian.lua on Debian installations to make the change global
13 -- across ion3 upgrades.
16 Copy this file in your ~/.ion3/ directory
18 dopath("emacs-bindings")
19 At the *end* of your ~/.ion3/cfg_ion.lua file, or in ~/.ion3/cfg_user.lua
21 These bindings are not for every ion3 function. By copying the file, you
22 will add bindings for ion3. You will still have to use the default ion3
23 bindings for any functions not bound here.
25 Comments/Feedback welcome. See the changelog at the end.
29 List of the bindings. These are executed after the main ion3 bindings.
31 What you should do is familiarize yourself with the main ion3 bindings and
32 then review these additions. The Emacs bindings should provide additional
33 bindings *not* replace the default ion3 bindings.
35 Note that ion bindings use "META+<something>" but since we're all Emacs
36 users here, I left it in Emacs form "META-<something>".
38 Ion binding Emacs binding Description
41 META-x 0 C-x 0 Destroy the current frame
42 META-x 1 C-x 1 Move all windows to single frame; destroy rest
43 META-x 2 C-x 2 Split current frame vertically
44 META-x 3 C-x 3 Split current frame horizontally
45 META-x META-x 2 Split current floating frame vertically
46 META-x META-x 3 Split current floating frame horizontally
47 META-x o C-x o Cycle to the next workspace
50 META-x b C-x b Query client win to attach to active frame
51 META-x k C-x k Close current object
52 META-u META-x k Kill client owning current client window
53 META-q C-q Enter next character literally
54 META-Ctrl-Space Attach tagged objects to this frame
55 META-Shift-: C-: Query for Lua code to execute
58 META-Shift-: C-: Query for Lua code to execute (XXX DUP?)
59 META-x b C-x b Query for a client window to go to
60 META-x META-b C-x C-b Display the window list menu
61 META-x w Query for workspace to go to (or create)
62 META-x META-w Display list of workspaces
65 M-f M-f Skip one word forward
66 M-<right> M-<right> Skip one word forward
67 M-b M-b Skip one word backward
68 M-<left> M-<left> Skip one word backward
69 M-d M-d Delete one word forward
70 M-<backspace> M-<backspace> Delete one word backward
71 C-k C-k Delete from current position to end of line
73 C-y C-y Paste from the clipboard
74 C-<space> C-SPC Set mark/begin selection
75 C-g C-g Clear mark/cancel selection or abort
76 M-p M-p Select next (matching) history entry
77 M-n M-n Select previous (matching) history entry
80 Global M-h k C-h k Describe key
81 WEdlin M-t M-t Transpose word
87 -- Download it from http://modeemi.cs.tut.fi/~tuomov/repos/ion-scripts-3/scripts/collapse.lua
88 -- Debian includes it in the ion3-scripts package.
95 function WTiling
.other_client(ws
, sub
)
96 if ws
:current() == ioncore
.goto_next(sub
, 'right') then
97 ioncore
.goto_next(sub
, 'bottom')
102 bdoc("Unbind META-TAB"),
103 kpress(META
.."Tab", nil),
106 bdoc("Destroy current frame."),
107 kpress ("AnyModifier+0", "WTiling.unsplit_at(_, _sub)"),
109 bdoc("Move all windows on WTiling to single frame and destroy rest"),
110 kpress ("AnyModifier+1", "collapse.collapse(_)"),
112 bdoc("Split current frame vertically"),
113 kpress ("AnyModifier+2", "WTiling.split_at(_, _sub, 'top', true)"),
115 bdoc("Split current frame horizontally"),
116 kpress ("AnyModifier+3", "WTiling.split_at(_, _sub, 'left', true)"),
119 bdoc("Split current floating frame vertically"),
120 kpress("AnyModifier+2",
121 "WTiling.split_at(_, _sub, 'floating:bottom', true)"),
123 bdoc("Split current floating frame horizontally"),
124 kpress("AnyModifier+3",
125 "WTiling.split_at(_, _sub, 'floating:right', true)"),
128 bdoc("Cycle to the next workspace"),
129 kpress ("AnyModifier+o", "WTiling.other_client(_, _sub)")
133 defbindings("WTiling", Emacs
.WTiling
)
139 -- * C-TAB, C-S-TAB, C-SPACE, C-C-SPACE, C-u C-x k are not emacs binding
140 -- * C-:, C-! should maybe M-, M-!: (we would need to set MOD2, probably
146 bdoc("Query for a client window to attach to active frame."),
147 kpress("b", "mod_query.query_attachclient(_)"),
149 bdoc("Close current object."),
150 kpress("k", "WRegion.rqclose_propagate(_, _sub)"),
155 bdoc("Kill client owning current client window."),
156 kpress("k", "WClientWin.kill(_sub)", "_sub:WClientWin"),
160 bdoc("Send next key press to current client window. "..
161 "Some programs may not allow this by default."),
162 kpress(META
.."q", "WClientWin.quote_next(_sub)", "_sub:WClientWin"),
164 -- Interferes with mod_sp binding
165 -- bdoc("Tag current object within the frame."),
166 -- kpress(META.."space", "WRegion.set_tagged(_sub, 'toggle')"),
168 bdoc("Attach tagged objects to this frame."),
169 kpress(META
.."Control+space", "WFrame.attach_tagged(_)"),
171 bdoc("Query for Lua code to execute."),
172 kpress(META
.."Shift+colon", "mod_query.query_lua(_)"),
175 defbindings("WMPlex", Emacs
.WMPlex
)
181 -- * C-x w, C-x C-w are not emacs bindings
182 -- * C-x b should really attach *and* focus the client
186 bdoc("Query for Lua code to execute."),
187 kpress(META
.."Shift+colon", "mod_query.query_lua(_)"),
189 -- This conflicts with going to the first display in multihead setup.
190 -- bdoc("Query for command line to execute."),
191 -- kpress(META.."Shift+exclam", "mod_query.query_exec(_)"),
194 bdoc("Query for a client window to go to."),
195 kpress("b", "mod_query.query_gotoclient(_)"),
197 bdoc("Display the window list menu."),
198 kpress(META
.."b", "mod_menu.menu(_, _sub, 'windowlist')"),
200 bdoc("Query for workspace to go to or create a new one."),
201 kpress("w", "mod_query.query_workspace(_)"),
203 bdoc("Display a list of workspaces."),
204 kpress(META
.."w", "mod_menu.menu(_, _sub, 'workspacelist')"),
208 defbindings("WScreen", Emacs
.WScreen
);
214 -- M-d, M-backspace don't copy to the clipboard
215 -- M-p, M-n do eshell like history, C-p, C-n model-line like history
218 function WEdln
:cut_to_eol ()
224 function WEdln
:clear_mark_or_abort ()
225 if -1 ~= self
:mark() then
233 bdoc("Skip one word forward."),
234 kpress("Mod1+f", "WEdln.skip_word(_)"),
236 bdoc("Skip one word backward."),
237 kpress("Mod1+Right", "WEdln.skip_word(_)"),
239 bdoc("Skip one word backward."),
240 kpress("Mod1+b", "WEdln.bskip_word(_)"),
242 bdoc("Skip one word backward."),
243 kpress("Mod1+Left", "WEdln.bskip_word(_)"),
245 bdoc("Delete one word forward."),
246 kpress("Mod1+d", "WEdln.kill_word(_)"),
248 bdoc("Delete one word backward."),
249 kpress("Mod1+BackSpace", "WEdln.bkill_word(_)"),
251 bdoc("Delete from current position to the end of the line."),
252 kpress("Control+K", "WEdln.cut_to_eol(_)"),
254 bdoc("Cut selection."),
255 kpress("Control+W", "WEdln.cut(_)"),
257 bdoc("Paste from the clipboard."),
258 kpress("Control+Y", "WEdln.paste(_)"),
260 bdoc("Set mark/begin selection."),
261 kpress("Control+space", "WEdln.set_mark(_)"),
263 bdoc("Clear mark/cancel selection or abort."),
264 kpress("Control+G", "WEdln.clear_mark_or_abort(_)"),
266 bdoc("Select next (matching) history entry."),
267 kpress("Mod1+p", "WEdln.history_prev(_, true)"),
269 bdoc("Select previous (matching) history entry."),
270 kpress("Mod1+n", "WEdln.history_next(_, true)"),
273 defbindings("WEdln", Emacs
.WEdln
)
278 -- David Hansen <david.hansen@physik.fu-berlin.de> (all public domain)
280 -- * DEFAULT_MOD -> MOD1
281 -- * WEdln: M-f, M-b, M-backspace, M-d, M-p, M-n, M-right, M-left
282 -- * WEdln: C-g clear mark or abort if the mark is not set
283 -- * WEdln: C-k copy to clipboard
284 -- * WMPlex: removed C-! C-:, C-x b (they are also in WScreen)
285 -- * WMPlex: C-q, C-x C-k, C-u C-x C-k
286 -- * WScreen: C-x C-b, C-x w, C-x C-w
287 -- * WIonWS: C-x 2, C-x 3 a bit more emacs like
288 -- * WIonWS: fixed C-x o
289 -- * WIonWS: removed C-x C-x *
291 -- Tyranix <tyranix@gmail.com> (all public domain)
292 -- * Added comments about how emacs-bindings.lua relates to the defaults
293 -- * Added bdoc() comments to each binding
294 -- * Rearranged code so the bdoc comments are easier to read
295 -- * Added a main listing of every binding in this file along with what you
296 -- should think in Emacs terms
297 -- * Remove META-! because it conflicts with moving between multihead displays
298 -- * Changed MOD1 to META as this is the new name for it in newer ion3
299 -- * Added Shift+ to the META-: and META-exclam
300 -- * Removed META-<space> because it interferes with the scratch pad (mod_sp).
303 -- Adam Di Carlo <aph@debian.org> (all public domain, April 27 2007)
304 -- * For compatability with ion3 20070318, change WIonWS to WTiling.
305 -- * Disable non-working and overly obtrusive META-TAB and META-Shift-TAB