Skip to content

Commit

Permalink
expanded commands for slack
Browse files Browse the repository at this point in the history
  • Loading branch information
TestPlan committed Aug 26, 2018
1 parent a8fdd4e commit 94a84a0
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,65 @@
ctx = Context('slack', bundle='com.tinyspeck.slackmacgap')

keymap = {

# Channel
'channel': Key('cmd-k'),
'channel last': Key('alt-up'),
'channel unread previous': Key('alt-shift-up'),
'channel next': Key('alt-down'),
'channel unread next': Key('alt-shift-down'),
'channel info': Key('cmd-shift-i'),

# Tools
'tools command': ['``', Key('left')],
'tools code': ['``````', Key('left left left return return up')],

# Navigation
'move focus': Key('ctrl-`'),
'next section': Key('f6'),
'previous section': Key('shift-f6'),
'page up': Key('pageup'),
'page down': Key('pagedown'),
'(open | collapse) right pane': Key('cmd-.'),
'direct messages': Key('cmd-shift-k'),
'threads': Key('cmd-shift-t'),
'history': Key('cmd-['),
'(back to the future | forward)': Key('cmd-]'),
'next element': Key('tab'),
'previous element': Key('shift-tab'),
'(my stuff | activity)': Key('cmd-shift-m'),
'directory': Key('cmd-shift-e'),
'starred items': Key('cmd-shift-s'),
'unread': Key('cmd-j'),
'(go | undo) full': Key('ctrl-cmd-f'),

# Messaging
'grab left': Key('shift-up'),
'grab right': Key('shift-down'),
'add line': Key('shift-enter'),
'slaw': [Key('cmd-right'), Key('shift-enter')],
'(react | reaction)': Key('cmd-shift-\\'),
'user': Key('@'),
'tag channel': Key('#'),
'codify': Key('cmd-shift-c'),
'(bullet | bulleted) list': Key('cmd-shift-8'),
'(number | numbered) list': Key('cmd-shift-7'),
'quotation': Key('cmd-shift->'),
'bold': Key('cmd-b'),
'(italic | italicize)': Key('cmd-i'),
'(strike | strikethrough)': Key('cmd-shift-x'),
'mark all read': Key('shift-esc'),
'mark channel read': Key('esc'),
'clear': [Key('cmd-a'), Key('backspace')],

# Files and Snippets
'upload': Key('cmd-u'),
'snippet': Key('cmd-shift-enter'),

# Calls
'([toggle] mute | unmute)': Key('m'),
'([toggle] video)': Key('v'),
'invite': Key('a'),
}

ctx.keymap(keymap)
2 changes: 1 addition & 1 deletion vs-code.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def jump_to_line(m):
press('cmd-left')

def jump_to_next_word_instance(m):
press('escape')
press('escape')
press('cmd-f')
Str(' '.join([str(s) for s in m.dgndictation[0]._words]))(None)
press('escape')
Expand Down

0 comments on commit 94a84a0

Please sign in to comment.