index.md - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
index.md (3089B) | |
--- | |
1 keymodes | |
2 ======== | |
3 | |
4 Description | |
5 ----------- | |
6 This patch provides key modes (like in Vim). There are two key modes: | |
7 | |
8 1. `COMMANDMODE`: In this mode any key is grabbed and only the registered | |
9 command keys have any effect. | |
10 2. `INSERTMODE`: This is the normal key mode, in which the original key | |
11 bindings of dwm and applications are effective and text can be entere… | |
12 | |
13 With key modes you can use any key binding for window management without | |
14 risking conflicts with existing key bindings in applications or have a | |
15 Vim-style dwm. | |
16 | |
17 There are two different patches: | |
18 | |
19 * keymodes: the minimal patch | |
20 * vim-keymodes: This patch tries to emulate the key bindings of Vim. The… | |
21 it includes additional functions, which depend on the | |
22 [flextile patch](../flextile/). | |
23 | |
24 Configuration | |
25 ------------- | |
26 1. Download the favoured patch and apply it according to the | |
27 [general instructions](.). If you choose vim-keymodes you will have t… | |
28 the [flextile patch](../flextile/) first. | |
29 2. Transfer the changes made by the patch in `config.def.h` to your `con… | |
30 if needed; please see the patch file for details. | |
31 3. Verify the following lines in the aforementioned arrays; the key bind… | |
32 are set in reference to a german keyboard layout. The entries in the … | |
33 array are defined like those in the original `keys` array of dwm and … | |
34 precedence over the key bindings defined in the `commands` array. The… | |
35 and keysym definitions in the `commands` array are themselves arrays … | |
36 entries, whereas the first entry in the modifier array corresponds to… | |
37 entry in the keysym array and so forth. You can find an example confi… | |
38 [here][dwm-keymodes-vim-config.h]. | |
39 | |
40 static Key keys[] = { | |
41 /* modifier key function … | |
42 { MODKEY, XK_Escape, setkeymode, … | |
43 | |
44 static Key cmdkeys[] = { | |
45 /* modifier keys function … | |
46 { 0, XK_Escape, clearcmd, … | |
47 { ControlMask, XK_c, clearcmd, … | |
48 { 0, XK_i, setkeymode, … | |
49 }; | |
50 static Command commands[] = { | |
51 /* modifier (4 keys) keysyms (4 keys) function … | |
52 ... | |
53 }; | |
54 | |
55 Usage | |
56 ----- | |
57 With this patch dwm starts in `COMMANDMODE` and you can use the key bind… | |
58 defined in the `commands` array in `config.h`. Press `Escape` or `CTRL+c… | |
59 abort a command input and press `i` (in the default configuration) to en… | |
60 `INSERTMODE` and use dwm normally with the key bindings defined in the `… | |
61 array, navigate in applications and insert text. To get from `INSERTMODE… | |
62 `COMMANDMODE` press `ALT+Escape` (in the default configuration). | |
63 | |
64 Download | |
65 -------- | |
66 * [dwm-keymodes-5.8.2.diff](dwm-keymodes-5.8.2.diff) (20100611, joten (a… | |
67 * [dwm-keymodes-vim-5.8.2.diff](dwm-keymodes-vim-5.8.2.diff) (20100611, … | |
68 * [dwm-keymodes-20220422.diff](dwm-keymodes-20220422.diff) (michael@ndri… |