-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Experimental] Add support for forcing lanuages via a command. Re-wor…
…k code.lanuage to use app-specific win.file_ext()/win.file_name() actions.
- Loading branch information
Showing
11 changed files
with
196 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Microsoft - Visual Studio Code | ||
# see app/vscode.talon for voice commands | ||
|
||
os: linux | ||
app: Code | ||
app: Code - OSS | ||
- | ||
|
||
action(user.ide_refactor): | ||
key(ctrl-a) | ||
key(ctrl-shift-i) | ||
key(ctrl-s) | ||
|
||
action(user.ide_refactor_in_line): | ||
key(ctrl-shift-i) | ||
key(ctrl-s) | ||
|
||
action(user.ide_refactor_rename): | ||
key(f2) | ||
|
||
action(user.ide_follow): | ||
key(f12) | ||
|
||
action(user.ide_go_back): | ||
key(alt-left) | ||
|
||
action(user.ide_go_forward): | ||
key(alt-right) | ||
|
||
action(user.ide_up_cursor): | ||
key(ctrl-shift-up) | ||
|
||
action(user.ide_down_cursor): | ||
key(ctrl-shift-down) | ||
|
||
action(user.ide_toggle_terminal): | ||
key(ctrl-`) | ||
|
||
action(user.ide_terminal_new): | ||
key(ctrl-shift-`) | ||
|
||
action(user.ide_terminal_focus_previous): | ||
key(alt-left) | ||
|
||
action(user.ide_terminal_focus_next): | ||
key(alt-right) | ||
|
||
action(user.ide_terminal_trash): | ||
key(ctrl-shift-delete) | ||
|
||
action(user.ide_terminal_scroll_down): | ||
key(shift-pgdown) | ||
|
||
action(user.ide_terminal_scroll_up): | ||
key(shift-pgup) | ||
|
||
action(user.ide_toggle_comment): | ||
key(ctrl-/) | ||
|
||
action(user.ide_smart): | ||
key(ctrl-space) | ||
|
||
action(user.ide_parameter_hints): | ||
key(ctrl-shift-space) | ||
|
||
action(user.ide_done): | ||
key(tab) | ||
|
||
action(user.ide_show_explorer): | ||
key(ctrl-shift-e) | ||
|
||
action(user.ide_show_search): | ||
key(ctrl-shift-f) | ||
|
||
action(user.ide_show_source_control): | ||
key(ctrl-shift-g) | ||
|
||
action(user.ide_show_debug): | ||
key(ctrl-shift-d) | ||
|
||
action(user.ide_show_extensions): | ||
key(ctrl-shift-x) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from talon import Context, actions, ui, Module | ||
|
||
ctx_vscode = Context() | ||
|
||
ctx_vscode.matches = r''' | ||
app: Code | ||
app: Code - OSS | ||
app: Code | ||
app: Visual Studio Code | ||
app: Code.exe | ||
''' | ||
@ctx_vscode.action_class('win') | ||
class win_actions: | ||
def filename(): | ||
title = actions.win.title() | ||
result = title.split(" - ")[0] | ||
if "." in result: | ||
return result | ||
return "" | ||
|
||
def file_ext(): | ||
return actions.win.filename().split(".")[-1] |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from talon import Context, actions, ui, Module | ||
ctx = Context() | ||
|
||
ctx.matches = r''' | ||
app: Notepad++ : a free (GNU) source code editor | ||
app: notepad++.exe | ||
''' | ||
@ctx.action_class('win') | ||
class win_actions: | ||
def filename(): | ||
title = actions.win.title() | ||
result = title.split(" - ")[0] | ||
if "." in result: | ||
print(result.split("\\")[-1]) | ||
return result.split("\\")[-1] | ||
return "" | ||
|
||
def file_ext(): | ||
return actions.win.filename().split(".")[-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
code.language: go | ||
mode: user.go | ||
mode: command | ||
and code.language: go | ||
- | ||
variadic: "..." | ||
logical and: " && " | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
code.language: talon | ||
mode: user.talon | ||
mode: command | ||
and code.language: talon | ||
- | ||
insert: | ||
insert('insert("")') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters