-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathediting_commands.py
28 lines (27 loc) · 1.52 KB
/
editing_commands.py
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
from dragonfly import *
from utilities import release
from format import (format_text)
map = {
"space [<n>]": release + Key("space:%(n)d"),
"enter [<n>]": release + Key("enter:%(n)d"),
"tab [<n>]": Key("tab:%(n)d"),
"delete [<n>]": release + Key("del:%(n)d"),
"delete [<n> | this] (line|lines)": release + Key("home, s-down:%(n)d, del"),
"delete [<n>] words": release + Key("ctrl:down, shift:down, left:%(n)d, del"),
"select [<n>] words": release + Key("ctrl:down, shift:down, left:%(n)d"),
"backspace [<n>]": release + Key("backspace:%(n)d"),
"paste": release + Key("c-v"),
"duplicate <n>": release + Key("c-c, c-v:%(n)d"),
"copy": release + Key("c-c"),
"cut": release + Key("c-x"),
"select all": release + Key("c-a"),
"[hold] shift": Key("shift:down"),
"release shift": Key("shift:up"),
"[hold] control": Key("ctrl:down"),
"release control": Key("ctrl:up"),
"release [all]": release,
"new file": release + Key("c-n"),
"close tab": release + Key("c-w"),
"save file": release + Key("c-s"),
"<formatType> <text>": Function(format_text)
}