-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtokeny.py
43 lines (32 loc) · 1.25 KB
/
tokeny.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from talon import Context, Module, actions
from talon import clip
import pyperclip
mod = Module()
ctx = Context()
ctx.matches = "title: /VIM/"
@mod.action_class
class Actions:
def pyperclip_insert(text: str):
"""Insert via copying to clipboard"""
def vim_tokeny_insert(variation: str, values: str = ''):
"""Execute TokenyInsert"""
def vim_tokeny_to(token: str, id: str = ''):
"""Execute TokenyTo"""
def vim_tokeny_back(token: str, id: str = ''):
"""Execute TokenyBack"""
def vim_tokeny_search(token: str, id: str = ''):
"""Execute TokenySearch"""
@ctx.action_class("user")
class TokenyActions:
def pyperclip_insert(text: str):
# with clip.revert():
clip.set_text(text)
actions.key('super-v')
def vim_tokeny_insert(variation: str, values: str = ''):
actions.user.vim_command_mode(f"TokenyInsert {variation} {values}")
def vim_tokeny_to(token: str, id: str = ''):
actions.user.vim_command_mode(f"TokenyTo {token} {id}")
def vim_tokeny_back(token: str, id: str = ''):
actions.user.vim_command_mode(f"TokenyBack {token} {id}")
def vim_tokeny_search(token: str, id: str = ''):
actions.user.vim_command_mode(f"TokenySearch {token} {id}")