-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vim.xkb
52 lines (45 loc) · 1.73 KB
/
.vim.xkb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Vim like keys with CAPS as overlay switch.
// Using ISO_Level3_Shift or ISO_Level5_Shift would also make
// most applications work and would have been more flexible,
// however they don't work in Java Swing apps (e.g. IntelliJ IDEA)
// but using overlay works
// To enable, save this file as /usr/share/X11/xkb/symbols/emacs and run:
//
// setxkbmap -option '' "emacs"
//
// However it may not persist and can get reset back to the default by other things.
// Alternatively, insert the following into /usr/share/X11/xkb/rules/evdev.xml
// ...
// <layoutList>
// ...
// <layout>
// <configItem>
// <name>emacs</name>
// <shortDescription>en</shortDescription>
// <description>English (US, Emacs)</description>
// <languageList>
// <iso639Id>eng</iso639Id>
// </languageList>
// </configItem>
// </layout>
// ...
// </layoutList>
// ...
// Then you should be able to choose 'English (US, Emacs)' in a keyboard preference
// GUI such as fcitx and have it persist.
default partial alphanumeric_keys
xkb_symbols "basic" {
// Base keyboard functionality, using 'us' here
// See definitions in /usr/share/X11/xkb/symbols
// e.g. 'include "us(intl)"' where 'intl' is defined inside the 'us' file
include "us"
// Press Shift_L + Shift_R together as an alternative way to toggle Caps_Lock,
// then turn CAPS key to enable overlay1 mode when and only when holding down.
include "shift(both_capslock)"
key <CAPS> {actions[Group1]=[SetControls(controls=overlay1)]};
// VIM like navigation keys when holding down <CAPS>
key <AC06> {overlay1=<LEFT>}; // h
key <AC09> {overlay1=<RGHT>}; // l
key <AC08> {overlay1=<UP> }; // k
key <AC07> {overlay1=<DOWN>}; // j
};