├── .DS_Store ├── LICENSE ├── README.md ├── apps ├── .DS_Store ├── 1password │ ├── 1password.talon │ ├── 1password_global.talon │ ├── password_manager.mac.talon │ ├── password_manager.py │ └── password_manager.win.talon ├── chrome │ ├── chrome.mac.talon │ └── chrome.win.talon ├── edge │ ├── edge.mac.talon │ └── edge.win.talon ├── file_manager.talon ├── firefox │ ├── firefox.linux.talon │ ├── firefox.mac.talon │ └── firefox.win.talon ├── generic_browser.talon ├── jetbrains │ ├── jetbrains.py │ └── jetbrains.talon ├── kubectl │ ├── kubectl.py │ └── kubectl.talon ├── linux │ ├── dunst.talon │ ├── gdb.talon │ ├── keepassx.talon │ ├── signal.talon │ ├── taskwarrior.talon │ ├── terminal.talon │ ├── termite.talon │ └── tmux.talon ├── mac │ ├── app.talon │ ├── datagrip.talon │ ├── edit.talon │ ├── finder.talon │ ├── rstudio.talon │ ├── safari.talon │ ├── terminal.talon │ └── vim.talon ├── slack │ ├── slack.mac.talon │ └── slack.win.talon ├── teams │ └── teams.talon ├── vscode │ ├── linux.talon │ ├── mac.talon │ ├── vscode.py │ ├── vscode.talon │ └── win.talon ├── web │ ├── outlook.talon │ └── protonmail.talon └── win │ ├── app.talon │ ├── edit.talon │ ├── explorer.talon │ ├── notepad++ │ ├── notepad++.py │ └── notepad++.talon │ └── terminal.talon ├── code ├── Resources │ └── HiddenCursor.cur ├── abbreviate.py ├── app_name_overrides.csv ├── code.py ├── css.py ├── delayed_speech_off.py ├── engine.py ├── exec.py ├── file_manager.py ├── formatters.py ├── help.py ├── history.py ├── homophones.csv ├── homophones.py ├── ide.py ├── javascript.py ├── keys.py ├── mouse.py ├── noise.py ├── numbers.py ├── ordinals.py ├── react.py ├── screenshot.py ├── selections.py ├── sql.py ├── switcher.py ├── tags.py ├── talon_helpers.py └── vocabulary.py ├── lang ├── comment.talon ├── csharp.talon ├── css.talon ├── go.talon ├── javascript.talon ├── operators.talon ├── programming.talon ├── python.talon ├── react.talon ├── sql.talon ├── talon.talon └── typescript.talon ├── misc ├── abbreviate.talon ├── formatters.talon ├── git.talon ├── git_add_patch.talon ├── help.talon ├── help_open.talon ├── history.talon ├── ide.talon ├── keys.talon ├── mouse.talon ├── repeater.talon ├── screenshot.talon ├── standard.talon ├── tabs.talon ├── talon_helpers.talon ├── temp.talon ├── toggles.talon └── window_management.talon ├── modes ├── dictation_mode.talon ├── modes.talon └── sleep_mode.talon ├── scale.py └── text ├── generic_editor.talon ├── homophones.talon ├── line_commands.talon └── symbols.talon /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joshwcomeau/talon-commands/075fda19967365bb58e5a03f43de98337471d269/.DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /apps/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joshwcomeau/talon-commands/075fda19967365bb58e5a03f43de98337471d269/apps/.DS_Store -------------------------------------------------------------------------------- /apps/1password/1password.talon: -------------------------------------------------------------------------------- 1 | app: 1Password.exe 2 | app: 1Password for Windows desktop 3 | app: com.agilebits.onepassword7 4 | - 5 | password new: user.password_new() 6 | password dup: user.password_duplicate() 7 | password edit: user.password_edit() 8 | password delete: user.password_delete() 9 | -------------------------------------------------------------------------------- /apps/1password/1password_global.talon: -------------------------------------------------------------------------------- 1 | #todo: tags 2 | - 3 | password fill: user.password_fill() 4 | password show: user.password_show() 5 | -------------------------------------------------------------------------------- /apps/1password/password_manager.mac.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | 3 | #i don't see a need to restrict the app here, this just defines the actions 4 | #each app can support appropriate voice commands as needed 5 | #the below are for 1password, redefine as needed 6 | - 7 | action(user.password_fill): 8 | key(cmd-\) 9 | 10 | action(user.password_show): 11 | key(cmd-alt-\) 12 | 13 | action(user.password_new): 14 | key(cmd-i) 15 | 16 | action(user.password_duplicate): 17 | key(cmd-d) 18 | 19 | action(user.password_edit): 20 | key(cmd-e) 21 | 22 | action(user.password_delete): 23 | key(cmd-backspace) 24 | 25 | -------------------------------------------------------------------------------- /apps/1password/password_manager.py: -------------------------------------------------------------------------------- 1 | from talon import app, Context, Module 2 | 3 | mod = Module() 4 | @mod.action_class 5 | class Actions: 6 | def password_fill(): 7 | """fill the password""" 8 | 9 | def password_show(): 10 | """show the password""" 11 | 12 | def password_new(): 13 | """New password""" 14 | 15 | def password_duplicate(): 16 | """Duplicate password""" 17 | 18 | def password_edit(): 19 | """Edit password""" 20 | 21 | def password_delete(): 22 | """Delete password""" -------------------------------------------------------------------------------- /apps/1password/password_manager.win.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | 3 | #i don't see a need to restrict the app here, this just defines the actions 4 | #each app can support appropriate voice commands as needed 5 | #the below are for 1password, redefine as needed 6 | - 7 | action(user.password_fill): 8 | key(ctrl-\\) 9 | 10 | action(user.password_show): 11 | key(alt-ctrl-\\) 12 | 13 | action(user.password_new): 14 | key(ctrl-n) 15 | 16 | action(user.password_duplicate): 17 | key(ctrl-d) 18 | 19 | action(user.password_edit): 20 | key(ctrl-e) 21 | 22 | action(user.password_delete): 23 | key(ctrl-delete) 24 | 25 | -------------------------------------------------------------------------------- /apps/chrome/chrome.mac.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: Google Chrome 3 | - 4 | tag(): browser 5 | tag(): tabs 6 | #action(browser.address): 7 | 8 | action(browser.bookmark): 9 | key(cmd-d) 10 | 11 | action(browser.bookmark_tabs): 12 | key(cmd-shift-d) 13 | 14 | action(browser.bookmarks): 15 | key(cmd-alt-b) 16 | 17 | action(browser.bookmarks_bar): 18 | key(cmd-shift-b) 19 | 20 | action(browser.focus_address): 21 | key(cmd-l) 22 | 23 | #action(browser.focus_page): 24 | 25 | action(browser.focus_search): 26 | browser.focus_address() 27 | 28 | action(browser.go): 29 | browser.focus_address() 30 | insert(url) 31 | key(enter) 32 | 33 | action(browser.go_blank): 34 | key(cmd-n) 35 | 36 | action(browser.go_back): 37 | key(cmd-[) 38 | 39 | action(browser.go_forward): 40 | key(cmd-]) 41 | 42 | action(browser.go_home): 43 | key(cmd-shift-h) 44 | 45 | action(browser.open_private_window): 46 | key(cmd-shift-n) 47 | 48 | action(browser.reload): 49 | key(cmd-r) 50 | 51 | action(browser.reload_hard): 52 | key(cmd-shift-r) 53 | 54 | #action(browser.reload_hardest): 55 | 56 | action(browser.show_clear_cache): 57 | key(cmd-shift-delete) 58 | 59 | action(browser.show_downloads): 60 | key(cmd-shift-j) 61 | 62 | #action(browser.show_extensions) 63 | 64 | action(browser.show_history): 65 | key(cmd-y) 66 | 67 | action(browser.submit_form): 68 | key(enter) 69 | 70 | #action(browser.title) 71 | 72 | action(browser.toggle_dev_tools): 73 | key(cmd-alt-i) 74 | -------------------------------------------------------------------------------- /apps/chrome/chrome.win.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | app: Google Chrome 3 | app: chrome.exe 4 | - 5 | tag(): browser 6 | tag(): tabs 7 | #action(browser.address): 8 | 9 | action(browser.bookmark): 10 | key(ctrl-d) 11 | 12 | action(browser.bookmark_tabs): 13 | key(ctrl-shift-d) 14 | 15 | action(browser.bookmarks): 16 | key(ctrl-shift-o) 17 | 18 | action(browser.bookmarks_bar): 19 | key(ctrl-shift-b) 20 | 21 | action(browser.focus_address): 22 | key(ctrl-l) 23 | 24 | #action(browser.focus_page): 25 | 26 | action(browser.focus_search): 27 | browser.focus_address() 28 | 29 | action(browser.go): 30 | browser.focus_address() 31 | insert(url) 32 | key(enter) 33 | 34 | action(browser.go_blank): 35 | key(ctrl-n) 36 | 37 | action(browser.go_back): 38 | key(alt-left) 39 | 40 | action(browser.go_forward): 41 | key(alt-right) 42 | 43 | action(browser.go_home): 44 | key(alt-home) 45 | 46 | action(browser.open_private_window): 47 | key(ctrl-shift-n) 48 | 49 | action(browser.reload): 50 | key(ctrl-r) 51 | 52 | action(browser.reload_hard): 53 | key(ctrl-shift-r) 54 | 55 | #action(browser.reload_hardest): 56 | 57 | action(browser.show_clear_cache): 58 | key(ctrl-shift-delete) 59 | 60 | action(browser.show_downloads): 61 | key(ctrl-j) 62 | 63 | #action(browser.show_extensions) 64 | 65 | action(browser.show_history): 66 | key(ctrl-h) 67 | 68 | action(browser.submit_form): 69 | key(enter) 70 | 71 | #action(browser.title) 72 | 73 | action(browser.toggle_dev_tools): 74 | key(ctrl-shift-i) 75 | -------------------------------------------------------------------------------- /apps/edge/edge.mac.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: Microsoft Edge 3 | - 4 | tag(): browser 5 | tag(): tabs 6 | #action(browser.address): 7 | 8 | action(browser.bookmark): 9 | key(ctrl-d) 10 | 11 | action(browser.bookmark_tabs): 12 | key(ctrl-shift-d) 13 | 14 | action(browser.bookmarks): 15 | key(ctrl-shift-o) 16 | 17 | action(browser.bookmarks_bar): 18 | key(ctrl-shift-b) 19 | 20 | action(browser.focus_address): 21 | key(ctrl-l) 22 | 23 | #action(browser.focus_page): 24 | 25 | action(browser.focus_search): 26 | browser.focus_address() 27 | 28 | action(browser.go): 29 | browser.focus_address() 30 | insert(url) 31 | key(enter) 32 | 33 | action(browser.go_blank): 34 | key(ctrl-n) 35 | 36 | action(browser.go_back): 37 | key(alt-left) 38 | 39 | action(browser.go_forward): 40 | key(alt-right) 41 | 42 | action(browser.go_home): 43 | key(alt-home) 44 | 45 | action(browser.open_private_window): 46 | key(ctrl-shift-p) 47 | 48 | action(browser.reload): 49 | key(ctrl-r) 50 | 51 | action(browser.reload_hard): 52 | key(shift-f5) 53 | 54 | #action(browser.reload_hardest): 55 | 56 | action(browser.show_clear_cache): 57 | key(ctrl-shift-delete) 58 | 59 | action(browser.show_downloads): 60 | key(ctrl-j) 61 | 62 | #action(browser.show_extensions) 63 | 64 | action(browser.show_history): 65 | key(ctrl-h) 66 | 67 | action(browser.submit_form): 68 | key(enter) 69 | 70 | #action(browser.title) 71 | 72 | action(browser.toggle_dev_tools): 73 | key(ctrl-shift-i) 74 | -------------------------------------------------------------------------------- /apps/edge/edge.win.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | app: Microsoft Edge 3 | app: MicrosoftEdge.exe 4 | - 5 | tag(): browser 6 | tag(): tabs 7 | #action(browser.address): 8 | 9 | action(browser.bookmark): 10 | key(ctrl-d) 11 | 12 | action(browser.bookmark_tabs): 13 | key(ctrl-shift-d) 14 | 15 | action(browser.bookmarks): 16 | key(ctrl-shift-o) 17 | 18 | action(browser.bookmarks_bar): 19 | key(ctrl-shift-b) 20 | 21 | action(browser.focus_address): 22 | key(ctrl-l) 23 | 24 | #action(browser.focus_page): 25 | 26 | action(browser.focus_search): 27 | browser.focus_address() 28 | 29 | action(browser.go): 30 | browser.focus_address() 31 | insert(url) 32 | key(enter) 33 | 34 | action(browser.go_blank): 35 | key(ctrl-n) 36 | 37 | action(browser.go_back): 38 | key(alt-left) 39 | 40 | action(browser.go_forward): 41 | key(alt-right) 42 | 43 | action(browser.go_home): 44 | key(alt-home) 45 | 46 | action(browser.open_private_window): 47 | key(ctrl-shift-p) 48 | 49 | action(browser.reload): 50 | key(ctrl-r) 51 | 52 | action(browser.reload_hard): 53 | key(shift-f5) 54 | 55 | #action(browser.reload_hardest): 56 | 57 | action(browser.show_clear_cache): 58 | key(ctrl-shift-delete) 59 | 60 | action(browser.show_downloads): 61 | key(ctrl-j) 62 | 63 | #action(browser.show_extensions) 64 | 65 | action(browser.show_history): 66 | key(ctrl-h) 67 | 68 | action(browser.submit_form): 69 | key(enter) 70 | 71 | #action(browser.title) 72 | 73 | action(browser.toggle_dev_tools): 74 | key(ctrl-shift-i) 75 | -------------------------------------------------------------------------------- /apps/file_manager.talon: -------------------------------------------------------------------------------- 1 | tag: file_manager 2 | - 3 | settings(): 4 | # enable if you'd like the picker gui to automatically appear when explorer has focus 5 | user.file_manager_auto_show_pickers = 0 6 | 7 | force title: user.file_manager_refresh_title() 8 | show options: user.file_manager_show_pickers() 9 | hide options: user.file_manager_hide_pickers() 10 | go pictures: user.file_manager_open_user_directory("Pictures") 11 | go downloads: user.file_manager_open_user_directory("Downloads") 12 | go profile: user.file_manager_open_user_directory("") 13 | go docks: user.file_manager_open_user_directory("Documents") 14 | go back: user.file_manager_go_back() 15 | go forward: user.file_manager_go_forward() 16 | daddy: user.file_manager_open_parent() 17 | 18 | ^follow $: user.file_manager_open_directory(number - 1) 19 | ^open $: user.file_manager_open_file(number - 1) 20 | ^(cell | sell | select) folder $: user.file_manager_select_directory(number - 1) 21 | ^(cell | sell | select) file $: user.file_manager_select_file(number - 1) 22 | 23 | #new folder 24 | new folder: user.file_manager_new_folder() 25 | 26 | #show properties 27 | show properties: user.file_manager_show_properties() 28 | 29 | # open terminal at location 30 | terminal here: user.file_manager_terminal_here() 31 | 32 | next folders: user.file_manager_next_folder_page() 33 | previous folders: user.file_manager_previous_folder_page() 34 | 35 | next files: user.file_manager_next_file_page() 36 | previous files: user.file_manager_previous_file_page() 37 | 38 | 39 | -------------------------------------------------------------------------------- /apps/firefox/firefox.linux.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | app: Firefox 3 | app: firefox 4 | - 5 | tag(): browser 6 | tag(): firefox 7 | tag(): tabs 8 | 9 | #action(browser.address): 10 | 11 | action(browser.bookmark): 12 | key(ctrl-d) 13 | 14 | action(browser.bookmark_tabs): 15 | key(ctrl-shift-d) 16 | 17 | action(browser.bookmarks): 18 | key(ctrl-shift-o) 19 | 20 | action(browser.bookmarks_bar): 21 | key(ctrl-b) 22 | 23 | action(browser.focus_address): 24 | key(ctrl-l) 25 | 26 | action(browser.focus_search): 27 | browser.focus_address() 28 | 29 | action(browser.go): 30 | browser.focus_address() 31 | insert(url) 32 | key(enter) 33 | 34 | action(browser.go_blank): 35 | key(ctrl-n) 36 | 37 | action(browser.go_back): 38 | key(alt-left) 39 | 40 | action(browser.go_forward): 41 | key(alt-right) 42 | 43 | action(browser.go_home): 44 | key(alt-home) 45 | 46 | action(browser.open_private_window): 47 | key(ctrl-shift-p) 48 | 49 | action(browser.reload): 50 | key(ctrl-r) 51 | 52 | action(browser.reload_hard): 53 | key(ctrl-shift-r) 54 | 55 | #action(browser.reload_hardest): 56 | 57 | action(browser.show_clear_cache): 58 | key(ctrl-shift-del) 59 | 60 | action(browser.show_downloads): 61 | key(ctrl-shift-y) 62 | 63 | action(browser.show_extensions): 64 | key(ctrl-shift-a) 65 | 66 | action(browser.show_history): 67 | key(ctrl-h) 68 | 69 | action(browser.submit_form): 70 | key(enter) 71 | 72 | #action(browser.title) 73 | 74 | action(browser.toggle_dev_tools): 75 | key(ctrl-shift-i) 76 | -------------------------------------------------------------------------------- /apps/firefox/firefox.mac.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: Firefox 3 | - 4 | tag(): browser 5 | tag(): tabs 6 | 7 | #action(browser.address): 8 | 9 | action(browser.bookmark): 10 | key(cmd-d) 11 | 12 | action(browser.bookmark_tabs): 13 | key(cmd-shift-d) 14 | 15 | action(browser.bookmarks): 16 | key(cmd-alt-b) 17 | 18 | #action(browser.bookmarks_bar): 19 | # key(ctrl-shift-b) 20 | 21 | action(browser.focus_address): 22 | key(cmd-l) 23 | 24 | #action(browser.focus_page): 25 | 26 | action(browser.focus_search): 27 | browser.focus_address() 28 | 29 | action(browser.go): 30 | browser.focus_address() 31 | insert(url) 32 | key(enter) 33 | 34 | action(browser.go_blank): 35 | key(cmd-n) 36 | 37 | action(browser.go_back): 38 | key(cmd-left) 39 | 40 | action(browser.go_forward): 41 | key(cmd-right) 42 | 43 | action(browser.go_home): 44 | key(cmd-shift-h) 45 | 46 | action(browser.open_private_window): 47 | key(ctrl-shift-n) 48 | 49 | action(browser.reload): 50 | key(cmd-r) 51 | 52 | action(browser.reload_hard): 53 | key(cmd-shift-r) 54 | 55 | #action(browser.reload_hardest): 56 | 57 | action(browser.show_clear_cache): 58 | key(cmd-shift-delete) 59 | 60 | action(browser.show_downloads): 61 | key(cmd-shift-j) 62 | 63 | action(browser.show_extensions): 64 | key(ctrl-shift-a) 65 | 66 | action(browser.show_history): 67 | key(cmd-y) 68 | 69 | action(browser.submit_form): 70 | key(enter) 71 | 72 | #action(browser.title) 73 | 74 | action(browser.toggle_dev_tools): 75 | key(cmd-alt-i) 76 | -------------------------------------------------------------------------------- /apps/firefox/firefox.win.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | app: Firefox 3 | app: firefox.exe 4 | - 5 | tag(): browser 6 | tag(): tabs 7 | 8 | #action(browser.address): 9 | 10 | action(browser.bookmark): 11 | key(ctrl-d) 12 | 13 | action(browser.bookmark_tabs): 14 | key(ctrl-shift-d) 15 | 16 | action(browser.bookmarks): 17 | key(ctrl-shift-b) 18 | 19 | #action(browser.bookmarks_bar): 20 | # key(ctrl-shift-b) 21 | 22 | action(browser.focus_address): 23 | key(ctrl-l) 24 | 25 | #action(browser.focus_page): 26 | 27 | action(browser.focus_search): 28 | browser.focus_address() 29 | 30 | action(browser.go): 31 | browser.focus_address() 32 | insert(url) 33 | key(enter) 34 | 35 | action(browser.go_blank): 36 | key(ctrl-n) 37 | 38 | action(browser.go_back): 39 | key(alt-left) 40 | 41 | action(browser.go_forward): 42 | key(alt-right) 43 | 44 | action(browser.go_home): 45 | key(alt-home) 46 | 47 | action(browser.open_private_window): 48 | key(ctrl-shift-p) 49 | 50 | action(browser.reload): 51 | key(ctrl-r) 52 | 53 | action(browser.reload_hard): 54 | key(ctrl-shift-r) 55 | 56 | #action(browser.reload_hardest): 57 | 58 | action(browser.show_clear_cache): 59 | key(ctrl-shift-del) 60 | 61 | action(browser.show_downloads): 62 | key(ctrl-j) 63 | 64 | action(browser.show_extensions): 65 | key(ctrl-shift-a) 66 | 67 | action(browser.show_history): 68 | key(ctrl-h) 69 | 70 | action(browser.submit_form): 71 | key(enter) 72 | 73 | #action(browser.title) 74 | 75 | action(browser.toggle_dev_tools): 76 | key(ctrl-shift-i) 77 | -------------------------------------------------------------------------------- /apps/generic_browser.talon: -------------------------------------------------------------------------------- 1 | tag: browser 2 | - 3 | (address bar | go address | go url): browser.focus_address() 4 | go home: browser.go_home() 5 | forward: browser.go_forward() 6 | go back[ward]: browser.go_back() 7 | 8 | go private: browser.open_private_window() 9 | 10 | bookmark show: browser.bookmarks() 11 | bookmark bar: browser.bookmarks_bar() 12 | bookmark it: browser.bookmark() 13 | bookmark tabs: browser.bookmark_tabs() 14 | 15 | (refresh | reload) it: browser.reload() 16 | (refresh | reload) it hard: browser.reload_hard() 17 | 18 | show downloads: browser.show_downloads() 19 | show extensions: browser.show_extensions() 20 | show history: browser.show_history() 21 | show cache: browser.show_clear_cache() 22 | 23 | dev tools: browser.toggle_dev_tools() 24 | 25 | #todo - port to apps 26 | # navigating current page 27 | # help: key(?) 28 | # scroll tiny down: key(j) 29 | # scroll tiny up: key(k) 30 | # scroll left: key(h) 31 | # scroll right: key(l) 32 | # scroll (pop | spring): key(z H) 33 | # scroll push: key(z L) 34 | # scroll top: key(gg) 35 | # scroll (bottom | end): key(G) 36 | # (scroll half down | mini page): key(d) 37 | # scroll half up: key(u) 38 | # [open] link: key(f) 39 | # [open] link new: key(F) 40 | # copy link: key(y f) 41 | # copy (address | url): key(escape y y) 42 | # (refresh | reload): browser.reload() 43 | # view source: key(g s) 44 | # insert mode: key(i) 45 | # next frame: key(g f) 46 | # main frame: key(g F) 47 | # navigating to new pages 48 | # (open | go) (url | history): key(o) 49 | # (open | go) (url | history) new: key(O) 50 | # (open | go) bookmark: key(b) 51 | # (open | go) bookmark new: key(B) 52 | # using find 53 | # find mode: key(/) 54 | # next match: key(n) 55 | # previous match: key(N) 56 | # navigating history 57 | # history back: key(H) 58 | # history forward: key(L) 59 | # manipulating tabs 60 | # last visited: key(^) 61 | # dupe tab: key(y t) 62 | # restore: key(X) 63 | # search tabs: key(T) 64 | # move to window: key(W) -------------------------------------------------------------------------------- /apps/jetbrains/jetbrains.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path 3 | import requests 4 | import time 5 | from pathlib import Path 6 | from talon import ctrl, ui, Module, Context, actions, clip 7 | import tempfile 8 | 9 | # Courtesy of https://github.com/anonfunc/talon-user/blob/master/apps/jetbrains.py 10 | 11 | extendCommands = [] 12 | 13 | # Each IDE gets its own port, as otherwise you wouldn't be able 14 | # to run two at the same time and switch between them. 15 | # Note that MPS and IntelliJ ultimate will conflict... 16 | port_mapping = { 17 | "com.jetbrains.intellij": 8653, 18 | "com.jetbrains.intellij-EAP": 8653, 19 | "com.jetbrains.intellij.ce": 8654, 20 | "com.jetbrains.AppCode": 8655, 21 | "com.jetbrains.CLion": 8657, 22 | "com.jetbrains.datagrip": 8664, 23 | "com.jetbrains.goland": 8659, 24 | "com.jetbrains.goland-EAP": 8659, 25 | "com.jetbrains.PhpStorm": 8662, 26 | "com.jetbrains.pycharm": 8658, 27 | "com.jetbrains.rider": 8660, 28 | "com.jetbrains.rubymine": 8661, 29 | "com.jetbrains.WebStorm": 8663, 30 | "com.google.android.studio": 8652, 31 | 32 | "jetbrains-idea": 8653, 33 | "jetbrains-idea-eap": 8653, 34 | "jetbrains-idea-ce": 8654, 35 | "jetbrains-appcode": 8655, 36 | "jetbrains-clion": 8657, 37 | "jetbrains-datagrip": 8664, 38 | "jetbrains-goland": 8659, 39 | "jetbrains-goland-eap": 8659, 40 | "jetbrains-phpstorm": 8662, 41 | "jetbrains-pycharm": 8658, 42 | "jetbrains-pycharm-ce": 8658, 43 | "jetbrains-rider": 8660, 44 | "jetbrains-rubymine": 8661, 45 | "jetbrains-studio": 8652, 46 | "jetbrains-webstorm": 8663, 47 | "google-android-studio": 8652, 48 | "IntelliJ IDEA": 8653, 49 | "idea64.exe": 8653, 50 | "PyCharm": 8658, 51 | "pycharm64.exe": 8658, 52 | "webstorm64.exe": 8663 53 | } 54 | 55 | select_verbs_map = { 56 | "select": [], 57 | "copy": ["action EditorCopy"], 58 | "cut": ["action EditorCut"], 59 | "clear": ["action EditorBackSpace"], 60 | "comment": ["action CommentByLineComment"], 61 | "replace": ["action EditorPaste"], 62 | "expand": ["action ExpandRegion"], 63 | "collapse": ["action CollapseRegion"], 64 | "refactor": ["action Refactorings.QuickListPopupAction"], 65 | "rename": ["action RenameElement"], 66 | "indent": ["action EditorIndentLineOrSelection"], 67 | "unindent": ["action EditorUnindentSelection"], 68 | } 69 | 70 | 71 | movement_verbs_map = { 72 | "go": [], 73 | "fix": ["action ShowIntentionActions"], 74 | "paste": ["action EditorPaste"], 75 | } 76 | 77 | 78 | def set_extend(*commands): 79 | def set_inner(_): 80 | global extendCommands 81 | extendCommands = commands 82 | 83 | return set_inner 84 | 85 | 86 | def _get_nonce(port, file_prefix): 87 | file_name = file_prefix + str(port) 88 | try: 89 | with open(os.path.join(tempfile.gettempdir(), file_name), "r") as fh: 90 | return fh.read() 91 | except FileNotFoundError as e: 92 | try: 93 | home = str(Path.home()) 94 | with open(os.path.join(home, file_name), "r") as fh: 95 | return fh.read() 96 | except FileNotFoundError as eb: 97 | print(f"Could not find {file_name} in tmp or home") 98 | return None 99 | except IOError as e: 100 | print(e) 101 | return None 102 | 103 | 104 | def send_idea_command(cmd): 105 | print("Sending {}".format(cmd)) 106 | active_app = ui.active_app() 107 | bundle = active_app.bundle or active_app.name 108 | port = port_mapping.get(bundle, None) 109 | nonce = _get_nonce(port, '.vcidea_') or _get_nonce(port, 'vcidea_') 110 | print(f"sending {bundle} {port} {nonce}") 111 | if port and nonce: 112 | response = requests.get( 113 | "http://localhost:{}/{}/{}".format(port, nonce, cmd), timeout=(0.05, 3.05) 114 | ) 115 | response.raise_for_status() 116 | return response.text 117 | 118 | 119 | def get_idea_location(): 120 | return send_idea_command("location").split() 121 | 122 | 123 | def idea_commands(commands): 124 | command_list = commands.split(",") 125 | print("executing jetbrains", commands) 126 | global extendCommands 127 | extendCommands = command_list 128 | for cmd in command_list: 129 | if cmd: 130 | send_idea_command(cmd.strip()) 131 | time.sleep(0.1) 132 | 133 | 134 | ctx = Context() 135 | mod = Module() 136 | 137 | mod.list('select_verbs', desc='Verbs for selecting in the IDE') 138 | mod.list('movement_verbs', desc='Verbs for navigating the IDE') 139 | 140 | 141 | @mod.capture 142 | def select_verbs(m) -> list: 143 | """Returns a list of verbs""" 144 | 145 | 146 | @mod.capture 147 | def movement_verbs(m) -> list: 148 | """Returns a list of verbs""" 149 | 150 | 151 | @mod.action_class 152 | class Actions: 153 | def idea(commands: str): 154 | """Send a command to Jetbrains product""" 155 | idea_commands(commands) 156 | 157 | def idea_select(select_verb: str, commands: str): 158 | """Do a select command, then the specified commands""" 159 | command_list = ','.join(commands.split(",") + select_verbs_map[select_verb]) 160 | print(command_list) 161 | idea_commands(command_list) 162 | 163 | def idea_movement(movement_verb: str, commands: str): 164 | """Do a select movement, then the specified commands""" 165 | command_list = ','.join(commands.split(",") + movement_verbs_map[movement_verb]) 166 | print(command_list) 167 | idea_commands(command_list) 168 | 169 | def idea_grab(times: str = "1"): 170 | """Copies specified number of words to the left""" 171 | old_clip = clip.get() 172 | try: 173 | original_line, original_column = get_idea_location() 174 | for _ in range(int(times)): 175 | send_idea_command("action EditorSelectWord") 176 | send_idea_command("action EditorCopy") 177 | send_idea_command("goto {} {}".format(original_line, original_column)) 178 | send_idea_command("action EditorPaste") 179 | finally: 180 | clip.set(old_clip) 181 | global extendCommands 182 | extendCommands = [] 183 | 184 | def extend_action(number: str): 185 | """Repeat previous actions up to number of times""" 186 | global extendCommands 187 | count = max(int(number), 1) 188 | for _ in range(count): 189 | for cmd in extendCommands: 190 | send_idea_command(cmd) 191 | 192 | def set_extended_actions(commands: str): 193 | """Adds specified commands to the list of commands to repeat""" 194 | set_extend(commands.split(",")) 195 | 196 | 197 | @ctx.capture(rule='{self.select_verbs}') 198 | def select_verbs(m): 199 | return m.select_verbs 200 | 201 | 202 | @ctx.capture(rule='{self.movement_verbs}') 203 | def movement_verbs(m): 204 | print(m) 205 | return m.movement_verbs 206 | 207 | 208 | ctx.lists['self.select_verbs'] = select_verbs_map.keys() 209 | ctx.lists['self.movement_verbs'] = movement_verbs_map.keys() 210 | -------------------------------------------------------------------------------- /apps/kubectl/kubectl.py: -------------------------------------------------------------------------------- 1 | from talon import Module 2 | 3 | mod = Module() 4 | 5 | kubectl = "kubectl" 6 | 7 | @mod.action_class 8 | class Actions: 9 | """Map the first level CLI for kubernetes ``kubectl --help``""" 10 | 11 | def kubectl() -> str: 12 | """Root command for kubernetes CLI""" 13 | return kubectl 14 | 15 | # Basic Commands (Beginner): 16 | 17 | def kubectl_create() -> str: 18 | """Create a resource from a file or from stdin.""" 19 | return f"{kubectl} create " 20 | 21 | def kubectl_expose() -> str: 22 | """Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service""" 23 | return f"{kubectl} expose " 24 | 25 | def kubectl_run() -> str: 26 | """Run a particular image on the cluster""" 27 | return f"{kubectl} run " 28 | 29 | def kubectl_set() -> str: 30 | """Set specific features on objects""" 31 | return f"{kubectl} set " 32 | 33 | 34 | # Basic Commands (Intermediate): 35 | 36 | def kubectl_explain() -> str: 37 | """Documentation of resources""" 38 | return f"{kubectl} explain " 39 | 40 | def kubectl_get() -> str: 41 | """Display one or many resources""" 42 | return f"{kubectl} get " 43 | 44 | def kubectl_edit() -> str: 45 | """Edit a resource on the server""" 46 | return f"{kubectl} edit " 47 | 48 | def kubectl_delete() -> str: 49 | """Delete resources by filenames, stdin, resources and names, or by resources and label selector""" 50 | return f"{kubectl} delete " 51 | 52 | 53 | # Deploy Commands: 54 | 55 | def kubectl_rollout() -> str: 56 | """Manage the rollout of a resource""" 57 | return f"{kubectl} rollout " 58 | 59 | def kubectl_scale() -> str: 60 | """Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job""" 61 | return f"{kubectl} scale " 62 | 63 | def kubectl_autoscale() -> str: 64 | """Auto-scale a Deployment, ReplicaSet, or ReplicationController""" 65 | return f"{kubectl} autoscale " 66 | 67 | 68 | # Cluster Management Commands: 69 | 70 | def kubectl_certificate() -> str: 71 | """Modify certificate resources.""" 72 | return f"{kubectl} certificate " 73 | 74 | def kubectl_cluster_info() -> str: 75 | """Display cluster info""" 76 | return f"{kubectl} cluster-info " 77 | 78 | def kubectl_top() -> str: 79 | """Display Resource (CPU/Memory/Storage) usage.""" 80 | return f"{kubectl} top " 81 | 82 | def kubectl_cordon() -> str: 83 | """Mark node as unschedulable""" 84 | return f"{kubectl} cordon " 85 | 86 | def kubectl_uncordon() -> str: 87 | """Mark node as schedulable""" 88 | return f"{kubectl} uncordon " 89 | 90 | def kubectl_drain() -> str: 91 | """Drain node in preparation for maintenance""" 92 | return f"{kubectl} drain " 93 | 94 | def kubectl_taint() -> str: 95 | """Update the taints on one or more nodes""" 96 | return f"{kubectl} taint " 97 | 98 | 99 | # Troubleshooting and Debugging Commands: 100 | 101 | def kubectl_describe() -> str: 102 | """Show details of a specific resource or group of resources""" 103 | return f"{kubectl} describe " 104 | 105 | def kubectl_logs() -> str: 106 | """Print the logs for a container in a pod""" 107 | return f"{kubectl} logs " 108 | 109 | def kubectl_attach() -> str: 110 | """Attach to a running container""" 111 | return f"{kubectl} attach " 112 | 113 | def kubectl_exec() -> str: 114 | """Execute a command in a container""" 115 | return f"{kubectl} exec " 116 | 117 | def kubectl_port_forward() -> str: 118 | """Forward one or more local ports to a pod""" 119 | return f"{kubectl} port-forward " 120 | 121 | def kubectl_proxy() -> str: 122 | """Run a proxy to the Kubernetes API server""" 123 | return f"{kubectl} proxy " 124 | 125 | def kubectl_cp() -> str: 126 | """Copy files and directories to and from containers.""" 127 | return f"{kubectl} cp " 128 | 129 | def kubectl_auth() -> str: 130 | """Inspect authorization""" 131 | return f"{kubectl} auth " 132 | 133 | 134 | # Advanced Commands: 135 | 136 | def kubectl_diff() -> str: 137 | """Diff live version against would-be applied version""" 138 | return f"{kubectl} diff " 139 | 140 | def kubectl_apply() -> str: 141 | """Apply a configuration to a resource by filename or stdin""" 142 | return f"{kubectl} apply " 143 | 144 | def kubectl_patch() -> str: 145 | """Update field(s) of a resource using strategic merge patch""" 146 | return f"{kubectl} patch " 147 | 148 | def kubectl_replace() -> str: 149 | """Replace a resource by filename or stdin""" 150 | return f"{kubectl} replace " 151 | 152 | def kubectl_wait() -> str: 153 | """Experimental: Wait for a specific condition on one or many resources.""" 154 | return f"{kubectl} wait " 155 | 156 | def kubectl_convert() -> str: 157 | """Convert config files between different API versions""" 158 | return f"{kubectl} convert " 159 | 160 | def kubectl_kustomize() -> str: 161 | """Build a kustomization target from a directory or a remote url.""" 162 | return f"{kubectl} kustomize " 163 | 164 | 165 | # Settings Commands: 166 | 167 | def kubectl_label() -> str: 168 | """Update the labels on a resource""" 169 | return f"{kubectl} label " 170 | 171 | def kubectl_annotate() -> str: 172 | """Update the annotations on a resource""" 173 | return f"{kubectl} annotate " 174 | 175 | def kubectl_completion() -> str: 176 | """Output shell completion code for the specified shell (bash or zsh)""" 177 | return f"{kubectl} completion " 178 | 179 | # Other Commands: 180 | 181 | def kubectl_api_resources() -> str: 182 | """Print the supported API resources on the server""" 183 | return f"{kubectl} api-resources " 184 | 185 | def kubectl_api_versions() -> str: 186 | """Print the supported API versions on the server, in the form of 'group/version'""" 187 | return f"{kubectl} api-versions " 188 | 189 | def kubectl_config() -> str: 190 | """Modify kubeconfig files""" 191 | return f"{kubectl} config " 192 | 193 | def kubectl_plugin() -> str: 194 | """Provides utilities for interacting with plugins.""" 195 | return f"{kubectl} plugin " 196 | 197 | def kubectl_version() -> str: 198 | """Print the client and server version information""" 199 | return f"{kubectl} version " 200 | 201 | -------------------------------------------------------------------------------- /apps/kubectl/kubectl.talon: -------------------------------------------------------------------------------- 1 | tag: terminal 2 | - 3 | cube: insert(user.kubectl()) 4 | 5 | cube create: insert(user.kubectl_create()) 6 | cube expose: insert(user.kubectl_expose()) 7 | cube run: insert(user.kubectl_run()) 8 | cube set: insert(user.kubectl_set()) 9 | 10 | cube explain: insert(user.kubectl_explain()) 11 | cube get: insert(user.kubectl_get()) 12 | cube edit: insert(user.kubectl_edit()) 13 | cube delete: insert(user.kubectl_delete()) 14 | 15 | cube rollout: insert(user.kubectl_rollout()) 16 | cube scale: insert(user.kubectl_scale()) 17 | cube auto scale: insert(user.kubectl_autoscale()) 18 | 19 | cube certificate: insert(user.kubectl_certificate()) 20 | cube cluster information: insert(user.kubectl_cluster_info()) 21 | cube top: insert(user.kubectl_top()) 22 | cube cord: insert(user.kubectl_cordon()) 23 | cube uncord: insert(user.kubectl_uncordon()) 24 | cube drain: insert(user.kubectl_drain()) 25 | cube taint: insert(user.kubectl_taint()) 26 | 27 | cube describe: insert(user.kubectl_describe()) 28 | cube logs: insert(user.kubectl_logs()) 29 | cube attach: insert(user.kubectl_attach()) 30 | cube exec: insert(user.kubectl_exec()) 31 | cube port forward: insert(user.kubectl_port_forward()) 32 | cube proxy: insert(user.kubectl_proxy()) 33 | cube copy: insert(user.kubectl_cp()) 34 | cube auth: insert(user.kubectl_auth()) 35 | 36 | cube diff: insert(user.kubectl_diff()) 37 | cube apply: insert(user.kubectl_apply()) 38 | cube patch: insert(user.kubectl_patch()) 39 | cube replace: insert(user.kubectl_replace()) 40 | cube wait: insert(user.kubectl_wait()) 41 | cube convert: insert(user.kubectl_convert()) 42 | cube customize: insert(user.kubectl_kustomize()) 43 | 44 | cube label: insert(user.kubectl_label()) 45 | cube annotate: insert(user.kubectl_annotate()) 46 | cube completion: insert(user.kubectl_completion()) 47 | 48 | cube interface resources: insert(user.kubectl_api_resources()) 49 | cube interface versions: insert(user.kubectl_api_versions()) 50 | cube config: insert(user.kubectl_config()) 51 | cube plugin: insert(user.kubectl_plugin()) 52 | cube version: insert(user.kubectl_version()) 53 | -------------------------------------------------------------------------------- /apps/linux/dunst.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | - 3 | 4 | show notifications: key(ctrl-`) 5 | dismiss [notifications]: key(ctrl-space) 6 | dismiss all [notifications]: key(ctrl-shift-space) 7 | #dunce pause: user.system_command('notify-send "DUNST_COMMAND_PAUSE"') 8 | #dunce resume: user.system_command('notify-send "DUNST_COMMAND_RESUME"') 9 | #test notification: user.system_command('notify-send "Hello from Talon"') 10 | -------------------------------------------------------------------------------- /apps/linux/gdb.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | # XXX - this matches .gdb files atm 3 | #win.title: /gdb/ 4 | tag: terminal 5 | mode: user.gdb 6 | - 7 | tag(): gdb 8 | 9 | # information 10 | list [source]: "list\n" 11 | info source: "info source\n" 12 | 13 | print: "p " 14 | print [variable] : "p {text}" 15 | print hex: "p/x " 16 | print hex [variable] : "p/x {text}" 17 | print string: "p/s " 18 | 19 | # hexdumping 20 | # XXX - switch the sizes to a list in python? 21 | # XXX - should cache the last used size 22 | hex dump bytes: "x/{number}bx " 23 | hex dump (half|short) words: "x/{number}hx " 24 | hex dump (d|long) words: "x/{number}dx " 25 | hex dump quad words: "x/{number}gx " 26 | # this is some arbitrary default for convenience 27 | hex dump: "x/100gx " 28 | hex dump highlighted: 29 | insert("x/100gx ") 30 | edit.copy() 31 | edit.paste() 32 | key(enter) 33 | hex dump clipboard: 34 | insert("x/100gx ") 35 | edit.paste() 36 | key(enter) 37 | 38 | ### Breakpoints ### 39 | 40 | # enable 41 | (list|show|info) breakpoints: "info breakpoints\n" 42 | break [point] [on]: "break " 43 | break [point] here: "break\n" 44 | enable all break points: "enable br\n" 45 | enable break [point] : "enable br {number}\n" 46 | break [on] clipboard: 47 | insert("break ") 48 | key(ctrl-shift-v) 49 | key(enter) 50 | 51 | # disable 52 | disable all break points: "disable br\n" 53 | disable break [point] : "disable br {number}\n" 54 | 55 | # delete 56 | delete all break points: "d br\n" 57 | force delete all break points: 58 | insert("d br\n") 59 | insert("y\n") 60 | delete break [point] : "d br {number}" 61 | 62 | until : "until {number}" 63 | finish [function]: "finish\n" 64 | 65 | # registers 66 | (list|show|info) registers: "info registers\n" 67 | 68 | # execution 69 | (rerun|run): "run\n" 70 | source: "source \t\t" 71 | 72 | # stepping 73 | step [instruction|line]: "stepi\n" 74 | (step over|next) line: "next\n" 75 | (step over|next) instruction: "nexti\n" 76 | 77 | # displays 78 | # XXX - move thee invoke command into a python script 79 | (list|show|info) display: "info display\n" 80 | display assembly line$: "display /i $pc\n" 81 | display source: "display " 82 | enable display : "enable display {number}\n" 83 | disable display : "disable display {number}\n" 84 | undisplay: "undisplay\n" 85 | 86 | # variables 87 | (list|show|info) local: "info local " 88 | (list|show|info) local typed: "info local -t " 89 | (list|show|info) variable: "info variable " 90 | (list|show|info) variable typed: "info variable -t " 91 | (list|show|info) locals: "info local\n" 92 | (list|show|info) variables: "info variables\n" 93 | 94 | # threads 95 | info threads: "info threads\n" 96 | 97 | restart [program]: "r\n" 98 | continue: "c\n" 99 | back trace: "bt\n" 100 | quit: "quit\n" 101 | # more quickly quit when there are inferiors 102 | force quit: "quit\ny\n" 103 | (show|info) (inf|inferiors): "info inferiors\n" 104 | inferior $: "inferior {number}\n" 105 | inferior: "inferior " 106 | resume main (inf|inferior): 107 | insert("inferior 1\n") 108 | insert("c\n") 109 | resume [from] (inf|inferior) $: 110 | insert("inferior {number}\n") 111 | insert("c\n") 112 | 113 | # arguments 114 | set args: "set args " 115 | 116 | # settings 117 | show follow (fork|forks) [mode]: "show follow-fork-mode\n" 118 | [set] follow (fork|forks) [mode] child: "set follow-fork-mode child\n" 119 | [set] follow (fork|forks) [mode] parent: "set follow-fork-mode parent\n" 120 | 121 | show detach on fork: "show detach-on-fork\n" 122 | set detach on fork: "set detach-on-fork on\n" 123 | unset detach on fork: "set detach-on-fork off\n" 124 | 125 | # list 126 | show list size: "show listsize\n" 127 | set list size : "set listsize {number}\n" 128 | 129 | # misc 130 | clear screen: "shell clear\n" 131 | -------------------------------------------------------------------------------- /apps/linux/keepassx.talon: -------------------------------------------------------------------------------- 1 | app: KeePassX2 2 | app: KeePassXC 3 | app: Keepassx2 4 | app: keepassx2 5 | app: keepassxc 6 | app: Keepassxc 7 | - 8 | 9 | # Database 10 | open database: key(ctrl-o) 11 | save database: key(ctrl-s) 12 | close database: key(ctrl-w) 13 | lock database: key(ctrl-l) 14 | quit: key(ctrl-q) 15 | 16 | # Entries 17 | [add] new entry: key(ctrl-n) 18 | clone entry: key(ctrl-k) 19 | (view|edit) entry: key(ctrl-e) 20 | delete entry: key(ctrl-d) 21 | copy user [name]: key(ctrl-b) 22 | copy password: key(ctrl-c) 23 | open (earl|url|link): key(ctrl-u) 24 | copy (earl|url|link): key(ctrl-alt-u) 25 | find: key(ctrl-f) 26 | find : 27 | key(ctrl-f) 28 | insert("{text}") 29 | -------------------------------------------------------------------------------- /apps/linux/signal.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | app: signal 3 | app: Signal 4 | - 5 | show shortcuts: key("ctrl-/") 6 | 7 | # Note that the order below matches Keyboard Shortcuts listings 8 | 9 | # Navigation 10 | (next|nav|navigate) [by] (sec|section): key("ctrl-t") 11 | (prev|previous) (chat|conversation): key("alt-down") 12 | next (chat|conversation): key("alt-up") 13 | (prev|previous) unread: key("alt-shift-down") 14 | next unread: key("alt-shift-up") 15 | [open] (pref|preferences): key("ctrl-,") 16 | open conversation menu: key("ctrl-shift-l") 17 | search: key("ctrl-f") 18 | search chat: key("ctrl-shift-f") 19 | focus (chat|composer): key("ctrl-shift-t") 20 | open media: key("ctrl-shift-m") 21 | open emoji: key("ctrl-shift-j") 22 | open sticker: key("ctrl-shift-s") 23 | record [voice] message: key("ctrl-shift-v") 24 | archive chat: key("ctrl-shift-a") 25 | unarchive chat: key("ctrl-shift-u") 26 | (first|top) message: key("ctrl-up") 27 | (last|bottom) message: key("ctrl-down") 28 | close chat: key("ctrl-shift-c") 29 | 30 | # Messages 31 | send it: key("enter") 32 | message details: key("ctrl-d") 33 | reply [message]: key("ctrl-shift-r") 34 | react [message]: key("ctrl-shift-e") 35 | save attachment: key("ctrl-s") 36 | delete [message]: key("ctrl-shift-d") 37 | 38 | # Composer 39 | send message: key("ctrl-enter") 40 | expand chat: key("ctrl-shift-x") 41 | attach [file]: key("ctrl-u") 42 | remove [link] preview: key("ctrl-p") 43 | remove [link] attachment: key("ctrl-shift-p") 44 | 45 | -------------------------------------------------------------------------------- /apps/linux/taskwarrior.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | tag: terminal 3 | - 4 | 5 | # general 6 | task version: "task --version\n" 7 | task commands: "task commands\n" 8 | task help: "task help\n" 9 | 10 | # task list 11 | task list: "task list\n" 12 | task list orphans: "task project: list\n" 13 | task list untagged: "task tags.none: list\n" 14 | task list : "task list {text}\n" 15 | task list project: "task list project: " 16 | task list project : "task list project:{text}\n" 17 | 18 | # task add 19 | task add: "task add " 20 | task add : "task add {text}\n" 21 | task undo: "task undo\n" 22 | 23 | (tasks|task next): "task next\n" 24 | 25 | # task editing 26 | task edit$: "task {number} edit" 27 | 28 | # task completion 29 | task done$: "task {number} done" 30 | task delete$: "task {number} delete" 31 | -------------------------------------------------------------------------------- /apps/linux/terminal.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | tag: terminal 3 | - 4 | tag(): file_manager 5 | action(edit.page_down): 6 | key(shift-pagedown) 7 | action(edit.page_up): 8 | key(shift-pageup) 9 | action(edit.paste): 10 | key(ctrl-shift-v) 11 | action(edit.copy): 12 | key(ctrl-shift-c) 13 | 14 | scroll up: 15 | key(shift-pageup) 16 | scroll down: 17 | key(shift-pagedown) 18 | run last: 19 | key(up) 20 | key(enter) 21 | rerun : 22 | key(ctrl-r) 23 | insert(text) 24 | rerun search: 25 | key(ctrl-r) 26 | kill all: 27 | key(ctrl-c) 28 | 29 | # XXX - these are specific to certain terminals only and should move into their 30 | # own .talon file 31 | action(edit.find): 32 | key(ctrl-shift-f) 33 | action(edit.word_left): 34 | key(ctrl-w-left) 35 | action(edit.word_right): 36 | key(ctrl-w-right) 37 | action(app.tab_open): 38 | key(ctrl-shift-t) 39 | action(app.tab_close): 40 | key(ctrl-shift-w) 41 | action(app.tab_next): 42 | key(ctrl-pagedown) 43 | action(app.tab_previous): 44 | key(ctrl-pageup) 45 | action(app.window_open): 46 | key(ctrl-shift-n) 47 | go tab : 48 | key("alt-{number}") 49 | -------------------------------------------------------------------------------- /apps/linux/termite.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | app: /termite/ 3 | not win.title: /VIM/ 4 | - 5 | tag(): terminal 6 | 7 | # Selection mode 8 | shell yank: key("y") 9 | shell select: key("ctrl-shift-space") 10 | shell insert: key("escape") 11 | visual line: key("v") 12 | visual line mode: key("V") 13 | -------------------------------------------------------------------------------- /apps/linux/tmux.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | tag: tmux 3 | - 4 | mux: "tmux " 5 | 6 | #session management 7 | mux new session: 8 | insert('tmux new ') 9 | mux sessions: 10 | key(ctrl-b) 11 | key(s) 12 | mux name session: 13 | key(ctrl-b) 14 | key($) 15 | mux kill session: 16 | insert('tmux kill-session -t ') 17 | #window management 18 | mux new window: 19 | key(ctrl-b) 20 | key(c) 21 | mux window : 22 | key(ctrl-b ) 23 | key('{number}') 24 | mux previous window: 25 | key(ctrl-b) 26 | key(p) 27 | mux next window: 28 | key(ctrl-b) 29 | key(n) 30 | mux rename window: 31 | key(ctrl-b) 32 | key(,) 33 | mux close window: 34 | key(ctrl-b) 35 | key(&) 36 | #pane management 37 | mux split horizontal: 38 | key(ctrl-b) 39 | key(%) 40 | mux split vertical: 41 | key(ctrl-b) 42 | key(") 43 | mux next pane: 44 | key(ctrl-b) 45 | key(o) 46 | mux move : 47 | key(ctrl-b) 48 | key(arrow) 49 | mux close pane: 50 | key(ctrl-b) 51 | key(x) 52 | #Say a number right after this command, to switch to pane 53 | mux pane numbers: 54 | key(ctrl-b) 55 | key(q) 56 | -------------------------------------------------------------------------------- /apps/mac/app.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | - 3 | action(app.preferences): 4 | key(cmd-,) 5 | 6 | action(app.tab_close): 7 | key(cmd-w) 8 | 9 | #action(app.tab_detach): 10 | # Move the current tab to a new window 11 | 12 | action(app.tab_next): 13 | key(cmd-alt-right) 14 | 15 | action(app.tab_open): 16 | key(cmd-t) 17 | 18 | action(app.tab_previous): 19 | key(cmd-alt-left) 20 | 21 | action(app.tab_reopen): 22 | key(cmd-shift-t) 23 | 24 | action(app.window_close): 25 | key(cmd-w) 26 | 27 | action(app.window_hide): 28 | key(cmd-m) 29 | 30 | action(app.window_hide_others): 31 | key(cmd-option-h) 32 | 33 | action(app.window_next): 34 | key(cmd-`) 35 | 36 | action(app.window_open): 37 | key(cmd-n) 38 | 39 | action(app.window_previous): 40 | key(cmd-shift-`) 41 | -------------------------------------------------------------------------------- /apps/mac/datagrip.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: DataGrip 3 | 4 | - 5 | run: key(cmd-enter) 6 | run it: 7 | key(cmd-enter) 8 | sleep(50ms) 9 | key(enter) 10 | back: 11 | key(alt-left) 12 | fwack: 13 | key(alt-right) 14 | erase: 15 | key(alt-backspace) 16 | move up: 17 | key(cmd-shift-up) 18 | move down: 19 | key(cmd-shift-down) 20 | -------------------------------------------------------------------------------- /apps/mac/edit.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | - 3 | action(edit.copy): 4 | key(cmd-c) 5 | 6 | action(edit.cut): 7 | key(cmd-x) 8 | 9 | action(edit.delete): 10 | key(backspace) 11 | 12 | action(edit.delete_line): 13 | edit.select_line() 14 | edit.delete() 15 | 16 | #action(edit.delete_paragraph): 17 | 18 | #action(edit.delete_sentence): 19 | 20 | action(edit.delete_word): 21 | actions.edit.select_word() 22 | actions.edit.delete() 23 | 24 | action(edit.down): 25 | key(down) 26 | 27 | #action(edit.extend_again): 28 | 29 | #action(edit.extend_column): 30 | 31 | action(edit.extend_down): 32 | key(shift-down) 33 | 34 | action(edit.extend_file_end): 35 | key(shift-ctrl-end) 36 | 37 | action(edit.extend_file_start): 38 | key(cmd-shift-up) 39 | 40 | action(edit.extend_left): 41 | key(shift-left) 42 | 43 | #action(edit.extend_line): 44 | 45 | action(edit.extend_line_down): 46 | key(shift-down cmd-shift-right) 47 | 48 | action(edit.extend_line_end): 49 | key(cmd-shift-right) 50 | 51 | action(edit.extend_line_start): 52 | key(cmd-shift-left) 53 | 54 | action(edit.extend_line_up): 55 | key(shift-up cmd-shift-left) 56 | 57 | action(edit.extend_page_down): 58 | key(cmd-shift-pagedown) 59 | 60 | action(edit.extend_page_up): 61 | key(cmd-shift-pageup) 62 | 63 | #action(edit.extend_paragraph_end): 64 | #action(edit.extend_paragraph_next()): 65 | #action(edit.extend_paragraph_previous()): 66 | #action(edit.extend_paragraph_start()): 67 | 68 | action(edit.extend_right): 69 | key(shift-right) 70 | 71 | #action(edit.extend_sentence_end): 72 | #action(edit.extend_sentence_next): 73 | #action(edit.extend_sentence_previous): 74 | #action(edit.extend_sentence_start): 75 | 76 | action(edit.extend_up): 77 | key(shift-up) 78 | 79 | action(edit.extend_word_left): 80 | key(shift-alt-left) 81 | 82 | action(edit.extend_word_right): 83 | key(shift-alt-right) 84 | 85 | action(edit.file_end): 86 | key(cmd-down cmd-left) 87 | 88 | action(edit.file_start): 89 | key(cmd-up cmd-left) 90 | 91 | action(edit.find): 92 | key(cmd-f) 93 | #actions.insert(text) 94 | 95 | action(edit.find_next): 96 | key(cmd-g) 97 | 98 | action(edit.find_previous): 99 | key(cmd-shift-g) 100 | 101 | action(edit.indent_less): 102 | key(cmd-left delete) 103 | 104 | action(edit.indent_more): 105 | key(cmd-left tab) 106 | 107 | #action(edit.jump_column(n: int) 108 | #action(edit.jump_line(n: int) 109 | 110 | action(edit.left): 111 | key(left) 112 | 113 | action(edit.line_down): 114 | key(down home) 115 | 116 | action(edit.line_end): 117 | key(cmd-right) 118 | 119 | action(edit.line_insert_down): 120 | key(end enter) 121 | 122 | action(edit.line_insert_up): 123 | key(cmd-left enter up) 124 | 125 | action(edit.line_start): 126 | key(cmd-left) 127 | 128 | action(edit.line_up): 129 | key(up cmd-left) 130 | 131 | #action(edit.move_again): 132 | 133 | action(edit.page_down): 134 | key(pagedown) 135 | 136 | action(edit.page_up): 137 | key(pageup) 138 | 139 | #action(edit.paragraph_end): 140 | #action(edit.paragraph_next): 141 | #action(edit.paragraph_previous): 142 | #action(edit.paragraph_start): 143 | 144 | action(edit.paste): 145 | key(cmd-v) 146 | 147 | action(edit.paste_match_style): 148 | key(cmd-alt-shift-v) 149 | 150 | action(edit.print): 151 | key(cmd-p) 152 | 153 | action(edit.redo): 154 | key(cmd-shift-z) 155 | 156 | action(edit.right): 157 | key(right) 158 | 159 | action(edit.save): 160 | key(cmd-s) 161 | 162 | action(edit.save_all): 163 | key(cmd-shift-s) 164 | 165 | action(edit.select_all): 166 | key(cmd-a) 167 | 168 | action(edit.select_line): 169 | key(cmd-right cmd-shift-left) 170 | 171 | #action(edit.select_lines(a: int, b: int)): 172 | 173 | action(edit.select_none): 174 | key(right) 175 | 176 | #action(edit.select_paragraph): 177 | #action(edit.select_sentence): 178 | 179 | action(edit.select_word): 180 | key(left shift-right left alt-left alt-right shift-alt-left) 181 | 182 | #action(edit.selected_text): -> str 183 | #action(edit.sentence_end): 184 | #action(edit.sentence_next): 185 | #action(edit.sentence_previous): 186 | #action(edit.sentence_start): 187 | 188 | action(edit.undo): 189 | key(cmd-z) 190 | 191 | action(edit.up): 192 | key(up) 193 | 194 | action(edit.word_left): 195 | key(alt-left) 196 | 197 | action(edit.word_right): 198 | key(alt-right) 199 | 200 | action(edit.zoom_in): 201 | key(cmd-+) 202 | 203 | action(edit.zoom_out): 204 | key(cmd--) 205 | 206 | action(edit.zoom_reset): 207 | key(cmd-0) 208 | 209 | -------------------------------------------------------------------------------- /apps/mac/finder.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: com.apple.finder 3 | - 4 | tag(): file_manager 5 | 6 | action(user.file_manager_open_parent): 7 | key(cmd-up) 8 | 9 | action(user.file_manager_go_forward): 10 | key("cmd-]") 11 | 12 | action(user.file_manager_go_back): 13 | key("cmd-[") -------------------------------------------------------------------------------- /apps/mac/rstudio.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: RStudio 3 | - 4 | 5 | run that: key("cmd-enter") 6 | run document: key("cmd-alt-r") 7 | run from top: key("cmd-alt-b") 8 | run to end: key("cmd-alt-e") 9 | run (function|funk): key("cmd-alt-f") 10 | run section: key("cmd-alt-t") 11 | run previous chunks: key("cmd-alt-p") 12 | run chunk: key("cmd-alt-c") 13 | run next chunk: key("cmd-alt-n") 14 | run all: key("cmd-shift-s") 15 | run knitter: key("cmd-shift-k") 16 | run profiler: key("cmd-shift-alt-p") 17 | 18 | # Moving around and formatting 19 | jump back: key("cmd-f9") 20 | jump forward: key("cmd-f10") 21 | close all tabs: key("cmd-shift-w") 22 | indent lines: key("cmd-i") 23 | toggle comment: key("cmd-shift-c") 24 | reformat comment: key("cmd-shift-/") 25 | reformat R code: key("cmd-shift-a") 26 | line up: key("alt-up") 27 | line down: key("alt-down") 28 | duplicate line up: key("cmd-alt-up") 29 | duplicate line [down]: key("cmd-alt-down") 30 | select to paren: key("ctrl-shift-e") 31 | select to matching paren: key("ctrl-shift-alt-e") 32 | jump to matching: key("ctrl-p") 33 | expand selection: key("shift-alt-cmd-up") 34 | reduce selection: key("shift-alt-cmd-down") 35 | add cursor up: key("ctrl-alt-up") 36 | add cursor down: key("ctrl-alt-down") 37 | move active cursor up: key("ctrl-alt-shift-up") 38 | move active cursor down: key("ctrl-alt-shift-down") 39 | delete line: key("cmd-d") 40 | delete word left: key("alt-backspace") 41 | delete word right: key("alt-delete") 42 | assign that: key("alt--") 43 | pipe that: key("cmd-shift-m") 44 | insert knitter chunk: key("cmd-alt-i") 45 | 46 | # Folding 47 | fold that: key("cmd-alt-l") 48 | unfold that: key("cmd-shift-alt-l") 49 | fold all: key("cmd-alt-o") 50 | unfold all: key("cmd-shift-alt-o") 51 | 52 | # Find and replace 53 | find and replace: key("cmd-f") 54 | find next: key("cmd-g") 55 | find previous: key("cmd-shift-g") 56 | find with selection: key("cmd-e") 57 | find in files: key("cmd-shift-f") 58 | run replace: key("cmd-shift-j") 59 | run spell check: key("f7") 60 | 61 | # Navigation and panels 62 | go to source: key("ctrl-1") 63 | go to console: key("ctrl-2") 64 | go to help: key("ctrl-3") 65 | go to history: key("ctrl-4") 66 | go to files: key("ctrl-5") 67 | go to (plots|plot): key("ctrl-6") 68 | go to packages: key("ctrl-7") 69 | go to environment: key("ctrl-8") 70 | go to git: key("ctrl-9") 71 | go to build: key("ctrl-0") 72 | go to terminal: key("alt-shift-t") 73 | go to omni: key("ctrl-.") 74 | go to line: key("cmd-shift-alt-g") 75 | go to section: key("cmd-shift-alt-j") 76 | go to tab: key("ctrl-shift-.") 77 | go to previous tab: key("ctrl-f11") 78 | go to next tab: key("ctrl-f12") 79 | go to first tab: key("ctrl-shift-f11") 80 | go to last tab: key("ctrl-shift-f12") 81 | 82 | zoom source: key("ctrl-shift-1") 83 | (zoom|show) all: key("ctrl-shift-0") 84 | 85 | help that: key("f1") 86 | define that: key("f2") 87 | previous plot: key("cmd-alt-f11") 88 | next plot: key("cmd-alt-f12") 89 | 90 | # devtools, package development, and session management 91 | restart R session: key("cmd-shift-f10") 92 | dev tools build: key("cmd-shift-b") 93 | dev tools load all: key("cmd-shift-l") 94 | dev tools test: key("cmd-shift-t") 95 | dev tools check: key("cmd-shift-e") 96 | dev tools document: key("cmd-shift-d") 97 | 98 | # Debugging 99 | toggle breakpoint: key("shift-f9") 100 | debug next: key("f10") 101 | debug step into (function|funk): key("shift-f4") 102 | debug finish (function|funk): key("shift-f6") 103 | debug continue: key("shift-f5") 104 | debug stop: key("shift-f8") 105 | 106 | # Git/SVN 107 | run git diff: key("ctrl-alt-d") 108 | run git commit: key("ctrl-alt-m") 109 | 110 | # Other shortcuts that could be enabled 111 | # run line and stay: key("alt-enter") 112 | # run and echo all: key("cmd-shift-enter") 113 | # extract (function|funk): key("cmd-alt-x") 114 | # extract variable: key("cmd-alt-v") 115 | # new terminal: key("shift-alt-t") 116 | # rename current terminal: key("shift-alt-r") 117 | # clear current terminal: key("ctrl-shift-l") 118 | # previous terminal: key("ctrl-alt-f11") 119 | # next terminal: key("ctrl-alt-f12") 120 | # clear console: key("ctrl-l") 121 | # popup history: key("cmd-up") 122 | # change working directory: key("ctrl-shift-h") 123 | # new document: key("cmd-shift-n") 124 | # new document (chrome only): key("cmd-shift-alt-n") 125 | # insert code section: key("cmd-shift-r") 126 | # scroll diff view: key("ctrl-up/down") 127 | # sync editor & pdf preview: key("cmd-f8") 128 | -------------------------------------------------------------------------------- /apps/mac/safari.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: Safari 3 | - 4 | tag(): browser 5 | tag(): tabs 6 | #action(browser.address): 7 | 8 | action(browser.bookmark): 9 | key(cmd-d) 10 | 11 | action(browser.bookmark_tabs): 12 | key(cmd-shift-d) 13 | 14 | action(browser.bookmarks): 15 | key(cmd-alt-b) 16 | 17 | #action(browser.bookmarks_bar): 18 | # key(ctrl-shift-b) 19 | 20 | action(browser.focus_address): 21 | key(cmd-l) 22 | 23 | #action(browser.focus_page): 24 | 25 | action(browser.focus_search): 26 | browser.focus_address() 27 | 28 | action(browser.go): 29 | browser.focus_address() 30 | insert(url) 31 | key(enter) 32 | 33 | action(browser.go_blank): 34 | key(cmd-n) 35 | 36 | action(browser.go_back): 37 | key(cmd-left) 38 | 39 | action(browser.go_forward): 40 | key(cmd-right) 41 | 42 | action(browser.go_home): 43 | key(cmd-shift-h) 44 | 45 | action(browser.open_private_window): 46 | key(cmd-shift-n) 47 | 48 | action(browser.reload): 49 | key(cmd-r) 50 | 51 | action(browser.reload_hard): 52 | key(cmd-shift-r) 53 | 54 | #action(browser.reload_hardest): 55 | 56 | #action(browser.show_clear_cache): 57 | # key(cmd-shift-delete) 58 | 59 | action(browser.show_downloads): 60 | key(cmd-shift-j) 61 | 62 | action(browser.show_extensions): 63 | key(ctrl-shift-a) 64 | 65 | action(browser.show_history): 66 | key(cmd-y) 67 | 68 | action(browser.submit_form): 69 | key(enter) 70 | 71 | #action(browser.title) 72 | 73 | action(browser.toggle_dev_tools): 74 | key(cmd-alt-i) 75 | -------------------------------------------------------------------------------- /apps/mac/terminal.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: Terminal 3 | app: iTerm2 4 | app: com.apple.Terminal 5 | - 6 | tag(): terminal 7 | tag(): file_manager 8 | action(user.file_manager_open_parent): 9 | insert("cd ..") 10 | key(enter) 11 | action(app.tab_open): 12 | key(cmd-t) 13 | action(app.tab_close): 14 | key(cmd-w) 15 | action(app.tab_next): 16 | key(ctrl-tab) 17 | action(app.tab_previous): 18 | key(ctrl-shift-tab) 19 | action(app.window_open): 20 | key(cmd-n) 21 | kill all: 22 | key(ctrl-c) 23 | rerun search: 24 | key(ctrl-r) 25 | run last: 26 | key(up) 27 | key(enter) 28 | action(edit.page_down): 29 | key(command-pagedown) 30 | action(edit.page_up): 31 | key(command-pageup) 32 | suspend: 33 | key(ctrl-z) 34 | resume: 35 | insert("fg") 36 | key(enter) 37 | 38 | -------------------------------------------------------------------------------- /apps/mac/vim.talon: -------------------------------------------------------------------------------- 1 | app: Vim 2 | app: Code 3 | app: /.*/ 4 | and title: /vim/i 5 | 6 | - 7 | delete [around] word: 8 | key(d) 9 | key(a) 10 | key(w) 11 | 12 | change [inner] word: 13 | key(c) 14 | key(i) 15 | key(w) 16 | 17 | change until: 18 | key(d) 19 | key(t) 20 | 21 | delete until: 22 | key(d) 23 | key(t) 24 | 25 | easy [motion] up: 26 | key(,) 27 | key(,) 28 | key(k) 29 | 30 | easy [motion] down: 31 | key(,) 32 | key(,) 33 | key(j) 34 | 35 | delete line: 36 | key(d) 37 | key(d) 38 | 39 | insert line up: 40 | key(m) 41 | key(z) 42 | key(shift-o) 43 | key(escape) 44 | key(`) 45 | key(z) 46 | 47 | insert line down: 48 | key(m) 49 | key(z) 50 | key(o) 51 | key(escape) 52 | sleep(50ms) 53 | key(`) 54 | key(z) 55 | -------------------------------------------------------------------------------- /apps/slack/slack.mac.talon: -------------------------------------------------------------------------------- 1 | os: mac 2 | app: Slack 3 | - 4 | # Workspace 5 | workspace : key("cmd-{number}") 6 | previous workspace: key(cmd-shift-[) 7 | next workspace: key(cmd-shift-]) 8 | # Channel 9 | channel: key(cmd-k) 10 | channel : 11 | key(cmd-k) 12 | insert(user.formatted_text(user.text, "ALL_LOWERCASE")) 13 | ([channel] unread last | gopreev): key(alt-shift-up) 14 | ([channel] unread next | goneck): key(alt-shift-down) 15 | (slack | lack) [channel] info: key(cmd-shift-i) 16 | channel up: key(alt-up) 17 | channel down: key(alt-down) 18 | # Navigation 19 | (move | next) focus: key(ctrl-`) 20 | [next] (section | zone): key(f6) 21 | (previous | last) (section | zone): key(shift-f6) 22 | (slack | lack) [direct] messages: key(cmd-shift-k) 23 | (slack | lack) threads: key(cmd-shift-t) 24 | (slack | lack) (history [next] | back | backward): key(cmd-[) 25 | (slack | lack) forward: key(cmd-]) 26 | [next] (element | bit): key(tab) 27 | (previous | last) (element | bit): key(shift-tab) 28 | (slack | lack) (my stuff | activity): key(cmd-shift-m) 29 | (slack | lack) directory: key(cmd-shift-e) 30 | (slack | lack) (starred [items] | stars): key(cmd-shift-s) 31 | (slack | lack) unread [messages]: key(cmd-j) 32 | (go | undo | toggle) full: key(ctrl-cmd-f) 33 | (slack | lack) (find | search): key(cmd-f) 34 | # Messaging 35 | grab left: key(shift-up) 36 | grab right: key(shift-down) 37 | add line: key(shift-enter) 38 | (slack | lack) (slap | slaw | slapper): key(cmd-right shift-enter) 39 | (slack | lack) (react | reaction): key(cmd-shift-\\) 40 | (insert command | commandify): key(cmd-shift-c) 41 | insert code: 42 | insert("``````") 43 | key(left left left) 44 | key(shift-enter) 45 | key(shift-enter) 46 | key(up) 47 | (slack | lack) (bull | bullet | bulleted) [list]: key(cmd-shift-8) 48 | (slack | lack) (number | numbered) [list]: key(cmd-shift-7) 49 | (slack | lack) (quotes | quotation): key(cmd-shift->) 50 | bold: key(cmd-b) 51 | (italic | italicize): key(cmd-i) 52 | (strike | strikethrough): key(cmd-shift-x) 53 | mark all read: key(shift-esc) 54 | mark channel read: key(esc) 55 | (clear | scrap | scratch): key(cmd-a backspace) 56 | # Files and Snippets 57 | (slack | lack) upload: key(cmd-u) 58 | (slack | lack) snippet: key(cmd-shift-enter) 59 | # Calls 60 | ([toggle] mute | unmute): key(m) 61 | (slack | lack) ([toggle] video): key(v) 62 | (slack | lack) invite: key(a) 63 | # Miscellaneous 64 | (slack | lack) shortcuts: key(cmd-/) 65 | emote : "{text}" 66 | -------------------------------------------------------------------------------- /apps/slack/slack.win.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | os: linux 3 | app: Slack 4 | app: slack.exe 5 | #todo: some sort of plugin, consolidate with teams or something? 6 | - 7 | # Workspaces 8 | workspace : key("ctrl-{number}") 9 | previous workspace: key(ctrl-shift-tab) 10 | next workspace: key(ctrl-tab) 11 | # Channel 12 | channel: key(ctrl-k) 13 | channel : 14 | key(ctrl-k) 15 | insert(user.formatted_text(user.text, "ALL_LOWERCASE")) 16 | ([channel] unread last | gopreev): key(alt-shift-up) 17 | ([channel] unread next | goneck): key(alt-shift-down) 18 | (slack | lack) [channel] info: key(ctrl-shift-i) 19 | channel up: key(alt-up) 20 | channel down: key(alt-down) 21 | # Navigation 22 | (move | next) focus: key(ctrl-`) 23 | [next] (section | zone): key(f6) 24 | (previous | last) (section | zone): key(shift-f6) 25 | (slack | lack) [direct] messages: key(ctrl-shift-k) 26 | (slack | lack) threads: key(ctrl-shift-t) 27 | (slack | lack) (history [next] | back | backward): key(alt-left) 28 | (slack | lack) forward: key(alt-right) 29 | [next] (element | bit): key(tab) 30 | (previous | last) (element | bit): key(shift-tab) 31 | (slack | lack) (my stuff | activity): key(ctrl-shift-m) 32 | (slack | lack) directory: key(ctrl-shift-e) 33 | (slack | lack) (starred [items] | stars): key(ctrl-shift-s) 34 | (slack | lack) unread [messages]: key(ctrl-j) 35 | #(go | undo | toggle) full: key(ctrl-cmd-f) 36 | (slack | lack) (find | search): key(ctrl-f) 37 | # Messaging 38 | grab left: key(shift-up) 39 | grab right: key(shift-down) 40 | add line: key(shift-enter) 41 | #"(slack | lack) (slap | slaw | slapper): [key(cmd-right) key(shift-enter")], 42 | (slack | lack) (react | reaction): key(ctrl-shift-\\) 43 | (insert command | commandify): key(ctrl-shift-c) 44 | insert code: 45 | insert("``````") 46 | key(left left left) 47 | key(shift-enter) 48 | key(shift-enter) 49 | key(up) 50 | (slack | lack) (bull | bullet | bulleted) [list]: key(ctrl-shift-8) 51 | (slack | lack) (number | numbered) [list]: key(ctrl-shift-7) 52 | (slack | lack) (quotes | quotation): key(ctrl-shift-9) 53 | bold: key(ctrl-b) 54 | (italic | italicize): key(ctrl-i) 55 | (strike | strikethrough): key(ctrl-shift-x) 56 | mark all read: key(shift-esc) 57 | mark channel read: key(esc) 58 | (clear | scrap | scratch): key(ctrl-a backspace) 59 | # Files and Snippets 60 | (slack | lack) upload: key(ctrl-u) 61 | (slack | lack) snippet: key(ctrl-shift-enter) 62 | # Calls 63 | ([toggle] mute | unmute): key(m) 64 | (slack | lack) ([toggle] video): key(v) 65 | (slack | lack) invite: key(a) 66 | # Miscellaneous 67 | (slack | lack) shortcuts: key(ctrl-/) 68 | emote : "{text}" 69 | -------------------------------------------------------------------------------- /apps/teams/teams.talon: -------------------------------------------------------------------------------- 1 | os: linux 2 | app: /Teams/ 3 | app: /teams/ 4 | - 5 | 6 | # Shortcut reference 7 | # https://support.office.com/en-us/article/keyboard-shortcuts-for-microsoft-teams-2e8e2a70-e8d8-4a19-949b-4c36dd5292d2 8 | 9 | # generics 10 | show shortcuts: key(ctrl-.) 11 | [go] [to] search: key(ctrl-e) 12 | show commands: key(ctrl-/) 13 | open filter: key(ctrl-shift-f) 14 | go to: key(ctrl-g) 15 | open (apps|applications): key(ctrl-`) 16 | [start] new chat: key(ctrl-n) 17 | open settings: key(ctrl-,) 18 | open help: key(f1) 19 | close: key(escape) 20 | 21 | #zoom in: key(ctrl-=) 22 | #zoom out: key(ctrl--) 23 | #reset zoom: key(ctrl-0) 24 | action(edit.zoom_in): key(ctrl-=) 25 | action(edit.zoom_out): key(ctrl--) 26 | action(edit.zoom_reset): key(ctrl-0) 27 | 28 | # navigations 29 | open activity: key(ctrl-1) 30 | open chat: key(ctrl-2) 31 | open teams: key(ctrl-3) 32 | open calendar: key(ctrl-4) 33 | open planner: key(ctrl-5) 34 | open calls: key(ctrl-6) 35 | open files: key(ctrl-7) 36 | [go] [to] (prev|previous) [list] item: key(alt-up) 37 | [go] [to] next [list] item: key(alt-down) 38 | move [selected] team up: key(ctrl-shift-up) 39 | move [selected] team down: key(ctrl-shift-down) 40 | [go] [to] (prev|previous) section: key(ctrl-shift-f6) 41 | [go] [to] next section: key(ctrl-f6) 42 | 43 | # messaging 44 | [go] [to] compose [box]: key(c) 45 | [expand] compose [box]: key(ctrl-shift-x) 46 | send: key(ctrl-enter) 47 | attach file: key(ctrl-o) 48 | [start] new line: key(shift-enter) 49 | reply [to] [thread]: key(r) 50 | 51 | # Meetings, Calls and Calendar 52 | accept video call: key(ctrl-shift-a) 53 | accept audio call: key(ctrl-shift-s) 54 | decline call: key(ctrl-shift-d) 55 | start audio call: key(ctrl-shift-c) 56 | start video call: key(ctrl-shift-u) 57 | toggle mute: key(ctrl-shift-m) 58 | starch screen share session: key(ctrl-shift-e) 59 | toggle video: key(ctrl-shift-o) 60 | [go] [to] sharing toolbar: key(ctrl-shift-space) 61 | decline screen share: key(ctrl-shift-d) 62 | accept screen share: key(ctrl-shift-a) 63 | schedule [a] meeting: key(alt-shift-n) 64 | go to current time: key(alt-.) 65 | go to (prev|previous) (day|week): key(ctrl-alt-left) 66 | go to next (day|week): key(ctrl-alt-right) 67 | view day: key(ctrl-alt-1) 68 | view work week: key(ctrl-alt-2) 69 | view week: key(ctrl-alt-3) 70 | (safe|send) meeting request: key(ctrl-s) 71 | join [from] meeting [details]: key(alt-shift-j) 72 | go to suggested time: key(alt-shift-s) 73 | -------------------------------------------------------------------------------- /apps/vscode/linux.talon: -------------------------------------------------------------------------------- 1 | # Microsoft - Visual Studio Code 2 | # see app/vscode.talon for custom voice commands 3 | # see ide.talon for common voice commands 4 | os: linux 5 | app: Code 6 | app: Code - OSS 7 | - 8 | tag(): tabs 9 | tag(): ide 10 | tag(): line_commands 11 | # General 12 | action(user.ide_command_palette): 13 | key(ctrl-shift-p) 14 | action(edit.indent_less): 15 | key(ctrl-[) 16 | action(edit.indent_more): 17 | key(ctrl-]) 18 | action(app.tab_next): 19 | key(ctrl-k) 20 | key(ctrl-pagedown) 21 | 22 | action(app.tab_previous): 23 | key(ctrl-k) 24 | key(ctrl-pageup) 25 | 26 | # Toggleable views 27 | action(user.ide_toggle_fullscreen): 28 | user.ide_command_palette() 29 | insert("View: Toggle Full Screen") 30 | key(enter) 31 | #action(user.ide_toggle_distraction_free): user.idea("action ToggleDistractionFreeMode") 32 | #action(user.ide_toggle_presentation_mode): user.idea("action TogglePresentationMode") 33 | 34 | # Folding 35 | action(user.ide_expand_deep): 36 | key(ctrl-k ctrl-]) 37 | action(user.ide_expand_all): 38 | key(ctrl-k ctrl-j) 39 | action(user.ide_expand_region): 40 | key(ctrl-shift-]) 41 | action(user.ide_collapse_deep): 42 | key(ctrl-k ctrl-[) 43 | action(user.ide_collapse_all): 44 | key(ctrl-k ctrl-0) 45 | action(user.ide_collapse_region): 46 | key(ctrl-shift-[) 47 | 48 | # Splits 49 | action(user.ide_split_right): 50 | user.ide_command_palette() 51 | insert("workbench.action.splitEditorRight") 52 | key(enter) 53 | 54 | action(user.ide_split_left): 55 | user.ide_command_palette() 56 | insert("workbench.action.splitEditorLeft") 57 | key(enter) 58 | 59 | action(user.ide_split_up): 60 | user.ide_command_palette() 61 | insert("workbench.action.splitEditorUp") 62 | key(enter) 63 | 64 | action(user.ide_split_down): 65 | user.ide_command_palette() 66 | insert("workbench.action.splitEditorDown") 67 | key(enter) 68 | 69 | action(user.ide_split_flip): key(alt-ctrl-0) 70 | action(user.ide_split_window): key(ctrl-\) 71 | action(user.ide_clear_split): user.ide_clear_all_splits() 72 | action(user.ide_clear_all_splits): 73 | user.ide_command_palette() 74 | insert("View: Single Column Editor Layout") 75 | key(enter) 76 | action(user.ide_go_next_split): key(ctrl-k ctrl-right) 77 | action(user.ide_go_last_split): key(ctrl-k ctrl-left) 78 | 79 | #Refactor 80 | 81 | action(user.ide_refactor): key(ctrl-shift-r) 82 | action(user.ide_refactor_in_line): key(ctrl-shift-r) 83 | action(user.ide_refactor_rename): key(f2) 84 | action(user.ide_rename_file): 85 | user.ide_command_palette() 86 | insert("File: Reveal Active File In Side Bar") 87 | key(enter f2) 88 | action(user.ide_fix_format): 89 | # Format Document 90 | key(alt-shift-f) 91 | # Navigate 92 | action(user.ide_follow): 93 | # Go to Definition 94 | key(f12) 95 | 96 | action(user.ide_go_back): 97 | key(alt-left) 98 | 99 | action(user.ide_go_forward): 100 | key(alt-right) 101 | 102 | action(user.ide_multi_cursor_stop): key(escape) 103 | action(user.ide_up_cursor):key(ctrl-alt-up) 104 | action(user.ide_down_cursor): key(ctrl-alt-down) 105 | action(user.ide_multi_select_more): key(ctrl-d) 106 | action(user.ide_multi_select_all): key(ctrl-shift-l) 107 | 108 | action(user.ide_select_less): key(shift-alt-left) 109 | action(user.ide_select_more): key(shift-alt-right) 110 | 111 | # Terminal 112 | action(user.ide_toggle_terminal): 113 | # View:Toggle Integrated Terminal 114 | key(ctrl-`) 115 | 116 | action(user.ide_terminal_new): 117 | key(ctrl-shift-`) 118 | # Terminal: Created New Integrated Terminal 119 | 120 | action(user.ide_terminal_focus_previous): 121 | key(alt-left) 122 | # Terminal: Focus Previous Pane 123 | 124 | action(user.ide_terminal_focus_next): 125 | key(alt-right) 126 | # Terminal: Focus Next Pane 127 | 128 | action(user.ide_terminal_trash): 129 | key(ctrl-shift-delete) 130 | 131 | action(user.ide_terminal_scroll_down): 132 | key(shift-pgdown) 133 | 134 | action(user.ide_terminal_scroll_up): 135 | key(shift-pgup) 136 | 137 | # Code Editor 138 | action(user.ide_toggle_comment): 139 | key(ctrl-/) 140 | 141 | action(user.ide_smart): 142 | 143 | # Trigger Suggest, editor.action.triggerParameterHints 144 | key(ctrl-space) 145 | 146 | action(user.ide_intellisense_suggest_parameters): 147 | # Trigger Parameter Hints, editor.action.triggerParameterHints 148 | key(ctrl-shift-space) 149 | 150 | action(user.ide_done): 151 | key(tab) 152 | 153 | # Editing 154 | action(user.ide_editor_copylines_down): 155 | # Copy Line Down, editor.action.copyLinesDownAction 156 | key(shift-alt-down) 157 | 158 | action(user.ide_editor_copylines_up): 159 | # Copy Line Up, editor.action.copyLinesUpAction 160 | key(shift-alt-up) 161 | 162 | # Workbench Focus Areas 163 | action(user.ide_toggle_project): 164 | #FIX works manually with caplock on ctrl-shift-E typed works but not key(ctrl-shift-E) - Linux Mint 19 (Vagrant VirtualBox), 165 | #key(ctrl-shift-E) 166 | user.ide_command_palette() 167 | # View: Show Explorer, workbench.view.explorer 168 | insert("workbench.files.action.focusFilesExplorer") 169 | key(enter) 170 | 171 | action(user.ide_toggle_git): 172 | # View: Show SCM, workbench.view.scm 173 | key(ctrl-shift-g) 174 | 175 | action(user.ide_toggle_extensions): 176 | # View: Show Extensions, workbench.view.extensions 177 | key(ctrl-shift-x) 178 | 179 | action(user.ide_toggle_status_bar): 180 | user.ide_command_palette() 181 | insert("View: Toggle Status Bar Visibility") 182 | key(enter) 183 | 184 | action(user.ide_toggle_run): 185 | # View: Show Run and Debug, workbench.view.debug 186 | key(ctrl-shift-d) 187 | action(user.ide_toggle_debug): 188 | # View: Show Run and Debug, workbench.view.debug 189 | key(ctrl-shift-d) 190 | 191 | # Find and Replace 192 | action(user.ide_toggle_find): 193 | # Search: Find in Files, workbench.action.findInFiles 194 | key(ctrl-shift-f) 195 | action(user.ide_find_everywhere): 196 | # Search: Find in Files, workbench.action.findInFiles 197 | key(ctrl-shift-f) 198 | action(user.ide_replace_everywhere): 199 | # Search: Replace in Files, workbench.action.replaceInFiles 200 | key(ctrl-shift-h) 201 | 202 | action(user.ide_replace_local): 203 | # Replace, editor.action.startFindReplaceAction 204 | key(ctrl-h) 205 | action(user.ide_replace_confirm_current): 206 | # ,editor.action.replaceOne 207 | key(ctrl-shift-1) 208 | action(user.ide_replace_confirm_all): 209 | # ,editor.action.replaceAll 210 | key(ctrl-alt-enter) 211 | 212 | action(user.ide_find_match_by_case): 213 | # Terminal: Toggle Find Using Case Sensitive, workbench.action.terminal.toggleFindCaseSensitive 214 | key(alt-c) 215 | action(user.ide_find_match_by_word): 216 | # Terminal: Toggle Find Using Whole Word, toggleFindWholeWord 217 | key(alt-w) 218 | action(user.ide_find_match_by_regex): 219 | # Terminal: Toggle Find Using Regex, workbench.action.terminal.toggleFindRegex 220 | key(alt-r) 221 | 222 | 223 | 224 | action(user.ide_toggle_breakpoint): 225 | # Debug: Toggle Breakpoint, editor.debug.action.toggleBreakpoint 226 | key(f9) 227 | action(user.ide_step_over): 228 | # Debug: Step Over, workbench.action.debug.stepOver 229 | key(f10) 230 | action(user.ide_step_into): 231 | # Debug: Step Into, workbench.action.debug.stepInto 232 | key(f11) 233 | action(user.ide_step_out): 234 | # Debug: Step Out, workbench.action.debug.stepOut 235 | key(shift-f11) 236 | 237 | # Window and File Management 238 | action(app.window_open): 239 | # New Window, workbench.action.newWindow 240 | key(ctrl-shift-n) 241 | 242 | action(user.ide_create_sibling): 243 | user.ide_command_palette() 244 | insert("File: New File") 245 | key(enter) 246 | 247 | action(user.ide_create_file): 248 | # File: New and Titled File, workbench.action.files.newUntitledFile 249 | key(ctrl-n) 250 | 251 | action(user.ide_reveal_in_file_manager): 252 | # , workbench.action.files.revealActiveFileInWindows 253 | key(ctrl-k r) 254 | 255 | action(user.ide_find_file): 256 | # Go to File... , workbench.action.quickOpen 257 | key(ctrl-p) 258 | 259 | #tabs 260 | action(user.ide_go_first_tab): key(alt-1) 261 | action(user.ide_go_second_tab): key(alt-2) 262 | action(user.ide_go_third_tab): key(alt-3) 263 | action(user.ide_go_fourth_tab): key(alt-4) 264 | action(user.ide_go_fifth_tab): key(alt-5) 265 | action(user.ide_go_sixth_tab): key(alt-6) 266 | action(user.ide_go_seventh_tab): key(alt-7) 267 | action(user.ide_go_eighth_tab): key(alt-8) 268 | action(user.ide_go_ninth_tab): key(alt-9) 269 | action(user.ide_clear_tab): key(ctrl-w) -------------------------------------------------------------------------------- /apps/vscode/mac.talon: -------------------------------------------------------------------------------- 1 | # Microsoft - Visual Studio Code 2 | # see app/vscode.talon for custom voice commands 3 | # see ide.talon for common voice commands 4 | app: Code 5 | os: mac 6 | - 7 | tag(): tabs 8 | tag(): ide 9 | tag(): line_commands 10 | # General 11 | action(user.ide_command_palette): 12 | key(cmd-shift-p) 13 | action(edit.indent_less): 14 | key(cmd-[) 15 | action(edit.indent_more): 16 | key(cmd-]) 17 | action(app.tab_next): 18 | key(cmd-k) 19 | key(alt-cmd-right) 20 | action(app.tab_previous): 21 | key(cmd-k) 22 | key(alt-cmd-left) 23 | # Toggleable views 24 | action(user.ide_toggle_fullscreen): 25 | user.ide_command_palette() 26 | insert("View: Toggle Full Screen") 27 | key(enter) 28 | #action(user.ide_toggle_distraction_free): user.idea("action ToggleDistractionFreeMode") 29 | #action(user.ide_toggle_presentation_mode): user.idea("action TogglePresentationMode") 30 | 31 | # Folding 32 | action(user.ide_expand_deep): 33 | key(cmd-k cmd-]) 34 | action(user.ide_expand_all): 35 | key(cmd-k cmd-j) 36 | action(user.ide_expand_region): 37 | key(alt-cmd-]) 38 | action(user.ide_collapse_deep): 39 | key(cmd-k cmd-[) 40 | action(user.ide_collapse_all): 41 | key(cmd-k cmd-0) 42 | action(user.ide_collapse_region): 43 | key(alt-cmd-[) 44 | 45 | # Splits 46 | action(user.ide_split_right): 47 | user.ide_command_palette() 48 | insert("View: Split Editor Right") 49 | key(enter) 50 | 51 | action(user.ide_split_left): 52 | user.ide_command_palette() 53 | insert("View: Split Editor Left") 54 | key(enter) 55 | 56 | action(user.ide_split_up): 57 | user.ide_command_palette() 58 | insert("View: Split Editor Up") 59 | key(enter) 60 | 61 | action(user.ide_split_down): 62 | user.ide_command_palette() 63 | insert("View: Split Editor Down") 64 | key(enter) 65 | action(user.ide_split_flip): key(alt-cmd-0) 66 | action(user.ide_split_window): key(cmd-\) 67 | action(user.ide_clear_split): user.ide_clear_all_splits() 68 | action(user.ide_clear_all_splits): 69 | user.ide_command_palette() 70 | insert("View: Single Column Editor Layout") 71 | key(enter) 72 | action(user.ide_go_next_split): key(cmd-k cmd-right) 73 | action(user.ide_go_last_split): key(cmd-k cmd-left) 74 | 75 | #Refactor 76 | action(user.ide_refactor): 77 | key(cmd-shift-r) 78 | action(user.ide_refactor_in_line): 79 | key(cmd-shift-r) 80 | action(user.ide_refactor_rename): 81 | # Rename Symbol 82 | key(f2) 83 | action(user.ide_rename_file): 84 | user.ide_command_palette() 85 | insert("File: Reveal Active File In Side Bar") 86 | key(enter) 87 | action(user.ide_fix_format): 88 | # Format Document 89 | key(alt-shift-f) 90 | # Navigate 91 | action(user.ide_follow): 92 | # Go to Definition 93 | key(f12) 94 | 95 | action(user.ide_go_back): key(ctrl-minus) 96 | action(user.ide_go_forward): key(ctrl-shift-minus) 97 | action(user.ide_recent): key(ctrl-r) 98 | 99 | action(user.ide_multi_cursor_stop): key(escape) 100 | action(user.ide_up_cursor):key(cmd-alt-up) 101 | action(user.ide_down_cursor): key(cmd-alt-down) 102 | action(user.ide_multi_select_more): key(cmd-d) 103 | action(user.ide_multi_select_all): key(cmd-shift-l) 104 | 105 | action(user.ide_select_less): key(shift-alt-left) 106 | action(user.ide_select_more): key(shift-alt-right) 107 | 108 | # Terminal 109 | action(user.ide_toggle_terminal): 110 | # View:Toggle Integrated Terminal 111 | key(ctrl-`) 112 | 113 | action(user.ide_terminal_new): 114 | # Terminal: Created New Integrated Terminal 115 | key(ctrl-shift-`) 116 | 117 | action(user.ide_terminal_focus_previous): 118 | # Terminal: Focus Previous Pane 119 | key(alt-cmd-left) 120 | 121 | action(user.ide_terminal_focus_next): 122 | # Terminal: Focus Next Pane 123 | key(alt-cmd-right) 124 | 125 | action(user.ide_terminal_trash): 126 | user.ide_command_palette() 127 | insert("Terminal:Kill") 128 | key(enter) 129 | 130 | action(user.ide_terminal_scroll_down): 131 | key(shift-pgdown) 132 | 133 | action(user.ide_terminal_scroll_up): 134 | key(shift-pgup) 135 | 136 | # Code Editor 137 | action(user.ide_toggle_comment): 138 | key(cmd-/) 139 | 140 | action(user.ide_smart): 141 | # Trigger Suggest, editor.action.triggerSuggest 142 | key(ctrl-space) 143 | 144 | action(user.ide_intellisense_suggest_parameters): 145 | # Trigger Parameter Hints, editor.action.triggerParameterHints 146 | key(shift-cmd-space) 147 | 148 | action(user.ide_done): 149 | key(tab) 150 | 151 | # Editing 152 | action(user.ide_editor_copylines_down): 153 | # Copy Line Down, editor.action.copyLinesDownAction 154 | key(shift-alt-down) 155 | 156 | action(user.ide_editor_copylines_up): 157 | # Copy Line Up, editor.action.copyLinesUpAction 158 | key(shift-alt-up) 159 | 160 | # Workbench Focus Areas 161 | action(user.ide_toggle_project): 162 | # View: Show Explorer, workbench.view.explorer 163 | key(shift-cmd-e) 164 | 165 | action(user.ide_toggle_git): 166 | # View: Show SCM, workbench.view.scm 167 | key(shift-cmd-g) 168 | 169 | action(user.ide_toggle_extensions): 170 | # View: Show Extensions, workbench.view.extensions 171 | key(shift-cmd-x) 172 | 173 | action(user.ide_toggle_status_bar): 174 | user.ide_command_palette() 175 | insert("View: Toggle Status Bar Visibility") 176 | key(enter) 177 | #action(user.ide_toggle_power_save): user.idea("action TogglePowerSave") 178 | action(user.ide_toggle_whitespace): 179 | user.ide_command_palette() 180 | insert("View: Toggle Render Whitespace") 181 | key(enter) 182 | action(user.ide_toggle_indents): user.ide_toggle_whitespace() 183 | #requires an extension 184 | #action(user.ide_toggle_line_numbers): 185 | action(user.ide_toggle_breadcrumbs): 186 | user.ide_command_palette() 187 | insert("View: Toggle Breadcrumbs") 188 | key(enter) 189 | #action(user.ide_toggle_gutter_icons): user.idea("action EditorToggleShowGutterIcons") 190 | action(user.ide_toggle_wrap): 191 | user.ide_command_palette() 192 | insert("View: Toggle Word Wrap") 193 | key(enter) 194 | #action(user.ide_toggle_parameters): user.idea("action ToggleInlineHintsAction") 195 | 196 | action(user.ide_toggle_run): 197 | # View: Show Run and Debug, workbench.view.debug 198 | key(shift-cmd-d) 199 | action(user.ide_toggle_debug): 200 | # View: Show Run and Debug, workbench.view.debug 201 | key(shift-cmd-d) 202 | 203 | # Find and Replace 204 | action(user.ide_toggle_find): 205 | # Search: Find in Files, workbench.action.findInFiles 206 | key(shift-cmd-f) 207 | action(user.ide_find_everywhere): 208 | # Search: Find in Files, workbench.action.findInFiles 209 | key(shift-cmd-f) 210 | action(user.ide_replace_everywhere): 211 | # Search: Replace in Files, workbench.action.replaceInFiles 212 | key(shift-cmd-h) 213 | 214 | action(user.ide_replace_local): 215 | # Replace, editor.action.startFindReplaceAction 216 | key(alt-cmd-f) 217 | action(user.ide_replace_confirm_current): 218 | # ,editor.action.replaceOne 219 | key(shift-cmd-1) 220 | action(user.ide_replace_confirm_all): 221 | # ,editor.action.replaceAll 222 | key(cmd-enter) 223 | 224 | action(user.ide_find_match_by_case): 225 | # Terminal: Toggle Find Using Case Sensitive, workbench.action.terminal.toggleFindCaseSensitive 226 | key(alt-cmd-c) 227 | action(user.ide_find_match_by_word): 228 | # Terminal: Toggle Find Using Whole Word, toggleFindWholeWord 229 | key(alt-cmd-w) 230 | action(user.ide_find_match_by_regex): 231 | # Terminal: Toggle Find Using Regex, workbench.action.terminal.toggleFindRegex 232 | key(alt-cmd-r) 233 | 234 | action(user.ide_toggle_breakpoint): 235 | # Debug: Toggle Breakpoint, editor.debug.action.toggleBreakpoint 236 | key(f9) 237 | action(user.ide_step_over): 238 | # Debug: Step Over, workbench.action.debug.stepOver 239 | key(f10) 240 | action(user.ide_step_into): 241 | # Debug: Step Into, workbench.action.debug.stepInto 242 | key(f11) 243 | action(user.ide_step_out): 244 | # Debug: Step Out, workbench.action.debug.stepOut 245 | key(shift-f11) 246 | 247 | # Window and File Management 248 | action(app.window_open): 249 | # New Window, workbench.action.newWindow 250 | key(shift-cmd-n) 251 | 252 | action(user.ide_create_sibling): 253 | user.ide_command_palette() 254 | insert("File: New File") 255 | key(enter) 256 | 257 | action(user.ide_create_file): 258 | # File: New and Titled File, workbench.action.files.newUntitledFile 259 | key(cmd-n) 260 | 261 | action(user.ide_reveal_in_file_manager): 262 | # , workbench.action.files.revealActiveFileInWindows 263 | key(cmd-k r) 264 | 265 | action(user.ide_find_file): 266 | # Go to File... , workbench.action.quickOpen 267 | key(cmd-p) 268 | 269 | #tabs 270 | action(user.ide_go_first_tab): key(ctrl-1) 271 | action(user.ide_go_second_tab): key(ctrl-2) 272 | action(user.ide_go_third_tab): key(ctrl-3) 273 | action(user.ide_go_fourth_tab): key(ctrl-4) 274 | action(user.ide_go_fifth_tab): key(ctrl-5) 275 | action(user.ide_go_sixth_tab): key(ctrl-6) 276 | action(user.ide_go_seventh_tab): key(ctrl-7) 277 | action(user.ide_go_eighth_tab): key(ctrl-8) 278 | action(user.ide_go_ninth_tab): key(ctrl-9) 279 | action(user.ide_clear_tab): key(cmd-w) -------------------------------------------------------------------------------- /apps/vscode/vscode.py: -------------------------------------------------------------------------------- 1 | from talon import Context, actions, ui, Module, app 2 | is_mac = app.platform == 'mac' 3 | 4 | ctx = Context() 5 | mod = Module() 6 | 7 | ctx.matches = r''' 8 | app: Code 9 | app: Code - OSS 10 | app: Code 11 | app: Visual Studio Code 12 | app: Code.exe 13 | ''' 14 | @ctx.action_class('win') 15 | class win_actions: 16 | def filename(): 17 | title = actions.win.title() 18 | #this doesn't seem to be necessary on VSCode for Mac 19 | #if title == "": 20 | # title = ui.active_window().doc 21 | 22 | if is_mac: 23 | result = title.split(" — ")[0] 24 | else: 25 | result = title.split(" - ")[0] 26 | 27 | if "." in result: 28 | return result 29 | 30 | return "" 31 | 32 | def file_ext(): 33 | return actions.win.filename().split(".")[-1] 34 | 35 | @ctx.action_class('user') 36 | class user_actions: 37 | def go_to_line(line: int): 38 | actions.key("ctrl-g") 39 | actions.insert(str(line)) 40 | actions.key("enter") 41 | 42 | def ide_copy_path(): 43 | actions.user.ide_command_palette() 44 | actions.insert("File: Copy Path of Active File") 45 | actions.key("enter") 46 | 47 | def ide_go_mark(): 48 | actions.user.ide_command_palette() 49 | actions.insert("View: Show Bookmarks") 50 | actions.key("enter") 51 | 52 | def ide_toggle_mark(): 53 | actions.user.ide_command_palette() 54 | actions.insert("Bookmarks: Toggle") 55 | actions.key("enter") 56 | 57 | def ide_go_next_mark(): 58 | actions.user.ide_command_palette() 59 | actions.insert("Bookmarks: Jump to Next") 60 | actions.key("enter") 61 | 62 | def ide_go_last_mark(): 63 | actions.user.ide_command_palette() 64 | actions.insert("Bookmarks: Jump to Previous") 65 | actions.key("enter") 66 | -------------------------------------------------------------------------------- /apps/vscode/vscode.talon: -------------------------------------------------------------------------------- 1 | # generic ide commands are defined in ide.talon 2 | #custom vscode commands go here 3 | app: Code 4 | app: Code - OSS 5 | app: Code 6 | app: Visual Studio Code 7 | app: Code.exe 8 | - 9 | tag(): tabs 10 | 11 | -------------------------------------------------------------------------------- /apps/web/outlook.talon: -------------------------------------------------------------------------------- 1 | # https://support.office.com/en-us/article/keyboard-shortcuts-for-outlook-3cdeb221-7ae5-4c1d-8c1d-9e63216c1efd#PickTab=Web 2 | # the shortcuts below our based half of the bill in short cut menu, but the 3 | # link above has significantly more that could so be added 4 | 5 | os: linux 6 | tag: browser 7 | win.title: /Outlook/ 8 | - 9 | 10 | # write email 11 | new message: key(n) 12 | send [this] message: key(alt-s) 13 | reply [to] [this] message: key(r) 14 | reply all [to] [this] message: key(ctrl-shift-r) 15 | forward [this] message: key(ctrl-shift-f) 16 | save [draft]: key(ctrl-s) 17 | discard [draft]: key(esc) 18 | insert [a] [hyper] link: key(ctrl-k) 19 | 20 | # email list 21 | (select|unselect) [this] message: key(ctrl-space) 22 | select all [messages]: key(ctrl-a) 23 | clear all [messages]: key(esc) 24 | select first [message]: key(home) 25 | select last [message]: key(and) 26 | 27 | # read email 28 | open [this] message: key(o) 29 | open [this] message [in] [a] new window: key(shift-enter) 30 | close [this] message: key(esc) 31 | open [the] next item: key(ctrl-.) 32 | open [the] (prev|previous) item: key(ctrl-,) 33 | next item [in] [the] [reading] [pane]: key(.) 34 | (prev|previous) item [in] [the] [reading] [pane]: key(,) 35 | (expand|collapse) [conversation]: key(x) 36 | 37 | # go to 38 | go [to] mail: key(ctrl-shift-1) 39 | go [to] calendar: key(ctrl-shift-2) 40 | go [to] people: key(ctrl-shift-3) 41 | go [to] to do: key(ctrl-shift-4) 42 | go [to] inbox: 43 | key(g) 44 | key(i) 45 | go to drafts: 46 | key(g) 47 | key(d) 48 | go to sent: 49 | key(g) 50 | key(s) 51 | search [email]: key(alt-q) 52 | show help: key(?) 53 | 54 | # email actions 55 | undo [last] [action]: key(ctrl-z) 56 | delete [this] [message]: key(delete) 57 | (perm|permanently) delete [this] [message]: key(shift+delete) 58 | new folder: key(shift-e) 59 | mark [this] message [as] read: key(q) 60 | mark [this] message [as] unread: key(u) 61 | flag [this] message: key(insert) 62 | archive: key(e) 63 | mark [this] [message] [as] junk: key(j) 64 | moved to [a] folder: key(v) 65 | categorize [this] message: key(c) 66 | -------------------------------------------------------------------------------- /apps/web/protonmail.talon: -------------------------------------------------------------------------------- 1 | os:linux 2 | tag: browser 3 | win.title: /ProtonMail/ 4 | - 5 | # General 6 | ## Application 7 | open help: key(?) 8 | [focus] search: key(/) 9 | confirm active: key(enter) 10 | close active: key(escape) 11 | open command [palette]: key(shift-space) 12 | 13 | ## Composer 14 | new message: key(c) 15 | send message: key(ctrl-enter) 16 | save message: key(ctrl-s) 17 | 18 | # Mail 19 | ## Jumping 20 | (go|jump) [to] inbox: 21 | key(g) 22 | key(i) 23 | (go|jump) [to] draft: 24 | key(g) 25 | key(d) 26 | (go|jump) [to] sent: 27 | key(g) 28 | key(s) 29 | (go|jump) [to] starred: 30 | key(g) 31 | key(.) 32 | (go|jump) [to] archive: 33 | key(g) 34 | key(a) 35 | (go|jump) [to] spam: 36 | key(g) 37 | key(x) 38 | (go|jump) [to] trash: 39 | key(g) 40 | key(t) 41 | 42 | ## Navigation 43 | (prev|previous) message: key(up) 44 | next message: key(down) 45 | exit message: key(left) 46 | enter message: key(right) 47 | (show|display) newer [message]: key(k) 48 | (show|display) older [message]: key(j) 49 | open message: key(enter) 50 | go back: key(escape) 51 | 52 | ## Threadlist 53 | select all: 54 | key(*) 55 | key(a) 56 | (deselect|unselect) all: 57 | key(*) 58 | key(n) 59 | select [the] (message|conversation): key(x) 60 | mark [as] read: key(r) 61 | mark [as] unread: key(u) 62 | star (message|conversation): key(.) 63 | move to inbox: key(i) 64 | move to trash: key(t) 65 | move to archive: key(a) 66 | move to spam: key(s) 67 | 68 | ## Actions 69 | reply to (message|conversation): key(shift-r) 70 | reply all [to] (message|conversation): key(shift-a) 71 | forward (message|conversation): key(shift-f) 72 | 73 | # Contacts 74 | ## Contact List 75 | (prev|previous) contact: key(up) 76 | next contact: key(down) 77 | enter contact: key(right) 78 | delete contact: key(t) 79 | 80 | ## Contact Details 81 | exit contact: key(left) 82 | save contact: key(ctrl-s) 83 | -------------------------------------------------------------------------------- /apps/win/app.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | os: linux 3 | - 4 | #app.preferences() 5 | 6 | action(app.tab_close): 7 | key(ctrl-w) 8 | 9 | #action(app.tab_detach): 10 | # Move the current tab to a new window 11 | 12 | action(app.tab_next): 13 | key(ctrl-tab) 14 | 15 | action(app.tab_open): 16 | key(ctrl-t) 17 | 18 | action(app.tab_previous): 19 | key(ctrl-shift-tab) 20 | 21 | action(app.tab_reopen): 22 | key(ctrl-shift-t) 23 | 24 | action(app.window_close): 25 | key(alt-f4) 26 | 27 | action(app.window_hide): 28 | key(alt-space n) 29 | 30 | action(app.window_hide_others): 31 | key(win-d alt-tab) 32 | 33 | #requires easy window switcher or equivalent (built into most Linux) 34 | action(app.window_next): 35 | key(alt-`) 36 | 37 | action(app.window_open): 38 | key(ctrl-n) 39 | 40 | #requires easy window switcher or equivalent (built into most Linux) 41 | action(app.window_previous): 42 | key(alt-shift-`) 43 | -------------------------------------------------------------------------------- /apps/win/edit.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | os: linux 3 | - 4 | action(edit.copy): 5 | key(ctrl-c) 6 | 7 | action(edit.cut): 8 | key(ctrl-x) 9 | 10 | action(edit.delete): 11 | key(backspace) 12 | 13 | action(edit.delete_line): 14 | edit.select_line() 15 | edit.delete() 16 | 17 | #action(edit.delete_paragraph): 18 | 19 | #action(edit.delete_sentence): 20 | 21 | action(edit.delete_word): 22 | actions.edit.select_word() 23 | actions.edit.delete() 24 | 25 | action(edit.down): 26 | key(down) 27 | 28 | #action(edit.extend_again): 29 | 30 | #action(edit.extend_column): 31 | 32 | action(edit.extend_down): 33 | key(shift-down) 34 | 35 | action(edit.extend_file_end): 36 | key(shift-ctrl-end) 37 | 38 | action(edit.extend_file_start): 39 | key(shift-ctrl-home) 40 | 41 | action(edit.extend_left): 42 | key(shift-left) 43 | 44 | #action(edit.extend_line): 45 | 46 | action(edit.extend_line_down): 47 | key(shift-down) 48 | 49 | action(edit.extend_line_end): 50 | key(shift-end) 51 | 52 | action(edit.extend_line_start): 53 | key(shift-home) 54 | 55 | action(edit.extend_line_up): 56 | key(shift-up) 57 | 58 | action(edit.extend_page_down): 59 | key(shift-pagedown) 60 | 61 | action(edit.extend_page_up): 62 | key(shift-pageup) 63 | 64 | #action(edit.extend_paragraph_end): 65 | #action(edit.extend_paragraph_next()): 66 | #action(edit.extend_paragraph_previous()): 67 | #action(edit.extend_paragraph_start()): 68 | 69 | action(edit.extend_right): 70 | key(shift-right) 71 | 72 | #action(edit.extend_sentence_end): 73 | #action(edit.extend_sentence_next): 74 | #action(edit.extend_sentence_previous): 75 | #action(edit.extend_sentence_start): 76 | 77 | action(edit.extend_up): 78 | key(shift-up) 79 | 80 | action(edit.extend_word_left): 81 | key(ctrl-shift-left) 82 | 83 | action(edit.extend_word_right): 84 | key(ctrl-shift-right) 85 | 86 | action(edit.file_end): 87 | key(ctrl-end) 88 | 89 | action(edit.file_start): 90 | key(ctrl-home) 91 | 92 | action(edit.find): 93 | key(ctrl-f) 94 | actions.insert(text) 95 | 96 | action(edit.find_next): 97 | key(f3) 98 | #action(edit.find_previous): 99 | 100 | action(edit.indent_less): 101 | key(home delete) 102 | 103 | action(edit.indent_more): 104 | key(home tab) 105 | 106 | #action(edit.jump_column(n: int) 107 | #action(edit.jump_line(n: int) 108 | 109 | action(edit.left): 110 | key(left) 111 | 112 | action(edit.line_down): 113 | key(down home) 114 | 115 | action(edit.line_end): 116 | key(end) 117 | 118 | action(edit.line_insert_down): 119 | key(end enter) 120 | 121 | action(edit.line_insert_up): 122 | key(home enter up) 123 | 124 | action(edit.line_start): 125 | key(home) 126 | 127 | action(edit.line_up): 128 | key(up home) 129 | 130 | #action(edit.move_again): 131 | 132 | action(edit.page_down): 133 | key(pagedown) 134 | 135 | action(edit.page_up): 136 | key(pageup) 137 | 138 | #action(edit.paragraph_end): 139 | #action(edit.paragraph_next): 140 | #action(edit.paragraph_previous): 141 | #action(edit.paragraph_start): 142 | 143 | action(edit.paste): 144 | key(ctrl-v) 145 | 146 | #action(paste_match_style): 147 | 148 | action(edit.print): 149 | key(ctrl-p) 150 | 151 | action(edit.redo): 152 | key(ctrl-y) 153 | 154 | action(edit.right): 155 | key(right) 156 | 157 | action(edit.save): 158 | key(ctrl-s) 159 | 160 | action(edit.save_all): 161 | key(ctrl-shift-s) 162 | 163 | action(edit.select_all): 164 | key(ctrl-a) 165 | 166 | action(edit.select_line): 167 | key(end shift-home) 168 | 169 | #action(edit.select_lines(a: int, b: int)): 170 | 171 | action(edit.select_none): 172 | key(right) 173 | 174 | #action(edit.select_paragraph): 175 | #action(edit.select_sentence): 176 | 177 | action(edit.select_word): 178 | key(ctrl-shift-left) 179 | 180 | #action(edit.selected_text): -> str 181 | #action(edit.sentence_end): 182 | #action(edit.sentence_next): 183 | #action(edit.sentence_previous): 184 | #action(edit.sentence_start): 185 | 186 | action(edit.undo): 187 | key(ctrl-z) 188 | 189 | action(edit.up): 190 | key(up) 191 | 192 | action(edit.word_left): 193 | key(ctrl-left) 194 | 195 | action(edit.word_right): 196 | key(ctrl-right) 197 | 198 | action(edit.zoom_in): 199 | key(ctrl-+) 200 | 201 | action(edit.zoom_out): 202 | key(ctrl--) 203 | 204 | action(edit.zoom_reset): 205 | key(ctrl-0) 206 | 207 | -------------------------------------------------------------------------------- /apps/win/explorer.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | app: Windows Explorer 3 | app: explorer.exe 4 | - 5 | tag(): file_manager 6 | action(user.file_manager_go_back): 7 | key("alt-left") 8 | action(user.file_manager_go_forward): 9 | key("alt-right") 10 | action(user.file_manager_open_parent): 11 | key("alt-up") 12 | 13 | ^go $: user.file_manager_open_volume("{letter}:") 14 | go app data: user.file_manager_open_directory("%AppData%") 15 | go talon: user.file_manager_open_directory("%AppData%\Talon") 16 | -------------------------------------------------------------------------------- /apps/win/notepad++/notepad++.py: -------------------------------------------------------------------------------- 1 | from talon import Context, actions, ui, Module 2 | ctx = Context() 3 | 4 | ctx.matches = r''' 5 | app: Notepad++ : a free (GNU) source code editor 6 | app: notepad++.exe 7 | ''' 8 | @ctx.action_class('win') 9 | class win_actions: 10 | def filename(): 11 | title = actions.win.title() 12 | result = title.split(" - ")[0] 13 | if "." in result: 14 | #print(result.split("\\")[-1]) 15 | return result.split("\\")[-1] 16 | return "" 17 | 18 | def file_ext(): 19 | return actions.win.filename().split(".")[-1] 20 | 21 | @ctx.action_class('user') 22 | class win_actions: 23 | def go_to_line(line: int): 24 | actions.key("ctrl-g") 25 | actions.insert(str(line)) 26 | actions.key("enter") -------------------------------------------------------------------------------- /apps/win/notepad++/notepad++.talon: -------------------------------------------------------------------------------- 1 | app: Notepad++ : a free (GNU) source code editor 2 | app: notepad++.exe 3 | - 4 | tag(): tabs 5 | tag(): line_commands 6 | action(app.tab_previous): 7 | key(ctrl-pageup) 8 | action(app.tab_next): 9 | key(ctrl-pagedown) 10 | action(user.ide_toggle_comment): 11 | key(ctrl-q) -------------------------------------------------------------------------------- /apps/win/terminal.talon: -------------------------------------------------------------------------------- 1 | os: windows 2 | app: Windows Command Processor 3 | app: cmd.exe 4 | app: WindowsTerminal.exe 5 | - 6 | tag(): terminal 7 | tag(): file_manager 8 | 9 | run last: key(up enter) 10 | 11 | kill all: 12 | key(ctrl-c) 13 | insert("y") 14 | key(enter) 15 | 16 | action(user.file_manager_refresh_title): 17 | insert("title %CD%") 18 | key(enter) 19 | 20 | #action(user.file_manager_go_back): 21 | # key("alt-left") 22 | 23 | #action(user.file_manager_go_forward): 24 | # key("alt-right") 25 | 26 | action(user.file_manager_open_parent): 27 | insert("cd ..") 28 | key(enter) 29 | user.file_manager_refresh_title() 30 | -------------------------------------------------------------------------------- /code/Resources/HiddenCursor.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joshwcomeau/talon-commands/075fda19967365bb58e5a03f43de98337471d269/code/Resources/HiddenCursor.cur -------------------------------------------------------------------------------- /code/abbreviate.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Set 3 | 4 | from talon import Context, Module, actions 5 | 6 | mod = Module() 7 | mod.list("abbreviation", desc="Common abbreviation") 8 | 9 | 10 | @mod.capture 11 | def abbreviation(m) -> str: 12 | "One abbreviation" 13 | 14 | 15 | ctx = Context() 16 | # List taken from an aenea grammar 17 | ctx.lists["user.abbreviation"] = { 18 | "administrator": "admin", 19 | "administrators": "admins", 20 | "application": "app", 21 | "applications": "apps", 22 | "argument": "arg", 23 | "arguments": "args", 24 | "attribute": "attr", 25 | "attributes": "attrs", 26 | "authenticate": "auth", 27 | "authentication": "auth", 28 | "binary": "bin", 29 | "button": "btn", 30 | "class": "cls", 31 | "command": "cmd", 32 | "configuration": "cfg", 33 | "config": "cfg", 34 | "context": "ctx", 35 | "control": "ctrl", 36 | "database": "db", 37 | "debug": "dbg", 38 | "define": "def", 39 | "definition": "def", 40 | "description": "desc", 41 | "develop": "dev", 42 | "development": "dev", 43 | "dictionary": "dict", 44 | "dictation": "dict", 45 | "direction": "dir", 46 | "directory": "dir", 47 | "document": "doc", 48 | "documents": "docs", 49 | "dynamic": "dyn", 50 | "example": "ex", 51 | "escape": "esc", 52 | "execute": "exec", 53 | "exception": "exc", 54 | "expression": "exp", 55 | "extension": "ext", 56 | "extend": "ext", 57 | "function": "func", 58 | "framework": "fw", 59 | "image": "img", 60 | "initialize": "init", 61 | "initializer": "init", 62 | "information": "info", 63 | "instance": "inst", 64 | "integer": "int", 65 | "iterate": "iter", 66 | "java archive": "jar", 67 | "javascript": "js", 68 | "keyword": "kw", 69 | "keyword arguments": "kwargs", 70 | "language": "lng", 71 | "library": "lib", 72 | "length": "len", 73 | "markdown": "md", 74 | "message": "msg", 75 | "miscellaneous": "misc", 76 | "mount": "mnt", 77 | "number": "num", 78 | "object": "obj", 79 | "okay": "ok", 80 | "package": "pkg", 81 | "parameter": "param", 82 | "parameters": "params", 83 | "pixel": "px", 84 | "position": "pos", 85 | "point": "pt", 86 | "previous": "prev", 87 | "property": "prop", 88 | "public": "pub", 89 | "python": "py", 90 | "query string": "qs", 91 | "receipt": "rcpt", 92 | "reference": "ref", 93 | "references": "refs", 94 | "represent": "repr", 95 | "representation": "repr", 96 | "regular expression": "regex", 97 | "regular expressions": "regex", 98 | "request": "req", 99 | "revision": "rev", 100 | "ruby": "rb", 101 | "session id": "sid", 102 | "shell": "sh", 103 | "source": "src", 104 | "special": "spec", 105 | "specify": "spec", 106 | "specific": "spec", 107 | "specification": "spec", 108 | "standard": "std", 109 | "standard in": "stdin", 110 | "standard out": "stdout", 111 | "string": "str", 112 | "synchronize": "sync", 113 | "synchronous": "sync", 114 | "system": "sys", 115 | "user": "usr", 116 | "utility": "util", 117 | "utilities": "utils", 118 | "temporary": "tmp", 119 | "text": "txt", 120 | "value": "val", 121 | "variable": "var", 122 | "verify": "vrfy", 123 | "window": "win", 124 | } 125 | 126 | 127 | @ctx.capture(rule="{user.abbreviation}") 128 | def abbreviation(m): 129 | return m.abbreviation 130 | -------------------------------------------------------------------------------- /code/app_name_overrides.csv: -------------------------------------------------------------------------------- 1 | grip, DataGrip 2 | term, iTerm2 3 | one note, ONENOTE -------------------------------------------------------------------------------- /code/css.py: -------------------------------------------------------------------------------- 1 | from talon import cron, ctrl, ui, Module, Context, actions, noise, settings, imgui, app 2 | from talon.engine import engine 3 | from talon_plugins import speech, eye_mouse, eye_zoom_mouse 4 | import subprocess 5 | import os 6 | import pathlib 7 | 8 | mod = Module() 9 | ctx = Context() 10 | 11 | 12 | 13 | @mod.capture(rule='({user.css_attributes})') 14 | def css_attributes(m) -> str: 15 | return m.css_attributes 16 | 17 | @mod.capture 18 | def add_blank_rule(m) -> str: 19 | "Adds the first half of a css rule" 20 | 21 | @mod.capture 22 | def add_rule(m) -> str: 23 | "Adds a css rule" 24 | 25 | @mod.capture 26 | def color_variable(m) -> str: 27 | "Adds a css variable for one of my colors" 28 | 29 | 30 | @ctx.capture(rule='blank rule ') 31 | def add_blank_rule(m): 32 | return f'{m.css_attributes}: ;' 33 | 34 | @ctx.capture(rule='rule ') 35 | def add_rule(m): 36 | value = actions.user.formatted_text(m.text, 'DASH_SEPARATED') 37 | 38 | if value == 'zero': 39 | value = 0 40 | 41 | return f'{m.css_attributes}: {value};' 42 | 43 | @ctx.capture(rule='color variable ') 44 | def color_variable(m): 45 | value = actions.user.formatted_text(m.text, 'DASH_SEPARATED') 46 | 47 | return f'var(--color-{value})' 48 | 49 | 50 | 51 | 52 | mod.list('css_attributes', desc='list of all CSS attributes') 53 | 54 | 55 | ctx.lists['user.css_attributes'] = { 56 | 'position': 'position', 57 | 'box shadow': 'box-shadow', 58 | 'border shorthand': 'border', 59 | 'border width': 'border-width', 60 | 'border style': 'border-style', 61 | 'border color': 'border-color', 62 | 'border radius': 'border-radius', 63 | 'display': 'display', 64 | 'zed index': 'z-index', 65 | 'top': 'top', 66 | 'left': 'left', 67 | 'right': 'right', 68 | 'bottom': 'bottom', 69 | 'aline items': 'align-items', 70 | 'justify content': 'justify-content', 71 | 'flex direction': 'flex-direction', 72 | 'order': 'order', 73 | 'place content': 'place-content', 74 | 'grid column': 'grid-column', 75 | 'grid row': 'grid-row', 76 | 'grid template columns': 'grid-template-columns', 77 | 'grid template rows': 'grid-template-rows', 78 | 'grid template areas': 'grid-template-areas', 79 | 'opacity': 'opacity', 80 | 'transform shorthand': 'transform', 81 | 'transform origin': 'transform-origin', 82 | 'text transform': 'text-transform', 83 | 'color': 'color', 84 | 'background color': 'background-color', 85 | 'background': 'background', 86 | 'font size': 'font-size', 87 | 'font weight': 'font-weight', 88 | 'font style': 'font-style', 89 | 'font family': 'font-family', 90 | 'text align': 'text-align', 91 | 'text decoration': 'text-decoration', 92 | 'letter spacing': 'letter-spacing', 93 | 'width': 'width', 94 | 'height': 'height', 95 | 'max width': 'max-width', 96 | 'max height': 'max-height', 97 | 'line height': 'line-height', 98 | 'padding top': 'padding-top', 99 | 'padding left': 'padding-left', 100 | 'padding right': 'padding-right', 101 | 'padding bottom': 'padding-bottom', 102 | 'padding shorthand': 'padding', 103 | 'margin top': 'margin-top', 104 | 'margin left': 'margin-left', 105 | 'margin right': 'margin-right', 106 | 'margin bottom': 'margin-bottom', 107 | 'margin shorthand': 'margin', 108 | 'filter': 'filter', 109 | 'backdrop filter': 'backdrop-filter', 110 | 'mixed blend mode': 'mix-blend-mode', 111 | 'flex shorthand': 'flex', 112 | 'pointer events': 'pointer-events', 113 | 'overflow': 'overflow', 114 | 'white space': 'white-space', 115 | 'cursor': 'cursor', 116 | 'clip path': 'clip-path', 117 | 'animation shorthand': 'animation', 118 | 'transition shorthand': 'transition', 119 | 'transition length': 'transition-length', 120 | 'will change': 'will-change', 121 | 'blackface visibility': 'backface-visibility', 122 | 'outline shorthand': 'outline', 123 | 'outline offset': 'outline-offset', 124 | 'outline color': 'outline-color', 125 | 'content': 'content', 126 | 'user select': 'user-select', 127 | 'float': 'float', 128 | } 129 | -------------------------------------------------------------------------------- /code/delayed_speech_off.py: -------------------------------------------------------------------------------- 1 | from talon import Context, Module, actions, app, speech_system 2 | 3 | delay_mod = Module() 4 | 5 | delayed_enabled = False 6 | 7 | def do_disable(e): 8 | speech_system.unregister("post:phrase", do_disable) 9 | actions.speech.disable() 10 | 11 | @delay_mod.action_class 12 | class DelayedSpeechOffActions: 13 | def delayed_speech_on(): 14 | """Activates a "temporary speech" mode that can be disabled lazily, 15 | so that the actual disable command happens after whatever phrase 16 | finishes next.""" 17 | global delayed_enabled 18 | if not actions.speech.enabled(): 19 | delayed_enabled = True 20 | actions.speech.enable() 21 | 22 | def delayed_speech_off(): 23 | """Disables "temporary speech" mode lazily, meaning that the next 24 | phrase that finishes will turn speech off.""" 25 | global delayed_enabled 26 | if delayed_enabled: 27 | delayed_enabled = False 28 | speech_system.register("post:phrase", do_disable) 29 | -------------------------------------------------------------------------------- /code/engine.py: -------------------------------------------------------------------------------- 1 | from talon import Context, Module 2 | from talon.engine import engine 3 | 4 | mod = Module() 5 | @mod.action_class 6 | class Actions: 7 | def engine_sleep(): 8 | """Sleep the engine""" 9 | engine.mimic("go to sleep".split()), 10 | 11 | def engine_wake(): 12 | """Wake the engine""" 13 | engine.mimic("wake up".split()), 14 | 15 | def engine_mimic(cmd: str): 16 | """Sends phrase to engine""" 17 | engine.mimic(cmd.split()) 18 | -------------------------------------------------------------------------------- /code/exec.py: -------------------------------------------------------------------------------- 1 | import os 2 | from talon import Module 3 | mod = Module() 4 | @mod.action_class 5 | class Actions: 6 | def system_command(cmd: str): 7 | """execute a command on the system""" 8 | os.system(cmd) 9 | -------------------------------------------------------------------------------- /code/formatters.py: -------------------------------------------------------------------------------- 1 | from talon import Module, Context, actions, ui, imgui 2 | from talon.grammar import Phrase 3 | from typing import List, Union 4 | 5 | ctx = Context() 6 | key = actions.key 7 | 8 | words_to_keep_lowercase = "a,an,the,at,by,for,in,is,of,on,to,up,and,as,but,or,nor".split(",") 9 | 10 | last_formatted_phrase = "" 11 | last_phrase = "" 12 | 13 | def surround(by): 14 | def func(i, word, last): 15 | if i == 0: 16 | word = by + word 17 | if last: 18 | word += by 19 | return word 20 | 21 | return func 22 | 23 | def FormatText(m: Union[str, Phrase], fmtrs: str): 24 | global last_phrase 25 | last_phrase = m 26 | words = [] 27 | if isinstance(m, str): 28 | words = m.split(' ') 29 | else: 30 | if m.words[-1] == "over": 31 | m.words = m.words[:-1] 32 | 33 | words = actions.dictate.parse_words(m) 34 | words = actions.dictate.replace_words(words) 35 | 36 | return format_text_helper(words, fmtrs) 37 | 38 | def format_text_helper(word_list, fmtrs: str): 39 | fmtr_list = fmtrs.split(",") 40 | tmp = [] 41 | spaces = True 42 | dictate_niceties = False 43 | for i, w in enumerate(word_list): 44 | for name in reversed(fmtr_list): 45 | smash, func = all_formatters[name] 46 | w = func(i, w, i == len(word_list) - 1) 47 | spaces = spaces and not smash 48 | if not smash: 49 | dictate_niceties = True 50 | tmp.append(w) 51 | words = tmp 52 | 53 | sep = " " 54 | if not spaces: 55 | sep = "" 56 | result = sep.join(words) 57 | print(dictate_niceties) 58 | if dictate_niceties: 59 | result = result.replace(' comma', ',').replace(' comer', ',') 60 | 61 | global last_formatted_phrase 62 | last_formatted_phrase = result 63 | return result 64 | 65 | NOSEP = True 66 | SEP = False 67 | 68 | def words_with_joiner(joiner): 69 | """Pass through words unchanged, but add a separator between them.""" 70 | def formatter_function(i, word, _): 71 | return word if i == 0 else joiner + word 72 | return (NOSEP, formatter_function) 73 | 74 | def first_vs_rest(first_func, rest_func = lambda w: w): 75 | """Supply one or two transformer functions for the first and rest of 76 | words respectively. 77 | 78 | Leave second argument out if you want all but the first word to be passed 79 | through unchanged. 80 | Set first argument to None if you want the first word to be passed 81 | through unchanged.""" 82 | if first_func is None: 83 | first_func = lambda w: w 84 | def formatter_function(i, word, _): 85 | return first_func(word) if i == 0 else rest_func(word) 86 | return formatter_function 87 | 88 | def every_word(word_func): 89 | """Apply one function to every word.""" 90 | def formatter_function(i, word, _): 91 | return word_func(word) 92 | return formatter_function 93 | 94 | formatters_dict = { 95 | "NOOP": (SEP, lambda i, word, _: word), 96 | "DOUBLE_UNDERSCORE": (NOSEP, first_vs_rest(lambda w: "__%s__" % w)), 97 | "PRIVATE_CAMEL_CASE": (NOSEP, first_vs_rest(lambda w: w, lambda w: w.capitalize())), 98 | "PUBLIC_CAMEL_CASE": (NOSEP, every_word(lambda w: w.capitalize())), 99 | "SNAKE_CASE": (NOSEP, first_vs_rest(lambda w: w.lower(), lambda w: "_" + w.lower())), 100 | "NO_SPACES": (NOSEP, every_word(lambda w: w)), 101 | "DASH_SEPARATED": words_with_joiner("-"), 102 | "DOUBLE_COLON_SEPARATED": words_with_joiner("::"), 103 | "ALL_CAPS": (SEP, every_word(lambda w: w.upper())), 104 | "ALL_LOWERCASE": (SEP, every_word(lambda w: w.lower())), 105 | "DOUBLE_QUOTED_STRING": (SEP, surround('"')), 106 | "SINGLE_QUOTED_STRING": (SEP, surround("'")), 107 | "SPACE_SURROUNDED_STRING": (SEP, surround(" ")), 108 | "DOT_SEPARATED": words_with_joiner("."), 109 | "SLASH_SEPARATED": (NOSEP, every_word(lambda w: "/" + w)), 110 | "CAPITALIZE_FIRST_WORD": (SEP, first_vs_rest(lambda w: w.capitalize())), 111 | "CAPITALIZE_ALL_WORDS": (SEP, lambda i, word, _: word.capitalize() if i == 0 or word not in words_to_keep_lowercase else word), 112 | "FIRST_THREE": (NOSEP, lambda i, word, _: word[0:3]), 113 | "FIRST_FOUR": (NOSEP, lambda i, word, _: word[0:4]), 114 | "FIRST_FIVE": (NOSEP, lambda i, word, _: word[0:5]), 115 | } 116 | 117 | # This is the mapping from spoken phrases to formatters 118 | formatters_words = { 119 | "say": formatters_dict["NOOP"], 120 | "speak": formatters_dict["NOOP"], 121 | "dunder": formatters_dict["DOUBLE_UNDERSCORE"], 122 | "camel": formatters_dict["PRIVATE_CAMEL_CASE"], 123 | "hammer": formatters_dict["PUBLIC_CAMEL_CASE"], 124 | "snake": formatters_dict["SNAKE_CASE"], 125 | "smash": formatters_dict["NO_SPACES"], 126 | "kebab": formatters_dict["DASH_SEPARATED"], 127 | "packed": formatters_dict["DOUBLE_COLON_SEPARATED"], 128 | "allcaps": formatters_dict["ALL_CAPS"], 129 | "alldown": formatters_dict["ALL_LOWERCASE"], 130 | "dubstring": formatters_dict["DOUBLE_QUOTED_STRING"], 131 | "string": formatters_dict["SINGLE_QUOTED_STRING"], 132 | "padded": formatters_dict["SPACE_SURROUNDED_STRING"], 133 | "dotted": formatters_dict["DOT_SEPARATED"], 134 | "slasher": formatters_dict["SLASH_SEPARATED"], 135 | "sentence": formatters_dict["CAPITALIZE_FIRST_WORD"], 136 | "title": formatters_dict["CAPITALIZE_ALL_WORDS"], 137 | #disable a few formatters for now 138 | #"tree": formatters_dict["FIRST_THREE"], 139 | #"quad": formatters_dict["FIRST_FOUR"], 140 | #"fiver": formatters_dict["FIRST_FIVE"], 141 | } 142 | 143 | 144 | all_formatters = {} 145 | all_formatters.update(formatters_dict) 146 | all_formatters.update(formatters_words) 147 | 148 | mod = Module() 149 | mod.list('formatters', desc='list of formatters') 150 | 151 | @mod.capture 152 | def formatters(m) -> str: 153 | "Returns a comma-separated string of formatters e.g. 'SNAKE,DUBSTRING'" 154 | 155 | @mod.capture 156 | def format_text(m) -> str: 157 | "Formats the text and returns a string" 158 | 159 | @mod.action_class 160 | class Actions: 161 | def formatted_text(phrase: Union[str, Phrase], formatters: str) -> str: 162 | """Formats a phrase according to formatters. formatters is a comma-separated string of formatters (e.g. 'CAPITALIZE_ALL_WORDS,DOUBLE_QUOTED_STRING')""" 163 | return FormatText(phrase, formatters) 164 | 165 | def list_formatters(): 166 | """Lists all formatters""" 167 | gui.freeze() 168 | 169 | def hide_formatters(): 170 | """Hides list of formatters""" 171 | gui.hide() 172 | 173 | def clear_last_phrase(): 174 | """Clears the last formatted phrase""" 175 | global last_formatted_phrase 176 | for character in last_formatted_phrase: 177 | actions.edit.delete() 178 | 179 | def reformat_last_phrase(formatters: str) -> str: 180 | """Reformats last formatted phrase""" 181 | global last_phrase 182 | return FormatText(last_phrase, formatters) 183 | 184 | @ctx.capture(rule='{self.formatters}+') 185 | def formatters(m): 186 | return ','.join(m.formatters_list) 187 | 188 | @ctx.capture(rule=' ') 189 | def format_text(m): 190 | return FormatText(m.text, m.formatters) 191 | 192 | ctx.lists['self.formatters'] = formatters_words.keys() 193 | 194 | @imgui.open(software=False) 195 | def gui(gui: imgui.GUI): 196 | gui.text("List formatters") 197 | gui.line() 198 | for name in sorted(set(formatters_words.keys())): 199 | gui.text(f"{name} | {format_text_helper(['one', 'two', 'three'], name)}") 200 | -------------------------------------------------------------------------------- /code/history.py: -------------------------------------------------------------------------------- 1 | from talon import imgui, Module, speech_system, actions 2 | 3 | hist_len = 10 4 | history = [] 5 | def parse_phrase(word_list): 6 | return ' '.join(word.split('\\')[0] for word in word_list) 7 | 8 | def on_phrase(j): 9 | global hist_len 10 | global history 11 | 12 | try: 13 | val = parse_phrase(getattr(j['parsed'], '_unmapped', j['phrase'])) 14 | except: 15 | val = parse_phrase(j['phrase']) 16 | 17 | if val != "": 18 | history.append(val) 19 | history = history[-hist_len:] 20 | 21 | if gui.showing: 22 | gui.freeze() 23 | 24 | #todo: dynamic rect? 25 | @imgui.open(y=0,software=False) 26 | def gui(gui: imgui.GUI): 27 | global history 28 | gui.text("Command History") 29 | gui.line() 30 | text = history[:] 31 | for line in text: 32 | gui.text(line) 33 | 34 | speech_system.register('phrase', on_phrase) 35 | 36 | mod = Module() 37 | @mod.action_class 38 | class Actions: 39 | def history_enable(): 40 | """Enables the history""" 41 | gui.freeze() 42 | 43 | def history_disable(): 44 | """Disables the history""" 45 | gui.hide() 46 | 47 | def history_clear(): 48 | """Clear the history""" 49 | global history 50 | history = [] 51 | -------------------------------------------------------------------------------- /code/homophones.py: -------------------------------------------------------------------------------- 1 | from talon import Context, Module, app, clip, cron, imgui, actions, ui 2 | import os 3 | 4 | selection_numbers = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty',] 5 | selection_map = {n: i for i, n in enumerate(selection_numbers)} 6 | 7 | ######################################################################## 8 | # global settings 9 | ######################################################################## 10 | 11 | # a list of homophones where each line is a comma separated list 12 | # e.g. where,wear,ware 13 | # a suitable one can be found here: 14 | # https://github.com/pimentel/homophones 15 | cwd = os.path.dirname(os.path.realpath(__file__)) 16 | homophones_file = os.path.join(cwd, "homophones.csv") 17 | # if quick_replace, then when a word is selected and only one homophone exists, 18 | # replace it without bringing up the options 19 | quick_replace = True 20 | show_help = False 21 | ######################################################################## 22 | 23 | ctx = Context() 24 | 25 | phones = {} 26 | canonical_list = [] 27 | main_screen = ui.main_screen() 28 | 29 | with open(homophones_file, "r") as f: 30 | for h in f: 31 | h = h.rstrip() 32 | h = h.split(",") 33 | canonical_list.append(max(h, key=len)) 34 | for w in h: 35 | w = w.lower() 36 | others = phones.get(w, None) 37 | if others is None: 38 | phones[w] = sorted(h) 39 | else: 40 | # if there are multiple hits, collapse them into one list 41 | others += h 42 | others = set(others) 43 | others = sorted(others) 44 | phones[w] = others 45 | 46 | all_homophones = phones 47 | 48 | active_word_list = None 49 | is_selection = False 50 | 51 | def close_homophones(): 52 | ctx.lists['self.homophones_selections'] = [] 53 | gui.hide() 54 | 55 | def make_selection(index: int): 56 | global active_word_list 57 | cron.after("0s", close_homophones) 58 | if is_selection: 59 | clip.set(active_word_list[index - 1]) 60 | 61 | actions.insert(active_word_list[index - 1]) 62 | 63 | def raise_homophones(word, forced=False, selection=False): 64 | global quick_replace 65 | global active_word_list 66 | global show_help 67 | global force_raise 68 | global is_selection 69 | 70 | force_raise = forced 71 | is_selection = selection 72 | 73 | if is_selection: 74 | word = word.strip() 75 | 76 | is_capitalized = word == word.capitalize() 77 | is_upper = word.isupper() 78 | 79 | word = word.lower() 80 | 81 | if word not in all_homophones: 82 | app.notify("homophones.py", '"%s" not in homophones list' % word) 83 | return 84 | 85 | active_word_list = all_homophones[word] 86 | if ( 87 | is_selection 88 | and len(active_word_list) == 2 89 | and quick_replace 90 | and not force_raise 91 | ): 92 | if word == active_word_list[0].lower(): 93 | new = active_word_list[1] 94 | else: 95 | new = active_word_list[0] 96 | 97 | if is_capitalized: 98 | new = new.capitalize() 99 | elif is_upper: 100 | new = new.upper() 101 | 102 | clip.set(new) 103 | actions.edit.paste() 104 | 105 | return 106 | 107 | index = 1 108 | selections = [] 109 | for word in active_word_list: 110 | selections.append(str(index)) 111 | index = index + 1 112 | ctx.lists['self.homophones_selections'] = selection_numbers[:index-1] 113 | 114 | show_help = False 115 | gui.freeze() 116 | 117 | @imgui.open(y=0,x=main_screen.width/2.6,software=False) 118 | def gui(gui: imgui.GUI): 119 | global active_word_list 120 | if show_help: 121 | gui.text("Homephone help - todo") 122 | else: 123 | gui.text("Select a homophone") 124 | gui.line() 125 | index = 1 126 | for word in active_word_list: 127 | gui.text("Pick {}: {} ".format(index,word)) 128 | index = index + 1 129 | 130 | def show_help_gui(): 131 | global show_help 132 | show_help = True 133 | gui.freeze() 134 | 135 | mod = Module() 136 | mod.list('homophones_canonicals', desc='list of words ') 137 | mod.list('homophones_selections', desc='list of valid selection indexes') 138 | 139 | @mod.capture 140 | def homophones_canonical(m) -> str: 141 | "Returns a single string" 142 | 143 | 144 | @mod.capture 145 | def homophones_selection(m) -> str: 146 | "Returns the selected homophone" 147 | 148 | @mod.capture 149 | def homophones_formatted_selection(m) -> str: 150 | "Returns the selected homophone with the desired formatter(s) applied" 151 | 152 | @mod.action_class 153 | class Actions: 154 | def homophones_show_help(): 155 | """Shows help""" 156 | show_help_gui() 157 | 158 | def homophones_hide(): 159 | """Hides the homophones display""" 160 | close_homophones() 161 | 162 | def homophones_show(m: str): 163 | """Sentence formatter""" 164 | raise_homophones(m, False, False) 165 | 166 | def homophones_show_selection(): 167 | """Sentence formatter""" 168 | actions.edit.copy() 169 | actions.sleep("100ms") 170 | raise_homophones(clip.get(), False, True) 171 | 172 | def homophones_force_show(m: str): 173 | """Sentence formatter""" 174 | raise_homophones(m, True, False) 175 | 176 | def homophones_force_show_selection(): 177 | """Sentence formatter""" 178 | actions.edit.copy() 179 | actions.sleep("100ms") 180 | raise_homophones(clip.get(), True, True) 181 | 182 | def homophones_format_selection(word: str, fmtrs: list): 183 | """Formats the selection using Formatters""" 184 | actions.user.formatters_format_text(word, fmtrs) 185 | 186 | @ctx.capture(rule='{self.homophones_canonicals}') 187 | def homophones_canonical(m): 188 | return m.homophones_canonicals 189 | 190 | @ctx.capture(rule='{self.homophones_selections}') 191 | def homophones_selection(m): 192 | global active_word_list 193 | return active_word_list[(selection_map[m.homophones_selections])] 194 | 195 | @ctx.capture(rule=' {self.homophones_selections}') 196 | def homophones_formatted_selection(m): 197 | global active_word_list 198 | selection = active_word_list[(selection_map[m.homophones_selections])] 199 | return actions.user.formatters_format_text(selection, m.formatters) 200 | 201 | ctx.lists['self.homophones_canonicals'] = canonical_list 202 | ctx.lists['self.homophones_selections'] = [] 203 | -------------------------------------------------------------------------------- /code/javascript.py: -------------------------------------------------------------------------------- 1 | from talon import cron, ctrl, ui, Module, Context, actions, noise, settings, imgui, app 2 | from talon.engine import engine 3 | from talon_plugins import speech, eye_mouse, eye_zoom_mouse 4 | import subprocess 5 | import os 6 | import pathlib 7 | 8 | mod = Module() 9 | ctx = Context() 10 | 11 | # @mod.capture 12 | # def if_statement(m) -> str: 13 | # "Scaffolding for an `if` statement" 14 | 15 | 16 | # ##### CONTEXT 17 | # @ctx.capture(rule='if statement') 18 | # def create_image(m): 19 | # return '' 20 | -------------------------------------------------------------------------------- /code/keys.py: -------------------------------------------------------------------------------- 1 | from typing import Set 2 | 3 | from talon import Module, Context, actions 4 | import sys 5 | 6 | default_alphabet = 'air bat cap drum each fine gust harp sit jury crunch look made near odd pit quench red sun trap urge vest whale plex yank zip'.split(' ') 7 | letters_string = 'abcdefghijklmnopqrstuvwxyz' 8 | 9 | default_digits = 'zero one two three four five six seven eight nine'.split(' ') 10 | numbers = [str(i) for i in range(10)] 11 | default_f_digits = 'one two three four five six seven eight nine ten eleven twelve'.split(' ') 12 | 13 | mod = Module() 14 | mod.list('letter', desc='The spoken phonetic alphabet') 15 | mod.list('symbol', desc='All symbols from the keyboard') 16 | mod.list('arrow', desc='All arrow keys') 17 | mod.list('number', desc='All number keys') 18 | mod.list('modifier', desc='All modifier keys') 19 | mod.list('function', desc='All function keys') 20 | mod.list('special', desc='All special keys') 21 | 22 | @mod.capture 23 | def modifiers(m) -> str: 24 | "One or more modifier keys" 25 | 26 | @mod.capture 27 | def arrow(m) -> str: 28 | "One directional arrow key" 29 | 30 | @mod.capture 31 | def arrows(m) -> str: 32 | "One or more arrows separate by a space" 33 | 34 | @mod.capture 35 | def number(m) -> str: 36 | "One number key" 37 | 38 | @mod.capture 39 | def letter(m) -> str: 40 | "One letter key" 41 | 42 | @mod.capture 43 | def letters(m) -> list: 44 | "Multiple letter keys" 45 | 46 | @mod.capture 47 | def symbol(m) -> str: 48 | "One symbol key" 49 | 50 | @mod.capture 51 | def function(m) -> str: 52 | "One function key" 53 | 54 | @mod.capture 55 | def special(m) -> str: 56 | "One special key" 57 | 58 | @mod.capture 59 | def any(m) -> str: 60 | "Any one key" 61 | 62 | @mod.capture 63 | def key(m) -> str: 64 | "A single key with optional modifiers" 65 | 66 | ctx = Context() 67 | ctx.lists['self.modifier'] = { 68 | 'command': 'cmd', 69 | 'control': 'ctrl', #'troll': 'ctrl', 70 | 'shift': 'shift', #'sky': 'shift', 71 | 'alt': 'alt', 'option': 'alt', 72 | 'super': 'super', 73 | } 74 | 75 | ctx.lists['self.letter'] = dict(zip(default_alphabet, letters_string)) 76 | ctx.lists['self.symbol'] = { 77 | 'tick': '`', '`':'`', 78 | 'comma': ',', ',': ',', 79 | 'dot': '.', 'period': '.', 80 | 'semi': ';', 'semicolon': ';', 81 | 'quote': "'", 82 | 'dubquote': '"', 'double quote': '"', 83 | 'L square': '[', 'left square': '[', 'square': '[', 84 | 'R square': ']', 'right square': ']', 85 | 'forward slash': '/', 'slash': '/', 86 | 'backslash': '\\', 87 | 'dash': '-', 88 | 'em dash': '—', 89 | 'equals': '=', 90 | 'plus': '+', 91 | 'question mark': '?', 92 | 'tilde': '~', 93 | 'bang': '!', 'exclamation point': '!', 94 | 'dollar': '$', 'dollar sign': '$', 95 | 'down score': '_', 'under score': '_', 96 | 'colon': ':', 97 | 'paren': '(', 'L paren': '(', 'left paren': '(', 98 | 'R paren': ')', 'right paren': ')', 99 | 'brace': '{', 'left brace': '{', 'squiggly': '{', 100 | 'R brace': '}', 'right brace': '}', 'right squiggly': '{', 101 | 'angle': '<', 'left angle': '<', 'less than': '<', 102 | 'rangle': '>', 'R angle': '>', 'right angle': '>', 'greater than': '>', 103 | 'star': '*', 'asterisk': '*', 104 | 'pound': '#', 'hash': '#', 'hash sign': '#', 'number sign': '#', 105 | 'percent': '%', 'percent sign': '%', 106 | 'caret': '^', 107 | 'at sign': '@', 108 | 'and sign': '&', 'ampersand': '&', 'amper': '&', 109 | 'pipe': '|', 110 | } 111 | 112 | ctx.lists['self.number'] = dict(zip(default_digits, numbers)) 113 | ctx.lists['self.arrow'] = { 114 | 'left': 'left', 115 | 'right': 'right', 116 | 'up': 'up', 117 | 'down': 'down', 118 | } 119 | 120 | simple_keys = [ 121 | 'tab', 'escape', 'enter', 'space', 122 | 'home', 'pageup', 'pagedown', 'end', 123 | 'insert', 124 | ] 125 | 126 | alternate_keys = { 127 | 'delete': 'delete', 128 | 'dell': 'delete', 129 | 'junk': 'backspace', 130 | } 131 | keys = {k: k for k in simple_keys} 132 | keys.update(alternate_keys) 133 | ctx.lists['self.special'] = keys 134 | ctx.lists['self.function'] = {f"F {default_f_digits[i]}": f"f{i + 1}" for i in range(12)} 135 | 136 | @ctx.capture(rule='{self.modifier}+') 137 | def modifiers(m): 138 | return "-".join(m.modifier_list) 139 | 140 | @ctx.capture(rule='{self.arrow}') 141 | def arrow(m) -> str: 142 | return m.arrow 143 | 144 | @ctx.capture(rule='+') 145 | def arrows(m) -> str: 146 | return str(m) 147 | 148 | @ctx.capture(rule='{self.number}') 149 | def number(m): 150 | return m.number 151 | 152 | @ctx.capture(rule='{self.letter}') 153 | def letter(m): 154 | return m.letter 155 | 156 | @ctx.capture(rule='{self.special}') 157 | def special(m): 158 | return m.special 159 | 160 | @ctx.capture(rule='{self.symbol}') 161 | def symbol(m): 162 | return m.symbol 163 | 164 | @ctx.capture(rule='{self.function}') 165 | def function(m): 166 | return m.function 167 | 168 | @ctx.capture(rule='( | | | | | )') 169 | def any(m) -> str: 170 | return str(m) 171 | 172 | @ctx.capture(rule=' ') 173 | def key(m) -> str: 174 | mods = m.modifiers 175 | return "-".join([mods] + [m.any]) 176 | 177 | @ctx.capture(rule='{self.letter}+') 178 | def letters(m): 179 | return m.letter_list 180 | 181 | @mod.action_class 182 | class Actions: 183 | def keys_uppercase_letters(m: list): 184 | """Inserts uppercase letters from list""" 185 | actions.insert("".join(m).upper()) 186 | 187 | def get_alphabet(): 188 | """Provides the alphabet dictionary""" 189 | return ctx.lists['user.letter'] 190 | 191 | -------------------------------------------------------------------------------- /code/noise.py: -------------------------------------------------------------------------------- 1 | # From https://github.com/talonvoice/examples/blob/master/noise.py 2 | # import time 3 | 4 | # from talon import ctrl 5 | # from talon import tap 6 | # from talon import noise 7 | # from talon.track.geom import Point2d 8 | 9 | # class NoiseModel: 10 | # def __init__(self): 11 | # self.button = 0 12 | # self.mouse_origin = Point2d(0, 0) 13 | # self.mouse_last = Point2d(0, 0) 14 | # self.dragging = False 15 | 16 | # tap.register(tap.MMOVE, self.on_move) 17 | # noise.register('pop', self.on_pop) 18 | 19 | # def on_move(self, typ, e): 20 | # if typ != tap.MMOVE: return 21 | # self.mouse_last = pos = Point2d(e.x, e.y) 22 | # if not self.dragging: 23 | # if (pos - self.mouse_origin).len() > 10: 24 | # self.dragging = True 25 | # self.button = 0 26 | # x, y = self.mouse_origin.x, self.mouse_origin.y 27 | # ctrl.mouse(x, y) 28 | # ctrl.mouse_click(pos = (x, y), button=0, down=True) 29 | 30 | # def on_pop(self, noise): 31 | # now = time.time() 32 | # ctrl.mouse_click(button=0, hold=16000) 33 | 34 | # model = NoiseModel() 35 | -------------------------------------------------------------------------------- /code/numbers.py: -------------------------------------------------------------------------------- 1 | from talon import Context, Module, actions 2 | 3 | digits = [ 4 | "zero", 5 | "one", 6 | "two", 7 | "three", 8 | "four", 9 | "five", 10 | "six", 11 | "seven", 12 | "eight", 13 | "nine", 14 | ] 15 | teens = [ 16 | "eleven", 17 | "twelve", 18 | "thirteen", 19 | "fourteen", 20 | "fifteen", 21 | "sixteen", 22 | "seventeen", 23 | "eighteen", 24 | "nineteen", 25 | ] 26 | tens = [ 27 | "ten", 28 | "twenty", 29 | "thirty", 30 | "forty", 31 | "fifty", 32 | "sixty", 33 | "seventy", 34 | "eighty", 35 | "ninety", 36 | ] 37 | scales = [ 38 | "hundred", 39 | "thousand", 40 | "million", 41 | "billion", 42 | "trillion", 43 | "quadrillion", 44 | "quintillion", 45 | "sextillion", 46 | "septillion", 47 | "octillion", 48 | "nonillion", 49 | "decillion", 50 | ] 51 | 52 | digits_map = {n: i for i, n in enumerate(digits)} 53 | teens_map = {n: i + 11 for i, n in enumerate(teens)} 54 | tens_map = {n: 10 * (i + 1) for i, n in enumerate(tens)} 55 | digits_map["oh"] = 0 56 | 57 | scales_map = {scales[0]: 100} 58 | scales_map.update({n: 10 ** ((i + 1) * 3) for i, n in enumerate(scales[1:])}) 59 | 60 | alt_digits = "(" + ("|".join(digits_map.keys())) + ")" 61 | alt_teens = "(" + ("|".join(teens_map.keys())) + ")" 62 | alt_tens = "(" + ("|".join(tens_map.keys())) + ")" 63 | alt_scales = "(" + ("|".join(scales_map.keys())) + ")" 64 | 65 | # fuse scales (hundred, thousand) leftward onto numbers (one, twelve, twenty, etc) 66 | def fuse_scale(words, limit=None): 67 | ret = [] 68 | n = None 69 | scale = 1 70 | for w in words: 71 | if w in tens_map: 72 | scale *= tens_map[w] 73 | continue 74 | elif w in scales_map and (limit is None or scales_map[w] < limit): 75 | scale *= scales_map[w] 76 | continue 77 | elif w == "and": 78 | continue 79 | 80 | if n is not None: 81 | ret.append(n * scale) 82 | n = None 83 | scale = 1 84 | 85 | if isinstance(w, int): 86 | n = w 87 | else: 88 | ret.append(w) 89 | 90 | if n is not None: 91 | ret.append(n * scale) 92 | return ret 93 | 94 | 95 | # fuse small numbers leftward onto larger numbers 96 | def fuse_num(words): 97 | ret = [] 98 | acc = None 99 | sig = 0 100 | for w in words: 101 | if isinstance(w, int): 102 | if acc is None: 103 | acc = w 104 | sig = 10 ** len(str(w)) 105 | elif acc > w: 106 | nsig = 10 ** len(str(w)) 107 | if nsig >= sig: 108 | acc *= nsig 109 | acc += w 110 | sig = min(sig, nsig) 111 | else: 112 | ret.append(acc) 113 | acc = w 114 | sig = 0 115 | else: 116 | if acc is not None: 117 | ret.append(acc) 118 | acc = None 119 | sig = 0 120 | ret.append(w) 121 | if acc is not None: 122 | ret.append(acc) 123 | return ret 124 | 125 | 126 | """ 127 | def test_num(n): 128 | print('testing', n) 129 | step1 = fuse_scale(list(n), 1000) 130 | step2 = fuse_num(step1) 131 | step3 = fuse_scale(step2) 132 | step4 = fuse_num(step3) 133 | print('step1', step1) 134 | print('step2', step2) 135 | print('step3', step3) 136 | print('step4', step4) 137 | return step4[0] 138 | assert(test_num([1, 'hundred', 'thousand', 'and', 5, 'thousand', 'and', 6, 'thousand']) == 1050006000) 139 | assert(test_num([1, 'hundred', 'and', 5, 'thousand']) == 105000) 140 | assert(test_num([1, 'thousand', 'thousand']) == 1000000) 141 | assert(test_num([1, 'million', 5, 'hundred', 1, 'thousand']) == 1501000) 142 | assert(test_num([1, 'million', 5, 'hundred', 'and', 1, 'thousand', 1, 'hundred', 'and', 6]) == 1501106) 143 | assert(test_num([1, 'million', 1, 1]) == 10000011) 144 | assert(test_num([1, 'million', 10, 10]) == 100001010) 145 | """ 146 | 147 | ctx = Context() 148 | 149 | 150 | @ctx.capture("digits", rule=f"{alt_digits}+") 151 | def digits(m): 152 | return int("".join([str(digits_map[n]) for n in m])) 153 | 154 | 155 | @ctx.capture( 156 | "number_small", rule=f"({alt_digits} | {alt_teens} | {alt_tens} [{alt_digits}])" 157 | ) 158 | def number_small(m): 159 | result = 0 160 | for word in m: 161 | if word in digits_map: 162 | result += digits_map[word] 163 | elif word in tens_map: 164 | result += tens_map[word] 165 | elif word in teens_map: 166 | result += teens_map[word] 167 | return result 168 | 169 | 170 | @ctx.capture( 171 | "self.number_scaled", 172 | rule=f" [{alt_scales} ([and] ( | {alt_scales} | {alt_scales}))*]", 173 | ) 174 | def number_scaled(m): 175 | return fuse_num(fuse_scale(fuse_num(fuse_scale(list(m), 3))))[0] 176 | 177 | 178 | # This rule offers more colloquial number speaking when combined with a command 179 | # like: "go to line " 180 | # Example: " one one five " == 115 181 | # " one fifteen " == 115 182 | # " one hundred and fifteen " == 115 183 | @ctx.capture("number", rule=f"( | [] )") 184 | def number(m): 185 | return int("".join(str(i) for i in list(m))) 186 | 187 | 188 | @ctx.capture("number_signed", rule=f"[negative] ") 189 | def number_signed(m): 190 | number = m[-1] 191 | if m[0] == "negative": 192 | return -number 193 | return number 194 | 195 | 196 | mod = Module() 197 | mod.list("number_scaled", desc="Mix of numbers and digits") 198 | 199 | 200 | @mod.capture 201 | def number_scaled(m) -> str: 202 | "Returns a series of numbers as a string" 203 | -------------------------------------------------------------------------------- /code/ordinals.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import time 4 | from math import floor 5 | 6 | from talon import Context, Module, actions, app, ui 7 | 8 | ordinal_words = {} 9 | ordinal_ones = [ 10 | "first", 11 | "second", 12 | "third", 13 | "fourth", 14 | "fifth", 15 | "sixth", 16 | "seventh", 17 | "eighth", 18 | "ninth", 19 | ] 20 | ordinal_teens = [ 21 | "tenth", 22 | "eleventh", 23 | "twelfth", 24 | "thirteenth", 25 | "fourteenth", 26 | "fifteenth", 27 | "sixteenth", 28 | "seventeenth", 29 | "eighteenth", 30 | "nineteenth", 31 | ] 32 | ordinal_tens = [ 33 | "twentieth", 34 | "thirtieth", 35 | "fortieth", 36 | "fiftieth", 37 | "sixtieth", 38 | "seventieth", 39 | "eightieth", 40 | "ninetieth", 41 | ] 42 | ordinal_tenty = [ 43 | "twenty", 44 | "thirty", 45 | "forty", 46 | "fifty", 47 | "sixty", 48 | "seventy", 49 | "eighty", 50 | "ninety", 51 | ] 52 | 53 | 54 | def ordinal(n): 55 | """ 56 | Convert an integer into its ordinal representation:: 57 | ordinal(0) => '0th' 58 | ordinal(3) => '3rd' 59 | ordinal(122) => '122nd' 60 | ordinal(213) => '213th' 61 | """ 62 | n = int(n) 63 | suffix = ["th", "st", "nd", "rd", "th"][min(n % 10, 4)] 64 | if 11 <= (n % 100) <= 13: 65 | suffix = "th" 66 | return str(n) + suffix 67 | 68 | def ordinal_word(n): 69 | n = int(n) 70 | ordinal_list = [] 71 | if n > 19: 72 | if n % 10 == 0: 73 | ordinal_list.append(ordinal_tens[floor((n / 10)) - 2]) 74 | else: 75 | ordinal_list.append(ordinal_tenty[floor(n / 10) - 2]) 76 | ordinal_list.append(ordinal_ones[(n % 10) - 1]) 77 | elif n > 9: 78 | ordinal_list.append(ordinal_teens[n - 11]) 79 | else: 80 | ordinal_list.append(ordinal_ones[n - 1]) 81 | 82 | result = ' '.join(ordinal_list) 83 | return result 84 | 85 | for n in range(1, 100): 86 | # This was initially minus one to compensate for its only use as a command 87 | # repeater, however ordinals themselves have other uses, so accommodating 88 | # the negative one in the command repeaters done in the actual talon file 89 | # now 90 | # ordinal_words[ordinal_word(n)] = n - 1 91 | ordinal_words[ordinal_word(n)] = n 92 | 93 | mod = Module() 94 | mod.list("ordinal_words", desc="list of ordinals") 95 | 96 | ctx = Context() 97 | 98 | @mod.capture 99 | def ordinals(m) -> int: 100 | "Returns a single ordinial as a digit" 101 | 102 | @ctx.capture(rule="{self.ordinal_words}") 103 | def ordinals(m): 104 | o = m[0] 105 | return int(ordinal_words[o]) 106 | 107 | ctx.lists["self.ordinal_words"] = ordinal_words.keys() 108 | -------------------------------------------------------------------------------- /code/react.py: -------------------------------------------------------------------------------- 1 | from talon import cron, ctrl, ui, Module, Context, actions, noise, settings, imgui, app 2 | from talon.engine import engine 3 | from talon_plugins import speech, eye_mouse, eye_zoom_mouse 4 | import subprocess 5 | import os 6 | import pathlib 7 | 8 | mod = Module() 9 | ctx = Context() 10 | 11 | @mod.capture(rule='({user.html_elements})') 12 | def html_elements(m) -> str: 13 | return m.html_elements 14 | 15 | @mod.capture 16 | def create_element(m) -> str: 17 | "Creates a react element" 18 | 19 | @mod.capture 20 | def create_closed_element(m) -> str: 21 | "Creates a react element" 22 | 23 | @mod.capture 24 | def create_native_element(m) -> str: 25 | "Creates a react element (lower case)" 26 | 27 | @mod.capture 28 | def create_image(m) -> str: 29 | "Creates a react element" 30 | 31 | @mod.capture 32 | def create_styled_component(m) -> str: 33 | "Creates a new styled component" 34 | @mod.capture 35 | def create_styled_wrapper(m) -> str: 36 | "Creates a new styled Wrapper" 37 | 38 | @mod.capture 39 | def create_function_component(m) -> str: 40 | "Creates a new react function component" 41 | 42 | @mod.capture 43 | def default_import(m) -> str: 44 | "Import a default export" 45 | 46 | @mod.capture 47 | def component_import(m) -> str: 48 | "Import a react component" 49 | 50 | @mod.capture 51 | def hook_import(m) -> str: 52 | "Import a react hook" 53 | 54 | @mod.capture 55 | def text_attribute(m) -> str: 56 | "Add jsx attribute with double quotes" 57 | 58 | @mod.capture 59 | def squiggly_attribute(m) -> str: 60 | "Add jsx attribute with squiggly brackets" 61 | 62 | @mod.capture 63 | def state_hook(m) -> str: 64 | "Create a react state hook" 65 | @mod.capture 66 | def rough_hook(m) -> str: 67 | "Create a react ref hook" 68 | 69 | 70 | @mod.capture(rule='( | | )+') 71 | def var(m) -> str: 72 | return m 73 | 74 | @mod.capture(rule='( | )+') 75 | def package(m) -> str: 76 | return m 77 | 78 | 79 | 80 | # Context Stuff 81 | @ctx.capture(rule='elm image') 82 | def create_image(m): 83 | return '' 84 | 85 | @ctx.capture(rule='elm ') 86 | def create_element(m): 87 | return '<' + actions.user.formatted_text(m.text, 'PUBLIC_CAMEL_CASE') + '>' 88 | 89 | @ctx.capture(rule='closed elm ') 90 | def create_closed_element(m): 91 | return '<' + actions.user.formatted_text(m.text, 'PUBLIC_CAMEL_CASE') + ' />' 92 | 93 | @ctx.capture(rule='elm native ') 94 | def create_native_element(m): 95 | return '<' + actions.user.formatted_text(m.html_elements, 'PRIVATE_CAMEL_CASE') + '>' 96 | 97 | @ctx.capture(rule='styled ') 98 | def create_styled_component(m): 99 | component_name = actions.user.formatted_text(m.text, 'PUBLIC_CAMEL_CASE') 100 | return f'const {component_name} = styled.{m.html_elements}``' 101 | 102 | @ctx.capture(rule='styled wrapper ') 103 | def create_styled_component(m): 104 | component_name = actions.user.formatted_text(m.text, 'PUBLIC_CAMEL_CASE') 105 | return f'const {component_name} = styled()``' 106 | 107 | @ctx.capture(rule='function component ') 108 | def create_function_component(m): 109 | component_name = actions.user.formatted_text(m.text, 'PUBLIC_CAMEL_CASE') 110 | return f'function {component_name}({{}}) {{}}' 111 | 112 | @ctx.capture(rule='import from ') 113 | def default_import(m): 114 | return f'import {m.var} from \'{m.package}\';' 115 | 116 | @ctx.capture(rule='import component ') 117 | def component_import(m): 118 | component_name = actions.user.formatted_text(m.text, 'PUBLIC_CAMEL_CASE') 119 | return f'import {component_name} from \'@components/{component_name}\';' 120 | 121 | @ctx.capture(rule='import hook ') 122 | def component_import(m): 123 | hook_name = actions.user.formatted_text(m.text, 'PRIVATE_CAMEL_CASE') 124 | filename = actions.user.formatted_text(m.text, 'DASH_SEPARATED') + '.hook' 125 | return f'import {hook_name} from \'@hooks/{filename}\';' 126 | 127 | @ctx.capture(rule='text attribute ') 128 | def text_attribute(m): 129 | attribute_name = actions.user.formatted_text(m.text, 'PRIVATE_CAMEL_CASE') 130 | return f'{attribute_name}=""' 131 | 132 | @ctx.capture(rule='squiggly attribute ') 133 | def squiggly_attribute(m): 134 | attribute_name = actions.user.formatted_text(m.text, 'PRIVATE_CAMEL_CASE') 135 | return f'{attribute_name}={{}}' 136 | 137 | @ctx.capture(rule='state hook ') 138 | def state_hook(m): 139 | state_name = actions.user.formatted_text(m.text, 'PRIVATE_CAMEL_CASE') 140 | setter_name = 'set' + actions.user.formatted_text(m.text, 'PUBLIC_CAMEL_CASE') 141 | return f'const [{state_name}, {setter_name}] = React.useState();' 142 | 143 | @ctx.capture(rule='rough hook ') 144 | def rough_hook(m): 145 | state_name = actions.user.formatted_text(m.text, 'PRIVATE_CAMEL_CASE') 146 | return f'const {state_name}Ref = React.useRef();' 147 | 148 | 149 | mod.list('html_elements', desc='list of all HTML elements') 150 | 151 | 152 | 153 | 154 | ctx.lists['user.html_elements'] = { 155 | 'div': 'div', 156 | 'span': 'span', 157 | 'section': 'section', 158 | 'header': 'header', 159 | 'footer': 'footer', 160 | 'article': 'article', 161 | 'aside': 'aside', 162 | 'main': 'main', 163 | 'break': 'br', 164 | 'list': 'ul', 165 | 'ordered list': 'ol', 166 | 'list item': 'li', 167 | 'a': 'a', 168 | 'anchor': 'a', 169 | 'image': 'img', 170 | 'pe': 'p', 171 | 'paragraph': 'p', 172 | 'heading one': 'h1', 173 | 'heading two': 'h2', 174 | 'heading three': 'h3', 175 | 'heading four': 'h4', 176 | 'heading five': 'h5', 177 | 'heading six': 'h6', 178 | 'form': 'form', 179 | 'input': 'input', 180 | 'button': 'button', 181 | 'text area': 'textarea', 182 | 'select': 'select', 183 | 'label': 'label', 184 | 'details': 'details', 185 | 'strong': 'strong', 186 | 'am': 'em', 187 | 'emphasis': 'em', 188 | 'title': 'title', 189 | 'table': 'table', 190 | 'table body': 'tbody', 191 | 'table head': 'thead', 192 | 'table row': 'tr', 193 | 'table heading': 'th', 194 | 'table cell': 'td' 195 | } 196 | -------------------------------------------------------------------------------- /code/screenshot.py: -------------------------------------------------------------------------------- 1 | from talon import Module, screen, ui, actions, clip, app 2 | import os 3 | 4 | active_platform = app.platform 5 | 6 | mod = Module() 7 | @mod.action_class 8 | class Actions: 9 | def screenshot(): 10 | '''takes a screenshot of the entire screen and saves it to the desktop as screenshot.png''' 11 | img = screen.capture_rect(screen.main_screen().rect) 12 | path = os.path.expanduser(os.path.join('~', 'Desktop', 'screenshot.png')) 13 | img.write_file(path) 14 | 15 | def screenshot_window(): 16 | '''takes a screenshot of the current window and says it to the desktop as screenshot.png''' 17 | img = screen.capture_rect(ui.active_window().rect) 18 | path = os.path.expanduser(os.path.join('~', 'Desktop', 'screenshot.png')) 19 | img.write_file(path) 20 | 21 | def screenshot_selection(): 22 | '''triggers an application is capable of taking a screenshot of a portion of the screen''' 23 | if active_platform == "windows": 24 | actions.key("super-shift-s") 25 | elif active_platform == "mac": 26 | actions.key("ctrl-shift-cmd-4") 27 | 28 | def screenshot_clipboard(): 29 | '''takes a screenshot of the entire screen and saves it to the clipboard''' 30 | img = screen.capture_rect(screen.main_screen().rect) 31 | clip.set_image(img) 32 | 33 | def screenshot_window_clipboard(): 34 | '''takes a screenshot of the window and saves it to the clipboard''' 35 | img = screen.capture_rect(ui.active_window().rect) 36 | clip.set_image(img) -------------------------------------------------------------------------------- /code/selections.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path 3 | import requests 4 | import time 5 | from pathlib import Path 6 | from talon import ctrl, ui, Module, Context, actions, clip 7 | import tempfile 8 | 9 | select_verbs_map = { 10 | "select": [], 11 | "copy": [actions.edit.copy], 12 | "cut": [actions.edit.cut], 13 | "clear": [actions.edit.delete], 14 | "comment": [actions.user.ide_toggle_comment], 15 | "replace": [actions.edit.paste], 16 | "expand": [actions.user.ide_expand_region], 17 | "collapse": [actions.user.ide_collapse_region], 18 | "refactor": [actions.user.ide_refactor_in_line], 19 | "rename": [actions.user.ide_refactor_rename], 20 | "indent": [actions.edit.indent_more], 21 | "unindent": [actions.edit.indent_less], 22 | } 23 | 24 | movement_verbs_map = { 25 | "go": [], 26 | } 27 | 28 | ctx = Context() 29 | mod = Module() 30 | 31 | mod.list('selection_verbs', desc='Verbs for selecting in the editor') 32 | mod.list('navigation_verbs', desc='Verbs for navigating lines in the editor') 33 | mod.tag("line_commands", desc='Tag for enabling generic line navigation and selection commands') 34 | 35 | @mod.capture 36 | def selection_verbs(m) -> list: 37 | """Returns a list of verbs""" 38 | 39 | @mod.capture 40 | def navigation_verbs(m) -> list: 41 | """Returns a list of verbs""" 42 | 43 | def perform_selection_action(verb: str): 44 | acts = select_verbs_map[verb] 45 | for act in acts: 46 | act() 47 | 48 | def perfom_movement_action(verb: str): 49 | acts = select_verbs_map[verb] 50 | for act in acts: 51 | act() 52 | 53 | @mod.action_class 54 | class Actions: 55 | def go_to_line(line: int): 56 | """Goes to a line""" 57 | 58 | def select_whole_line(verb: str, line: int): 59 | """Selects entire line""" 60 | actions.user.go_to_line(line) 61 | actions.edit.extend_line_start() 62 | actions.edit.extend_line_end() 63 | perform_selection_action(verb) 64 | 65 | def select_current_line(verb: str): 66 | """Select current line""" 67 | actions.edit.line_start() 68 | actions.edit.extend_line_end() 69 | perform_selection_action(verb) 70 | 71 | def select_line(verb: str, line: int): 72 | """Performs action on selection of specified line""" 73 | actions.user.go_to_line(line) 74 | actions.edit.extend_line_end() 75 | perform_selection_action(verb) 76 | 77 | def select_until_line(verb: str, line: int): 78 | """Performs action on selection from current line to the specified line.""" 79 | 80 | def select_range(verb: str, line_start: int, line_end: int): 81 | """Performs action on selection from line line_start to line line_end""" 82 | actions.user.go_to_line(line_start) 83 | actions.edit.extend_line_end() 84 | 85 | number_of_lines = line_end - line_start 86 | for i in range(0, number_of_lines): 87 | actions.edit.extend_line_down() 88 | actions.edit.extend_line_end() 89 | perform_selection_action(verb) 90 | 91 | def select_way_left(verb: str): 92 | """Performs action on selection from cursor to line start""" 93 | actions.edit.extend_line_start() 94 | perform_selection_action(verb) 95 | 96 | def select_way_right(verb: str): 97 | """Performs action on selection from cursor to line end""" 98 | actions.edit.extend_line_end() 99 | perform_selection_action(verb) 100 | 101 | def select_way_up(verb: str): 102 | """Performs action on selection from cursor to file start""" 103 | actions.edit.extend_file_start() 104 | perform_selection_action(verb) 105 | 106 | def select_way_down(verb: str): 107 | """Performs action on selection from cursor to file end""" 108 | actions.edit.extend_file_end() 109 | perform_selection_action(verb) 110 | 111 | def select_camel_left(verb: str): 112 | """Perform action on camel-based selection to the left.""" 113 | 114 | def select_camel_right(verb: str): 115 | """Perform action on camel-based selection to the right""" 116 | 117 | def select_all(verb: str): 118 | """Perform action on entire file""" 119 | actions.edit.extend_select_all() 120 | perform_selection_action(verb) 121 | 122 | def select_left(verb: str): 123 | """Perform action on selection to the left""" 124 | actions.edit.extend_left() 125 | perform_selection_action(verb) 126 | 127 | def select_right(verb: str): 128 | """Perform action on selection to the right""" 129 | actions.edit.extend_right() 130 | perform_selection_action(verb) 131 | 132 | def select_up(verb: str): 133 | """Perform action on upward selection """ 134 | actions.edit.extend_up() 135 | perform_selection_action(verb) 136 | 137 | def select_down(verb: str): 138 | """Perform action on downward selection""" 139 | actions.edit.extend_down() 140 | perform_selection_action(verb) 141 | 142 | def select_word_left(verb: str): 143 | """Perform action on left word selection""" 144 | actions.edit.extend_word_left() 145 | perform_selection_action(verb) 146 | 147 | def select_word_right(verb: str): 148 | """Perform action on right word selection""" 149 | actions.edit.extend_word_left() 150 | perform_selection_action(verb) 151 | 152 | def move_camel_left(verb: str): 153 | """Moves and performs action on camel left""" 154 | 155 | def move_camel_right(verb: str): 156 | """Moves and performs action on camel left""" 157 | 158 | @ctx.capture(rule='{self.selection_verbs}') 159 | def selection_verbs(m): 160 | return m.selection_verbs 161 | 162 | @ctx.capture(rule='{self.navigation_verbs}') 163 | def navigation_verbs(m): 164 | return m.navigation_verbs 165 | 166 | ctx.lists['self.selection_verbs'] = select_verbs_map.keys() 167 | ctx.lists['self.navigation_verbs'] = movement_verbs_map.keys() 168 | -------------------------------------------------------------------------------- /code/sql.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joshwcomeau/talon-commands/075fda19967365bb58e5a03f43de98337471d269/code/sql.py -------------------------------------------------------------------------------- /code/switcher.py: -------------------------------------------------------------------------------- 1 | from talon import app, Module, Context, actions, ui,imgui 2 | from talon.voice import Capture 3 | import re 4 | import time 5 | import os 6 | # Construct at startup a list of overides for application names (similar to how homophone list is managed) 7 | # ie for a given talon recognition word set `one note`, recognized this in these switcher functions as `ONENOTE` 8 | # the list is a comma seperated `, ` 9 | #TODO: Consider put list csv's (homophones.csv, app_name_overrides.csv) files together in a seperate directory,`knausj_talon/lists` 10 | cwd = os.path.dirname(os.path.realpath(__file__)) 11 | overrides_file = os.path.join(cwd, "app_name_overrides.csv") 12 | overrides ={} 13 | with open(overrides_file, "r") as f: 14 | for line in f: 15 | line = line.rstrip() 16 | line = line.split(",") 17 | overrides[line[0].lower()] = line[1].strip() 18 | 19 | print(f'knausj_talon.switcher------------ app name overrides:{overrides}') 20 | 21 | app_cache = {} 22 | 23 | 24 | mod = Module() 25 | mod.list('running', desc='all running applications') 26 | mod.list('launch', desc='all launchable applications') 27 | 28 | @mod.capture 29 | def running_applications(m) -> str: 30 | "Returns a single application name" 31 | 32 | @mod.capture 33 | def launch_applications(m) -> Capture: 34 | "Returns a single application name" 35 | 36 | ctx = Context() 37 | @ctx.capture(rule='{self.running}') 38 | def running_applications(m): 39 | return m.running 40 | 41 | @ctx.capture(rule='{self.launch}') 42 | def launch_applications(m): 43 | return m.launch 44 | 45 | def split_camel(word): 46 | return re.findall(r'[0-9A-Z]*[a-z]+(?=[A-Z]|$)', word) 47 | 48 | def get_words(name): 49 | words = re.findall(r'[0-9A-Za-z]+', name) 50 | out = [] 51 | for word in words: 52 | out += split_camel(word) 53 | return out 54 | 55 | @mod.action_class 56 | class Actions: 57 | def switcher_focus(name: str): 58 | """Focus a new application by name""" 59 | for app in ui.apps(): 60 | # print(f"--------- app.name:{app.name} app.bundler:{app.bundle}") 61 | if name in app.name and not app.background: 62 | app.focus() 63 | break 64 | 65 | def switcher_launch(path: str): 66 | """Launch a new application by path""" 67 | ui.launch(path=path) 68 | 69 | def switcher_list_running(): 70 | """Lists all running applications""" 71 | gui.show() 72 | 73 | def switcher_hide_running(): 74 | """Hides list of running applications""" 75 | gui.hide() 76 | 77 | @imgui.open(software=False) 78 | def gui(gui: imgui.GUI): 79 | gui.text("Names of running applications") 80 | gui.line() 81 | for line in ctx.lists['self.running']: 82 | gui.text(line) 83 | 84 | def update_lists(): 85 | running = {} 86 | launch = {} 87 | 88 | for cur_app in ui.apps(background=False): 89 | name = cur_app.name 90 | if name.endswith('.exe'): 91 | name = name.rsplit('.', 1)[0] 92 | words = get_words(name) 93 | for word in words: 94 | if word and not word in running: 95 | running[word.lower()] = cur_app.name 96 | running[name.lower()] = cur_app.name 97 | for override in overrides: 98 | running[override] = overrides[override] 99 | 100 | if app.platform == "mac": 101 | for base in '/Applications', '/Applications/Utilities': 102 | for name in os.listdir(base): 103 | path = os.path.join(base, name) 104 | name = name.rsplit('.', 1)[0].lower() 105 | launch[name] = path 106 | words = name.split(' ') 107 | for word in words: 108 | if word and word not in launch: 109 | if len(name) > 6 and len(word) < 3: 110 | continue 111 | launch[word] = path 112 | 113 | lists = { 114 | 'self.running': running, 115 | 'self.launch': launch, 116 | } 117 | 118 | #batch update lists 119 | ctx.lists.update(lists) 120 | 121 | def ui_event(event, arg): 122 | if event in ('app_activate', 'app_launch', 'app_close', 'win_open', 'win_close'): 123 | # print(f'------------------ event:{event} arg:{arg}') 124 | update_lists() 125 | 126 | ui.register('', ui_event) 127 | update_lists() -------------------------------------------------------------------------------- /code/tags.py: -------------------------------------------------------------------------------- 1 | from talon import Context, Module 2 | 3 | mod = Module() 4 | 5 | tagList = ["firefox", "gdb", "tmux", "tabs"] 6 | modes = { 7 | "gdb" : "a way to force gdb commands to be loaded", 8 | } 9 | 10 | for entry in tagList: 11 | mod.tag(entry, f"tag to load {entry} and/or related plugins ") 12 | 13 | for key, value in modes.items(): 14 | mod.mode(key, value) 15 | -------------------------------------------------------------------------------- /code/talon_helpers.py: -------------------------------------------------------------------------------- 1 | from talon import Context, actions, ui, Module, app, clip 2 | import os 3 | 4 | mod = Module() 5 | 6 | @mod.action_class 7 | class Actions: 8 | def talon_add_context_clipboard(): 9 | """Adds os-specific context info to the clipboard""" 10 | friendly_name = actions.app.name() 11 | executable = actions.app.executable().split(os.path.sep)[-1] 12 | if app.platform != "windows": 13 | result = "os: {}\napp: {}\ntitle: {}".format(app.platform, friendly_name, actions.win.title()) 14 | 15 | #on windows, it's best to include both the friendly name and executable name in case the muicache breaks.... 16 | else: 17 | result = "os: {}\napp: {}\napp: {}\ntitle: {}".format(app.platform, friendly_name, executable, actions.win.title()) 18 | 19 | clip.set(result) 20 | -------------------------------------------------------------------------------- /code/vocabulary.py: -------------------------------------------------------------------------------- 1 | from talon import Context, Module 2 | 3 | simple_vocabulary = [ 4 | "nmap", 5 | "admin", 6 | "Cisco", 7 | "Citrix", 8 | "VPN", 9 | "DNS", 10 | "minecraft", 11 | "hey", 12 | "HTML", 13 | "div", 14 | "dev", 15 | "null", 16 | "Wrapper", 17 | "site", 18 | "app", 19 | "auto", 20 | "font", 21 | "css", 22 | "y'all", 23 | "null", 24 | "vercel", 25 | "netlify", 26 | "todo", 27 | "async", 28 | "res", 29 | "req", 30 | "unstyled", 31 | "auth" 32 | ] 33 | 34 | mapping_vocabulary = { 35 | "i": "I", 36 | "i'm": "I'm", 37 | "i've": "I've", 38 | "i'll": "I'll", 39 | "i'd": "I'd", 40 | "source": "src", 41 | "oto": "auto", 42 | "como": "comeau", 43 | "centre": "center", 44 | "docks": "docs", 45 | "kama": "comma", 46 | "end": "and", 47 | "hay folks": "Hey folks", 48 | "pading": "padding", 49 | "fond": "font", 50 | "fon": "font", 51 | "zed index": "z-index", 52 | "cs": "css", 53 | "noll": "null", 54 | } 55 | 56 | mapping_vocabulary.update(dict(zip(simple_vocabulary, simple_vocabulary))) 57 | 58 | mod = Module() 59 | def remove_dragon_junk(word): 60 | return str(word).lstrip("\\").split("\\")[0] 61 | 62 | @mod.capture(rule='({user.vocabulary})') 63 | def vocabulary(m) -> str: 64 | return m.vocabulary 65 | 66 | @mod.capture(rule='( | )') 67 | def word(m) -> str: 68 | try: return m.vocabulary 69 | except AttributeError: return remove_dragon_junk(m.word) 70 | 71 | @mod.capture(rule='( | )+') 72 | def text(m) -> str: 73 | #todo: use actions.dicate.parse_words for better dragon support once supported 74 | words = str(m).split(' ') 75 | i = 0 76 | while i < len(words): 77 | words[i] = remove_dragon_junk(words[i]) 78 | i += 1 79 | 80 | return ' '.join(words) 81 | 82 | mod.list('vocabulary', desc='user vocabulary') 83 | 84 | ctx = Context() 85 | 86 | # setup the word map too 87 | ctx.settings['dictate.word_map'] = mapping_vocabulary 88 | ctx.lists['user.vocabulary'] = mapping_vocabulary 89 | -------------------------------------------------------------------------------- /lang/comment.talon: -------------------------------------------------------------------------------- 1 | tag: user.code_comment 2 | - 3 | comment: user.code_comment() 4 | comment line: 5 | #todo: this should probably be a single function once 6 | #.talon supports implementing actions with parameters? 7 | edit.line_start() 8 | user.code_comment() 9 | #adds comment to the start of the line 10 | comment line over: 11 | #todo: this should probably be a single function once 12 | #.talon supports implementing actions with parameters? 13 | edit.line_start() 14 | user.code_comment() 15 | insert(user.text) 16 | insert(" ") 17 | comment over: 18 | #todo: this should probably be a single function once 19 | #.talon supports implementing actions with parameters? 20 | user.code_comment() 21 | insert(user.text) 22 | ^comment $: 23 | #todo: this should probably be a single function once 24 | #.talon supports implementing actions with parameters? 25 | user.code_comment() 26 | insert(user.text) 27 | (line | inline) comment over: 28 | #todo: this should probably be a single function once 29 | #.talon supports implementing actions with parameters? 30 | edit.line_end() 31 | user.code_comment() 32 | insert(user.text) 33 | ^(line | inline) comment $: 34 | #todo: this should probably be a single function once 35 | #.talon supports implementing actions with parameters? 36 | edit.line_end() 37 | user.code_comment() 38 | insert(user.text) 39 | -------------------------------------------------------------------------------- /lang/csharp.talon: -------------------------------------------------------------------------------- 1 | code.language: csharp 2 | mode: command 3 | and code.language: csharp 4 | - 5 | tag(): user.code_operators 6 | tag(): user.code_comment 7 | tag(): user.code_generic 8 | settings(): 9 | user.code_private_function_formatter = "PRIVATE_CAMEL_CASE" 10 | user.code_protected_function_formatter = "PROTECTED_CAMEL_CASE" 11 | user.code_public_function_formatter = "PROTECTED_CAMEL_CASE" 12 | user.code_private_variable_formatter = "PRIVATE_CAMEL_CASE" 13 | user.code_protected_variable_formatter = "PROTECTED_CAMEL_CASE" 14 | user.code_public_variable_formatter = "PROTECTED_CAMEL_CASE" 15 | 16 | action(user.code_operator_indirection): "*" 17 | action(user.code_operator_address_of): "&" 18 | action(user.code_operator_structure_deference): "->" 19 | action(user.code_operator_lambda): "=>" 20 | action(user.code_operator_subscript): 21 | insert("[]") 22 | key(left) 23 | action(user.code_operator_assignment): " = " 24 | action(user.code_operator_subtraction): " - " 25 | action(user.code_operator_subtraction_assignment): " -= " 26 | action(user.code_operator_addition): " + " 27 | action(user.code_operator_addition_assignment): " += " 28 | action(user.code_operator_multiplication): " * " 29 | action(user.code_operator_multiplication_assignment): " *= " 30 | #action(user.code_operator_exponent): " ** " 31 | action(user.code_operator_division): " / " 32 | action(user.code_operator_division_assignment): " /= " 33 | action(user.code_operator_modulo): " % " 34 | action(user.code_operator_modulo_assignment): " %= " 35 | action(user.code_operator_equal): " == " 36 | action(user.code_operator_not_equal): " != " 37 | action(user.code_operator_greater_than): " > " 38 | action(user.code_operator_greater_than_or_equal_to): " >= " 39 | action(user.code_operator_less_than): " < " 40 | action(user.code_operator_less_than_or_equal_to): " <= " 41 | action(user.code_operator_and): " && " 42 | action(user.code_operator_or): " || " 43 | action(user.code_operator_bitwise_and): " & " 44 | action(user.code_operator_bitwise_and_assignment): " &= " 45 | action(user.code_operator_bitwise_or): " | " 46 | action(user.code_operator_bitwise_or_assignment): " |= " 47 | action(user.code_operator_bitwise_exlcusive_or): " ^ " 48 | action(user.code_operator_bitwise_exlcusive_or_assignment): " ^= " 49 | action(user.code_operator_bitwise_left_shift): " << " 50 | action(user.code_operator_bitwise_left_shift_assignment): " <<= " 51 | action(user.code_operator_bitwise_right_shift): " >> " 52 | action(user.code_operator_bitwise_right_shift_assignment): " >>= " 53 | action(user.code_self): "this" 54 | action(user.code_null): "null" 55 | action(user.code_is_null): " == null " 56 | action(user.code_is_not_null): " != null" 57 | action(user.code_state_if): 58 | insert("if()") 59 | key(left) 60 | action(user.code_state_else_if): 61 | insert("else if()") 62 | key(left) 63 | action(user.code_state_else): 64 | insert("else\n{{\n}}\n") 65 | key(up ) 66 | action(user.code_state_switch): 67 | insert("switch()") 68 | edit.left() 69 | action(user.code_state_case): 70 | insert("case \nbreak;") 71 | edit.up() 72 | action(user.code_state_for): "for " 73 | action(user.code_state_for_each): 74 | insert("foreach() ") 75 | key(left) 76 | edit.word_left() 77 | key(space) 78 | edit.left() 79 | action(user.code_state_go_to): "go to " 80 | action(user.code_state_while): 81 | insert("while()") 82 | edit.left() 83 | action(user.code_state_return): "return " 84 | #action(user.code_type_definition): "typedef " 85 | #action(user.code_typedef_struct): 86 | # insert("typedef struct") 87 | # insert("{{\n\n}}") 88 | # edit.up() 89 | # key(tab) 90 | action(user.code_type_class): "class " 91 | action(user.code_import): "using " 92 | action(user.code_from_import): "using " 93 | action(user.code_include): insert("using ") 94 | action(user.code_include_system): insert("using ") 95 | action(user.code_include_local): insert('using ') 96 | action(user.code_comment): "//" 97 | 98 | #todo: figure out how to handle typing beyond "void" 99 | action(user.code_private_function): insert("private void") 100 | action(user.code_public_static_function): insert("private static void") 101 | action(user.code_protected_function): insert("protected void") 102 | action(user.code_public_function): insert("public void") 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /lang/css.talon: -------------------------------------------------------------------------------- 1 | 2 | # elm : 3 | # "<" 4 | # insert(user.text) 5 | # ">" 6 | # key("enter") 7 | # elm : 8 | # user.react_create_element(user.text) 9 | 10 | # action(user.react_create_element): 11 | # "hello2" 12 | 13 | # boo: "ysa" 14 | 15 | [over]: 16 | insert(add_blank_rule) 17 | key('left') 18 | 19 | [over]: 20 | insert(add_rule) 21 | key('enter') 22 | 23 | [over]: 24 | insert(color_variable) 25 | key('left') 26 | 27 | media query: 28 | insert('@media ${{p => p.theme.breakpoints.}} {{}}') 29 | key('left enter up right right right right right right right right right right right right right right right right right right right right right right right right right right right right right right right right ') 30 | -------------------------------------------------------------------------------- /lang/go.talon: -------------------------------------------------------------------------------- 1 | mode: user.go 2 | mode: command 3 | and code.language: go 4 | - 5 | variadic: "..." 6 | logical and: " && " 7 | logical or: " || " 8 | # Many of these add extra terrible spacing under the assumption that 9 | # gofmt/goimports will erase it. 10 | state comment: "// " 11 | [line] comment : 12 | key("cmd-right") 13 | insert(" // ") 14 | insert(user.formatted_text(phrase, "sentence")) 15 | 16 | # "add comment [over]: 17 | # key("cmd-right") 18 | # text_with_leading(" // ") 19 | # ] 20 | # "[state] context: insert("ctx") 21 | state (funk | func | fun): "func " 22 | function (Annette | init) [over]: "func init() {\n" 23 | function [over]: 24 | insert("func ") 25 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 26 | insert("(") 27 | sleep(100ms) 28 | 29 | method [over]: 30 | insert("meth ") 31 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 32 | sleep(100ms) 33 | 34 | state var: "var " 35 | variable [] [over]: 36 | insert("var ") 37 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 38 | # insert(" ") 39 | sleep(100ms) 40 | 41 | of type [] [over]: 42 | insert(" ") 43 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 44 | 45 | # "set [over]: 46 | # insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 47 | # insert(" := ") 48 | # sleep(100ms) 49 | # ] 50 | state break: "break" 51 | state (chan | channel): " chan " 52 | state go: "go " 53 | state if: "if " 54 | if [over]: 55 | insert("if ") 56 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 57 | spawn [over]: 58 | insert("go ") 59 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 60 | state else if: " else if " 61 | else if [over]: 62 | insert(" else if ") 63 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 64 | 65 | state else: " else " 66 | else [over]: 67 | insert(" else {") 68 | key("enter") 69 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 70 | 71 | state while: "while " 72 | while [over]: 73 | insert("while ") 74 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 75 | 76 | state for: "for " 77 | for [over]: 78 | insert("for ") 79 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 80 | 81 | state for range: "forr " 82 | range [over]: 83 | insert("forr ") 84 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 85 | 86 | state format: "fmt" 87 | format [over]: 88 | insert("fmt.") 89 | insert(user.formatted_text(phrase, "PUBLIC_CAMEL_CASE")) 90 | 91 | state switch: "switch " 92 | switch [over]: 93 | insert("switch ") 94 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 95 | 96 | state select: "select " 97 | # "select :insert("select "), insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")] 98 | state (const | constant): " const " 99 | constant [over]: 100 | insert("const ") 101 | insert(user.formatted_text(phrase, "PUBLIC_CAMEL_CASE")) 102 | 103 | state case: " case " 104 | state default: " default:" 105 | case [over]: 106 | insert("case ") 107 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 108 | 109 | state type: " type " 110 | type [over]: 111 | insert("type ") 112 | insert(user.formatted_text(phrase, "PUBLIC_CAMEL_CASE")) 113 | state true: " true " 114 | state false: " false " 115 | state (start | struct | struck): 116 | insert(" struct {") 117 | key("enter") 118 | (struct | struck) [over]: 119 | insert(" struct {") 120 | key("enter") 121 | insert(user.formatted_text(phrase, "PUBLIC_CAMEL_CASE")) 122 | 123 | [state] empty interface: " interface{} " 124 | state interface: 125 | insert(" interface {") 126 | key("enter") 127 | interface [over]: 128 | insert(" interface {") 129 | key("enter") 130 | insert(user.formatted_text(phrase, "PUBLIC_CAMEL_CASE")) 131 | 132 | state string: " string " 133 | [state] (int | integer | ant): "int" 134 | state slice: " []" 135 | slice of: "[]" 136 | [state] (no | nil): "nil" 137 | state (int | integer | ant) 64: " int64 " 138 | state tag: 139 | insert(" ``") 140 | key("left") 141 | field tag [over]: 142 | insert(" ``") 143 | key("left") 144 | sleep(100ms) 145 | insert(user.formatted_text(phrase, "snake")) 146 | insert(" ") 147 | sleep(100ms) 148 | 149 | state return: " return " 150 | return [over]: 151 | insert("return ") 152 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 153 | 154 | map of string to string: " map[string]string " 155 | map of [over]: 156 | insert("map[") 157 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 158 | key("right") 159 | sleep(100ms) 160 | 161 | receive: " <- " 162 | make: "make(" 163 | loggers [] [over]: 164 | insert("logrus.") 165 | insert(user.formatted_text(phrase, "PUBLIC_CAMEL_CASE")) 166 | 167 | length [over]: 168 | insert("len(") 169 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 170 | 171 | append [over]: 172 | insert("append(") 173 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 174 | 175 | state (air | err): "err" 176 | error: " err " 177 | loop over [] [over]: 178 | insert("forr ") 179 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 180 | 181 | item [over]: 182 | insert(", ") 183 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 184 | 185 | value [over]: 186 | insert(": ") 187 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 188 | 189 | address of [] [over]: 190 | insert("&") 191 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 192 | 193 | pointer to [] [over]: 194 | insert("*") 195 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 196 | 197 | swipe [] [over]: 198 | key("right") 199 | insert(", ") 200 | insert(user.formatted_text(phrase, "PRIVATE_CAMEL_CASE")) 201 | -------------------------------------------------------------------------------- /lang/javascript.talon: -------------------------------------------------------------------------------- 1 | mode: user.javascript 2 | mode: command 3 | and code.language: javascript 4 | - 5 | tag(): user.code_operators 6 | tag(): user.code_comment 7 | tag(): user.code_generic 8 | 9 | settings(): 10 | user.code_private_function_formatter = "PRIVATE_CAMEL_CASE" 11 | user.code_protected_function_formatter = "PRIVATE_CAMEL_CASE" 12 | user.code_public_function_formatter = "PRIVATE_CAMEL_CASE" 13 | user.code_private_variable_formatter = "PRIVATE_CAMEL_CASE" 14 | user.code_protected_variable_formatter = "PRIVATE_CAMEL_CASE" 15 | user.code_public_variable_formatter = "PRIVATE_CAMEL_CASE" 16 | 17 | action(user.code_is_not_null): " !== null" 18 | 19 | action(user.code_is_null): " === null" 20 | 21 | action(user.code_type_dictionary): 22 | insert("{}") 23 | key(left) 24 | 25 | action(user.code_state_if): 26 | insert("if () {}") 27 | key(left enter up right right) 28 | 29 | action(user.code_state_else_if): 30 | insert(" else if ()") 31 | key(left) 32 | 33 | action(user.code_state_else): 34 | insert(" else {}") 35 | key(left enter) 36 | 37 | action(user.code_self): "this" 38 | 39 | action(user.code_state_while): 40 | insert("while ()") 41 | key(left) 42 | 43 | action(user.code_state_return): 44 | insert("return ") 45 | 46 | action(user.code_state_for): 47 | insert("for ()") 48 | key(left) 49 | 50 | action(user.code_state_switch): 51 | insert("switch ()") 52 | key(left) 53 | 54 | action(user.code_state_case): "case :" 55 | 56 | action(user.code_state_go_to): "" 57 | 58 | action(user.code_import): "import " 59 | 60 | action(user.code_from_import): 61 | insert(" from \"\"") 62 | key(left) 63 | 64 | action(user.code_type_class): "class " 65 | 66 | action(user.code_include): "" 67 | 68 | action(user.code_include_system): "" 69 | 70 | action(user.code_include_local): "" 71 | 72 | action(user.code_type_definition): "" 73 | 74 | action(user.code_typedef_struct): "" 75 | 76 | action(user.code_state_for_each): 77 | insert(".forEach()") 78 | key(left) 79 | 80 | action(user.code_null): "null" 81 | 82 | action(user.code_private_function): "function " 83 | action(user.code_protected_function): "function " 84 | action(user.code_public_function): "function " 85 | 86 | action(user.code_operator_indirection): "" 87 | action(user.code_operator_address_of): "" 88 | action(user.code_operator_structure_deference): "" 89 | action(user.code_operator_lambda): " => " 90 | action(user.code_operator_subscript): 91 | insert("[]") 92 | key(left) 93 | action(user.code_operator_assignment): " = " 94 | action(user.code_operator_subtraction): " - " 95 | action(user.code_operator_subtraction_assignment): " -= " 96 | action(user.code_operator_addition): " + " 97 | action(user.code_operator_addition_assignment): " += " 98 | action(user.code_operator_multiplication): " * " 99 | action(user.code_operator_multiplication_assignment): " *= " 100 | action(user.code_operator_exponent): " ** " 101 | action(user.code_operator_division): " / " 102 | action(user.code_operator_division_assignment): " /= " 103 | action(user.code_operator_modulo): " % " 104 | action(user.code_operator_modulo_assignment): " %= " 105 | action(user.code_operator_equal): " == " 106 | action(user.code_operator_not_equal): " != " 107 | (op | is) strict equal: " === " 108 | (op | is) strict not equal: " !== " 109 | action(user.code_operator_greater_than): " > " 110 | action(user.code_operator_greater_than_or_equal_to): " >= " 111 | action(user.code_operator_less_than): " < " 112 | action(user.code_operator_less_than_or_equal_to): " <= " 113 | action(user.code_operator_and): " && " 114 | action(user.code_operator_or): " || " 115 | action(user.code_operator_bitwise_and): " & " 116 | action(user.code_operator_bitwise_and_assignment): " &= " 117 | action(user.code_operator_bitwise_or): " | " 118 | action(user.code_operator_bitwise_or_assignment): " |= " 119 | action(user.code_operator_bitwise_exlcusive_or): " ^ " 120 | action(user.code_operator_bitwise_exlcusive_or_assignment): " ^= " 121 | action(user.code_operator_bitwise_left_shift): " << " 122 | action(user.code_operator_bitwise_left_shift_assignment): " <<= " 123 | action(user.code_operator_bitwise_right_shift): " >> " 124 | action(user.code_operator_bitwise_right_shift_assignment): " >>= " 125 | 126 | state block: 127 | insert("{}") 128 | key(left enter) 129 | 130 | state const: "const " 131 | 132 | state let: "let " 133 | 134 | state var: "var " 135 | 136 | state async: "async " 137 | 138 | state await: "await " 139 | 140 | state lambda: 141 | insert("() => {}") 142 | key(left left left left left left left) 143 | 144 | state empty lambda: 145 | insert("() => {}") 146 | key(left enter) 147 | 148 | state map: 149 | insert(".map()") 150 | key(left) 151 | 152 | state filter: 153 | insert(".filter()") 154 | key(left) 155 | 156 | state reduce: 157 | insert(".reduce()") 158 | key(left) 159 | 160 | state spread: "..." 161 | -------------------------------------------------------------------------------- /lang/operators.talon: -------------------------------------------------------------------------------- 1 | 2 | tag: user.code_operators 3 | - 4 | #pointer operators 5 | op deference: user.code_operator_indirection() 6 | op address of: user.code_operator_address_of() 7 | op arrow: user.code_operator_structure_deference() 8 | #lambda 9 | op lambda: user.code_operator_lambda() 10 | #subscript 11 | op subscript: user.code_operator_subscript() 12 | #assignment 13 | op (equals | assign): user.code_operator_assignment() 14 | #math operators 15 | op (minus | subtract): user.code_operator_subtraction() 16 | op (minus | subtract) equals: user.code_operator_subtraction_assignment() 17 | op (plus | add): user.code_operator_addition() 18 | op (plus | add) equals: user.code_operator_addition() 19 | op (times | multiply): user.code_operator_multiplication() 20 | op (times | multiply) equals: user.code_operator_multiplication_assignment() 21 | op divide: user.code_operator_division() 22 | op divide equals: user.code_operator_division_assignment() 23 | op mod: user.code_operator_modulo() 24 | op mod equals: user.code_operator_modulo_assignment() 25 | (op (power | exponent) | to the power [of]): user.code_operator_exponent() 26 | #comparison operators 27 | (op | is) equal: user.code_operator_equal() 28 | (op | is) not equal: user.code_operator_not_equal() 29 | (op | is) (greater | more): user.code_operator_greater_than() 30 | (op | is) (less | below) [than]: user.code_operator_less_than() 31 | (op | is) greater [than] or equal: user.code_operator_greater_than_or_equal_to() 32 | (op | is) less [than] or equal: user.code_operator_less_than_or_equal_to() 33 | #logical operators 34 | (op | logical) and: user.code_operator_and() 35 | (op | logical) or: user.code_operator_or() 36 | #bitwise operators 37 | [op] bitwise and: user.code_bitwise_operator_and() 38 | (op | logical | bitwise) and equals: user.code_bitwise_operator_and_equals() 39 | [op] bitwise or: user.code_bitwise_operator_or() 40 | (op | logical | bitwise) or equals: user.code_bitwise_operator_or_equals() 41 | (op | logical | bitwise) (ex | exclusive) or: user.code_bitwise_operator_exlcusive_or() 42 | (op | logical | bitwise) (left shift | shift left): user.code_bitwise_operator_left_shift() 43 | (op | logical | bitwise) (right shift | shift right): user.code_bitwise_operator_right_shift() 44 | (op | logical | bitwise) (ex | exclusive) or equals: user.code_bitwise_operator_exlcusive_or_equals() 45 | [(op | logical | bitwise)] (left shift | shift left) equals: user.code_bitwise_operator_left_shift_equals() 46 | [(op | logical | bitwise)] (left right | shift right) equals: user.code_bitwise_operator_right_shift_equals() 47 | #tbd 48 | (op | pad) colon: " : " 49 | -------------------------------------------------------------------------------- /lang/programming.talon: -------------------------------------------------------------------------------- 1 | tag: user.code_generic 2 | - 3 | #todo should we have a keyword list? type list capture? stick with "word"? 4 | #state in: insert(" in ") 5 | is not none: user.code_is_not_null() 6 | is none: user.code_is_null() 7 | #todo: types? 8 | #word (dickt | dictionary): user.code_type_dictionary() 9 | state if: user.code_state_if() 10 | state else if: user.code_state_else_if() 11 | state else: user.code_state_else() 12 | state self: user.code_self() 13 | #todo: this is valid for many languages, 14 | # but probably not all 15 | self dot: 16 | user.code_self() 17 | insert(".") 18 | state while: user.code_state_while() 19 | state for: user.code_state_for() 20 | state for in: user.code_state_for_each() 21 | state switch: user.code_state_switch() 22 | state case: user.code_state_case() 23 | state do: user.code_state_do() 24 | state goto: user.code_state_go_to() 25 | state return: user.code_state_return() 26 | state import: user.code_import() 27 | from import: user.code_from_import() 28 | state class: user.code_type_class() 29 | state include: user.code_include() 30 | state include system: user.code_include_system() 31 | state include local: user.code_include_local() 32 | state type deaf: user.code_type_definition() 33 | state type deaf struct: user.code_typedef_struct() 34 | state (no | nil): user.code_null() 35 | ^funky $: 36 | #todo: once .talon action definitions can take parameters, combine these functions 37 | user.code_private_function() 38 | user.code_private_function_formatter(user.text) 39 | insert("()") 40 | edit.left() 41 | sleep(100ms) 42 | ^pro funky $: 43 | #todo: once .talon action definitions can take parameters, combine these functions 44 | user.code_protected_function() 45 | user.code_protected_function_formatter(user.text) 46 | #() surely isn't correct for all languages, will be part of the combined function above 47 | insert("()") 48 | key(left) 49 | sleep(100ms) 50 | ^pub funky $: 51 | #todo: once .talon action definitions can take parameters, combine these functions 52 | user.code_public_function() 53 | user.code_public_function_formatter(user.text) 54 | sleep(50ms) 55 | insert("()") 56 | ^static funky $: 57 | #todo: once .talon action definitions can take parameters, combine these functions 58 | user.code_private_static_function() 59 | user.code_private_function_formatter(user.text) 60 | ^pro static funky $: 61 | #todo: once .talon action definitions can take parameters, combine these functions 62 | user.code_protected_static_function() 63 | user.code_protected_function_formatter(user.text) 64 | ^pub static funky $: 65 | #todo: once .talon action definitions can take parameters, combine these functions 66 | user.code_public_static_function() 67 | user.code_public_function_formatter(user.text) 68 | -------------------------------------------------------------------------------- /lang/python.talon: -------------------------------------------------------------------------------- 1 | mode: user.python 2 | mode: command 3 | and code.language: python 4 | - 5 | tag(): user.code_operators 6 | tag(): user.code_comment 7 | tag(): user.code_generic 8 | settings(): 9 | user.code_private_function_formatter = "SNAKE_CASE" 10 | user.code_protected_function_formatter = "SNAKE_CASE" 11 | user.code_public_function_formatter = "SNAKE_CASE" 12 | user.code_private_variable_formatter = "SNAKE_CASE" 13 | user.code_protected_variable_formatter = "SNAKE_CASE" 14 | user.code_public_variable_formatter = "SNAKE_CASE" 15 | action(user.code_operator_indirection): "" 16 | action(user.code_operator_address_of): "" 17 | action(user.code_operator_structure_deference): "" 18 | action(user.code_operator_lambda): "" 19 | action(user.code_operator_subscript): 20 | insert("[]") 21 | key(left) 22 | action(user.code_operator_assignment): " = " 23 | action(user.code_operator_subtraction): " - " 24 | action(user.code_operator_subtraction_assignment): " -= " 25 | action(user.code_operator_addition): " + " 26 | action(user.code_operator_addition_assignment): " += " 27 | action(user.code_operator_multiplication): " * " 28 | action(user.code_operator_multiplication_assignment): " *= " 29 | action(user.code_operator_exponent): " ** " 30 | action(user.code_operator_division): " / " 31 | action(user.code_operator_division_assignment): " /= " 32 | action(user.code_operator_modulo): " % " 33 | action(user.code_operator_modulo_assignment): " %= " 34 | action(user.code_operator_equal): " == " 35 | action(user.code_operator_not_equal): " != " 36 | action(user.code_operator_greater_than): " > " 37 | action(user.code_operator_greater_than_or_equal_to): " >= " 38 | action(user.code_operator_less_than): " < " 39 | action(user.code_operator_less_than_or_equal_to): " <= " 40 | action(user.code_operator_and): " and " 41 | action(user.code_operator_or): " or " 42 | action(user.code_operator_bitwise_and): " & " 43 | action(user.code_operator_bitwise_and_assignment): " &= " 44 | action(user.code_operator_bitwise_or): " | " 45 | action(user.code_operator_bitwise_or_assignment): " |= " 46 | action(user.code_operator_bitwise_exlcusive_or): " ^ " 47 | action(user.code_operator_bitwise_exlcusive_or_assignment): " ^= " 48 | action(user.code_operator_bitwise_left_shift): " << " 49 | action(user.code_operator_bitwise_left_shift_assignment): " <<= " 50 | action(user.code_operator_bitwise_right_shift): " >> " 51 | action(user.code_operator_bitwise_right_shift_assignment): " >>= " 52 | action(user.code_self): "self" 53 | action(user.code_null): "None" 54 | action(user.code_is_null): " is None" 55 | action(user.code_is_not_null): " is not None" 56 | action(user.code_state_if): 57 | insert("if :") 58 | key(left) 59 | action(user.code_state_else_if): 60 | insert("elif :") 61 | key(left) 62 | action(user.code_state_else): 63 | insert("else:") 64 | key(enter) 65 | action(user.code_state_switch): 66 | insert("switch ()") 67 | edit.left() 68 | action(user.code_state_case): 69 | insert("case \nbreak;") 70 | edit.up() 71 | action(user.code_state_for): "for " 72 | action(user.code_state_for_each): 73 | insert("for in ") 74 | key(left) 75 | edit.word_left() 76 | key(space) 77 | edit.left() 78 | action(user.code_state_go_to): "go to " 79 | action(user.code_state_while): 80 | insert("while ()") 81 | edit.left() 82 | action(user.code_type_definition): "typedef " 83 | action(user.code_typedef_struct): 84 | insert("typedef struct") 85 | insert("{{\n\n}}") 86 | edit.up() 87 | key(tab) 88 | action(user.code_type_class): "class " 89 | action(user.code_import): "import " 90 | action(user.code_from_import): 91 | insert("from import ") 92 | key(left) 93 | edit.word_left() 94 | key(space) 95 | edit.left() 96 | action(user.code_include_system): 97 | insert("#include <>") 98 | edit.left() 99 | action(user.code_include_local): 100 | insert('#include ""') 101 | edit.left() 102 | action(user.code_comment): "#" 103 | action(user.code_private_function): 104 | insert("def _") 105 | action(user.code_protected_function): 106 | user.code_private_function() 107 | action(user.code_public_function): 108 | insert("def ") 109 | action(user.code_state_return): 110 | insert("return ") 111 | 112 | #python-specicic grammars 113 | dunder in it: insert("__init__") 114 | state (def | deaf | deft): "def " 115 | pie test: "pytest" 116 | -------------------------------------------------------------------------------- /lang/react.talon: -------------------------------------------------------------------------------- 1 | 2 | # elm : 3 | # "<" 4 | # insert(user.text) 5 | # ">" 6 | # key("enter") 7 | # elm : 8 | # user.react_create_element(user.text) 9 | 10 | # action(user.react_create_element): 11 | # "hello2" 12 | 13 | # boo: "ysa" 14 | 15 | [over]: insert(create_element) 16 | [over]: 17 | insert(create_closed_element) 18 | key('left left left') 19 | 20 | [over]: insert(create_native_element) 21 | [over]: 22 | insert(create_image) 23 | key('left left left left left left left left left left left') 24 | 25 | [over]: 26 | insert(create_styled_component) 27 | key('left enter enter up tab') 28 | [over]: 29 | insert(create_styled_wrapper) 30 | key('left enter enter up up end left left') 31 | 32 | [over]: 33 | insert(create_function_component) 34 | key('left enter') 35 | 36 | fragment: 37 | insert("<>") 38 | key('left left left enter') 39 | 40 | react: insert("import React from 'react';") 41 | 42 | : insert(default_import) 43 | : insert(component_import) 44 | : insert(hook_import) 45 | 46 | : 47 | insert(text_attribute) 48 | key('left') 49 | : 50 | insert(squiggly_attribute) 51 | key('left') 52 | 53 | : 54 | insert(state_hook) 55 | key('left left') 56 | : 57 | insert(rough_hook) 58 | effect hook: 59 | insert('React.useEffect(() => {}, []);') 60 | key('left left left left left left left enter') 61 | 62 | 63 | 64 | # todo: Move these to their own Talon file 65 | const: insert('const ') 66 | letuce: insert('let ') 67 | note environment: insert('process.env.NODE_ENV') 68 | save: key('cmd-s') 69 | console: 70 | insert('console.log();') 71 | key('left left') 72 | new dep: 73 | insert('yarn add ') 74 | -------------------------------------------------------------------------------- /lang/sql.talon: -------------------------------------------------------------------------------- 1 | app: DataGrip 2 | 3 | - 4 | select: "SELECT " 5 | star: "*" 6 | from: "FROM " 7 | select star from: "SELECT * FROM " 8 | where: "WHERE " 9 | order by: "ORDER BY " 10 | descending: " DESC" 11 | ascending: " ASC" 12 | dot i d: ".id" 13 | is not null: " IS NOT NULL" 14 | is null: " IS NULL" 15 | inner join: 16 | insert("INNER JOIN ON ") 17 | key(left) 18 | key(left) 19 | key(left) 20 | key(left) 21 | -------------------------------------------------------------------------------- /lang/talon.talon: -------------------------------------------------------------------------------- 1 | mode: user.talon 2 | mode: command 3 | and code.language: talon 4 | - 5 | tag(): user.code_operators 6 | tag(): user.code_comment 7 | action(user.code_operator_and): " and " 8 | action(user.code_operator_or): " or " 9 | action(user.code_operator_subtraction): " - " 10 | action(user.code_operator_addition): " + " 11 | action(user.code_operator_multiplication): " * " 12 | action(user.code_operator_division): " / " 13 | action(user.code_operator_assignment): " = " 14 | action(user.code_comment): "#" 15 | 16 | dot talon: insert(".talon") 17 | insert: 18 | insert("insert('')") 19 | edit.left() 20 | edit.left() 21 | key: 22 | insert('key()') 23 | edit.left() 24 | key: "{modifiers}" 25 | 26 | action: 27 | insert("action():") 28 | edit.left() 29 | os win: 30 | insert("os: windows") 31 | os mac: 32 | insert("os: mac") 33 | os lunix: 34 | insert("os: linux") 35 | app: 36 | insert("app: ") 37 | settings: 38 | insert("settings():\n") 39 | tag set: 40 | insert("tag(): ") 41 | tag require: 42 | insert("tag: ") 43 | user: 44 | insert("user.") 45 | repeat: 46 | insert("repeat()") 47 | edit.left() 48 | -------------------------------------------------------------------------------- /lang/typescript.talon: -------------------------------------------------------------------------------- 1 | mode: user.typescript 2 | mode: command 3 | and code.language: typescript 4 | - 5 | tag(): user.code_operators 6 | tag(): user.code_comment 7 | tag(): user.code_generic 8 | 9 | settings(): 10 | user.code_private_function_formatter = "PRIVATE_CAMEL_CASE" 11 | user.code_protected_function_formatter = "PRIVATE_CAMEL_CASE" 12 | user.code_public_function_formatter = "PRIVATE_CAMEL_CASE" 13 | user.code_private_variable_formatter = "PRIVATE_CAMEL_CASE" 14 | user.code_protected_variable_formatter = "PRIVATE_CAMEL_CASE" 15 | user.code_public_variable_formatter = "PRIVATE_CAMEL_CASE" 16 | 17 | action(user.code_is_not_null): " !== null" 18 | 19 | action(user.code_is_null): " === null" 20 | 21 | action(user.code_type_dictionary): 22 | insert("{}") 23 | key(left) 24 | 25 | action(user.code_state_if): 26 | insert("if ()") 27 | key(left) 28 | 29 | action(user.code_state_else_if): 30 | insert(" else if ()") 31 | key(left) 32 | 33 | action(user.code_state_else): 34 | insert(" else {}") 35 | key(left enter) 36 | 37 | action(user.code_self): "this" 38 | 39 | action(user.code_state_while): 40 | insert("while ()") 41 | key(left) 42 | 43 | action(user.code_state_do): 44 | insert("do ") 45 | 46 | action(user.code_state_return): 47 | insert("return ") 48 | 49 | action(user.code_state_for): 50 | insert("for ()") 51 | key(left) 52 | 53 | action(user.code_state_switch): 54 | insert("switch ()") 55 | key(left) 56 | 57 | action(user.code_state_case): "case :" 58 | 59 | action(user.code_state_go_to): "" 60 | 61 | action(user.code_import): "import " 62 | 63 | action(user.code_from_import): 64 | insert(" from \"\"") 65 | key(left) 66 | 67 | action(user.code_type_class): "class " 68 | 69 | action(user.code_include): "" 70 | 71 | action(user.code_include_system): "" 72 | 73 | action(user.code_include_local): "" 74 | 75 | action(user.code_type_definition): "" 76 | 77 | action(user.code_typedef_struct): "" 78 | 79 | action(user.code_state_for_each): 80 | insert(".forEach()") 81 | key(left) 82 | 83 | action(user.code_null): "null" 84 | 85 | action(user.code_private_function): "private " 86 | action(user.code_protected_function): "protected " 87 | action(user.code_public_function): "public " 88 | 89 | action(user.code_operator_indirection): "" 90 | action(user.code_operator_address_of): "" 91 | action(user.code_operator_structure_deference): "" 92 | action(user.code_operator_lambda): " => " 93 | action(user.code_operator_subscript): 94 | insert("[]") 95 | key(left) 96 | action(user.code_operator_assignment): " = " 97 | action(user.code_operator_subtraction): " - " 98 | action(user.code_operator_subtraction_assignment): " -= " 99 | action(user.code_operator_addition): " + " 100 | action(user.code_operator_addition_assignment): " += " 101 | action(user.code_operator_multiplication): " * " 102 | action(user.code_operator_multiplication_assignment): " *= " 103 | action(user.code_operator_exponent): " ** " 104 | action(user.code_operator_division): " / " 105 | action(user.code_operator_division_assignment): " /= " 106 | action(user.code_operator_modulo): " % " 107 | action(user.code_operator_modulo_assignment): " %= " 108 | action(user.code_operator_equal): " == " 109 | action(user.code_operator_not_equal): " != " 110 | (op | is) strict equal: " === " 111 | (op | is) strict not equal: " !== " 112 | action(user.code_operator_greater_than): " > " 113 | action(user.code_operator_greater_than_or_equal_to): " >= " 114 | action(user.code_operator_less_than): " < " 115 | action(user.code_operator_less_than_or_equal_to): " <= " 116 | action(user.code_operator_and): " && " 117 | action(user.code_operator_or): " || " 118 | action(user.code_operator_bitwise_and): " & " 119 | action(user.code_operator_bitwise_and_assignment): " &= " 120 | action(user.code_operator_bitwise_or): " | " 121 | action(user.code_operator_bitwise_or_assignment): " |= " 122 | action(user.code_operator_bitwise_exlcusive_or): " ^ " 123 | action(user.code_operator_bitwise_exlcusive_or_assignment): " ^= " 124 | action(user.code_operator_bitwise_left_shift): " << " 125 | action(user.code_operator_bitwise_left_shift_assignment): " <<= " 126 | action(user.code_operator_bitwise_right_shift): " >> " 127 | action(user.code_operator_bitwise_right_shift_assignment): " >>= " 128 | 129 | state block: 130 | insert("{}") 131 | key(left enter) 132 | 133 | state const: "const " 134 | 135 | state let: "let " 136 | 137 | state var: "var " 138 | 139 | state async: "async " 140 | 141 | state await: "await " 142 | 143 | state map: 144 | insert(".map()") 145 | key(left) 146 | 147 | state filter: 148 | insert(".filter()") 149 | key(left) 150 | 151 | state reduce: 152 | insert(".reduce()") 153 | key(left) 154 | 155 | state spread: "..." 156 | -------------------------------------------------------------------------------- /misc/abbreviate.talon: -------------------------------------------------------------------------------- 1 | - 2 | (abbreviate|abreviate|brief) : "{abbreviation}" 3 | -------------------------------------------------------------------------------- /misc/formatters.talon: -------------------------------------------------------------------------------- 1 | #provide both anchored and unachored commands via 'over' 2 | $: insert(format_text) 3 | over: insert(format_text) 4 | phrase $: insert(user.text) 5 | phrase over: insert(user.text) 6 | word : insert(user.word) 7 | list formatters: user.list_formatters() 8 | hide formatters: user.hide_formatters() 9 | ^nope that$: user.clear_last_phrase() 10 | ^nope that was $: 11 | user.clear_last_phrase() 12 | insert(user.reformat_last_phrase(user.formatters)) 13 | -------------------------------------------------------------------------------- /misc/git.talon: -------------------------------------------------------------------------------- 1 | 2 | # Standard commands 3 | git add patch: "git add . -p\n" 4 | git add: "git add " 5 | git add everything: "git add .\n" 6 | git bisect: "git bisect " 7 | git blame: "git blame " 8 | git branch: "git branch " 9 | git branch : "git branch {text}" 10 | git checkout: "git checkout " 11 | git checkout master: "git checkout master\n" 12 | git checkout main: "git checkout main\n" 13 | git checkout : "git checkout {text}" 14 | git cherry pick: "git cherry-pick " 15 | git clone: "git clone " 16 | git commit message : "git commit -m '{text}'" 17 | git commit: "git commit\n" 18 | git diff (colour|color) words: "git diff --color-words " 19 | git diff: "git diff " 20 | git diff cached: "git diff --cached\n" 21 | git fetch: "git fetch\n" 22 | git fetch : "git fetch {text}" 23 | git in it: "git init\n" 24 | git log: "git log\n" 25 | git merge: "git merge " 26 | git merge :"git merge {text}" 27 | git move: "git mv " 28 | git new branch: "git checkout -b " 29 | git pull: "git pull\n" 30 | git pull origin: "git pull origin " 31 | git pull rebase: "git pull --rebase\n" 32 | git pull fast forward: "git pull --ff-only\n" 33 | git pull : "git pull {text} " 34 | git push: "git push\n" 35 | git push origin: "git push origin " 36 | git push up stream origin: "git push -u origin" 37 | git push : "git push {text} " 38 | git push tags: "git push --tags\n" 39 | git rebase: "git rebase\n" 40 | git rebase continue: "git rebase --continue" 41 | git rebase skip: "git rebase --skip" 42 | git remove: "git rm " 43 | git (remove|delete) branch: "git branch -d " 44 | git (remove|delete) remote branch: "git push --delete " 45 | git reset: "git reset " 46 | git reset soft: "git reset --soft " 47 | git reset hard: "git reset --hard " 48 | git show: "git show " 49 | git stash pop: "git stash pop\n" 50 | git stash apply: "git stash apply\n" 51 | git stash: "git stash\n" 52 | git status: "gg\n" 53 | git tag: "git tag " 54 | 55 | # Convenience 56 | git edit config: "git config --local -e\n" 57 | 58 | git clone clipboard: 59 | insert("git clone ") 60 | edit.paste() 61 | key(enter) 62 | git diff highlighted: 63 | edit.copy() 64 | insert("git diff ") 65 | edit.paste() 66 | key(enter) 67 | git diff clipboard: 68 | insert("git diff ") 69 | edit.paste() 70 | key(enter) 71 | git add highlighted: 72 | edit.copy() 73 | insert("git add ") 74 | edit.paste() 75 | key(enter) 76 | git add clipboard: 77 | insert("git add ") 78 | edit.paste() 79 | key(enter) 80 | git commit highlighted: 81 | edit.copy() 82 | insert("git add ") 83 | edit.paste() 84 | insert("\ngit commit\n") 85 | -------------------------------------------------------------------------------- /misc/git_add_patch.talon: -------------------------------------------------------------------------------- 1 | app: /.*terminal/ 2 | app: /.*term/ 3 | app: Cmd.exe 4 | title: /git add .*\-p/ 5 | - 6 | yank: 7 | key(y) 8 | key(enter) 9 | near: 10 | key(n) 11 | key(enter) 12 | quench: 13 | key(q) 14 | key(enter) 15 | drum: 16 | key(d) 17 | key(enter) 18 | air: 19 | key(a) 20 | key(enter) 21 | -------------------------------------------------------------------------------- /misc/help.talon: -------------------------------------------------------------------------------- 1 | - 2 | settings(): 3 | user.help_max_contexts_per_page = 20 4 | user.help_max_command_lines_per_page = 50 5 | 6 | help alphabet: user.help_alphabet(user.get_alphabet()) 7 | help context$: user.help_context() 8 | help active$: user.help_context_enabled() 9 | help search $: user.help_search(text) 10 | help context $: user.help_selected_context(user.help_contexts) 11 | 12 | 13 | -------------------------------------------------------------------------------- /misc/help_open.talon: -------------------------------------------------------------------------------- 1 | mode: user.help 2 | - 3 | help next$: user.help_next() 4 | help previous$: user.help_previous() 5 | help $: user.help_select_index(number - 1) 6 | help return$: user.help_return() 7 | help close$: user.help_hide() -------------------------------------------------------------------------------- /misc/history.talon: -------------------------------------------------------------------------------- 1 | show command history: user.history_enable() 2 | hide command history: user.history_disable() 3 | clear command history: user.history_clear() 4 | -------------------------------------------------------------------------------- /misc/keys.talon: -------------------------------------------------------------------------------- 1 | go : key(arrows) 2 | : key(number) 3 | : key(letter) 4 | (ship | uppercase) [(lowercase | sunk)]: 5 | user.keys_uppercase_letters(letters) 6 | : key(symbol) 7 | : key(function) 8 | : key(special) 9 | : key(key) 10 | -------------------------------------------------------------------------------- /misc/mouse.talon: -------------------------------------------------------------------------------- 1 | settings(): 2 | #stop continuous scroll/gaze scroll with a pop 3 | user.mouse_enable_pop_stops_scroll = 0 4 | #enable pop click with 'control mouse' mode 5 | user.mouse_enable_pop_click = 1 6 | #hide cursor when mouse_wake is called to enable zoom mouse 7 | user.mouse_wake_hides_cursor = 0 8 | control mouse: user.mouse_toggle_control_mouse() 9 | zoom mouse: user.mouse_toggle_zoom_mouse() 10 | camera overlay: eye_mouse.camera_overlay.toggle() 11 | run calibration: user.mouse_calibrate() 12 | : mouse_click(mouse_index) 13 | : 14 | key("{modifiers}:down") 15 | mouse_click(mouse_index) 16 | key("{modifiers}:up") 17 | (dubclick | duke): 18 | mouse_click() 19 | mouse_click() 20 | (tripclick | triplick): 21 | mouse_click() 22 | mouse_click() 23 | mouse_click() 24 | wheel down: user.mouse_scroll_down() 25 | wheel tiny [down]: mouse_scroll(20) 26 | wheel downer: user.mouse_scroll_down_continuous() 27 | wheel up: user.mouse_scroll_up() 28 | wheel tiny up: mouse_scroll(-20) 29 | wheel upper: user.mouse_scroll_up_continuous() 30 | wheel gaze: user.mouse_gaze_scroll() 31 | wheel stop: user.mouse_scroll_stop() 32 | wheel left: mouse_scroll(0, -40) 33 | wheel tiny left: mouse_scroll(0, -20) 34 | wheel right: mouse_scroll(0, 40) 35 | wheel tiny right: mouse_scroll(0, 20) 36 | curse yes: user.mouse_show_cursor() 37 | curse no: user.mouse_hide_cursor() 38 | drag: user.mouse_drag() -------------------------------------------------------------------------------- /misc/repeater.talon: -------------------------------------------------------------------------------- 1 | # -1 because we are repeating, so the initial command counts as one 2 | : core.repeat_command(ordinals-1) 3 | (repeat that|twice): core.repeat_command(1) 4 | repeat that [times]: core.repeat_command(number) 5 | -------------------------------------------------------------------------------- /misc/screenshot.talon: -------------------------------------------------------------------------------- 1 | ^grab window$: user.screenshot_window() 2 | ^grab screen$: user.screenshot() 3 | ^grab selection$: user.screenshot_selection() 4 | ^grab window clip$: user.screenshot_window_clipboard() 5 | ^grab screen clip$: user.screenshot_clipboard() -------------------------------------------------------------------------------- /misc/standard.talon: -------------------------------------------------------------------------------- 1 | slap: 2 | edit.line_end() 3 | key(enter) 4 | cd: "cd " 5 | grep: "grep " 6 | elle less: "ls " 7 | run L S: "ls\n" 8 | run (S S H | S H): "ssh" 9 | diff: "diff " 10 | dot pie: ".py" 11 | run vim: "vim " 12 | run make: "make\n" 13 | run make (durr | dear): "mkdir " 14 | (jay son | jason ): "json" 15 | (http | htp): "http" 16 | tls: "tls" 17 | M D five: "md5" 18 | (regex | rejex): "regex" 19 | word queue: "queue" 20 | word eye: "eye" 21 | word iter: "iter" 22 | word no: "NULL" 23 | word cmd: "cmd" 24 | word dup: "dup" 25 | word streak: 26 | insert("streq()") 27 | key(left) 28 | word printf: "printf" 29 | word shell: "shell" 30 | dunder in it: "__init__" 31 | args: 32 | insert("()") 33 | key(left) 34 | [inside] (index | array): 35 | insert("[]") 36 | key(left) 37 | empty array: "[]" 38 | list in it: 39 | insert("[]") 40 | key(left) 41 | (dickt in it | inside bracket | in bracket): 42 | insert("{}") 43 | key(left) 44 | block: 45 | insert("{}") 46 | key(left enter enter up tab) 47 | (in | inside) percent: 48 | insert("%%") 49 | key(left) 50 | string U T F eight: 51 | insert("'utf8'") 52 | state past: "pass" 53 | zoom [in]: edit.zoom_in() 54 | zoom out: edit.zoom_out() 55 | (page | scroll) up: key(pgup) 56 | (page | scroll) down: key(pgdown) 57 | copy that: edit.copy() 58 | cut that: edit.cut() 59 | paste that: edit.paste() 60 | paste match: edit.paste_match_style() 61 | file save: edit.save() 62 | #menu help: key(F1) 63 | #spotlight: key(super) 64 | undo that: edit.undo() 65 | redo that: edit.redo() 66 | volume up: key(volup) 67 | volume down: key(voldown) 68 | mute: key(mute) 69 | play next: key(next) 70 | play previous: key(prev) 71 | (play | pause): key(play_pause) 72 | wipe: key(backspace) 73 | (pad | padding): 74 | insert(" ") 75 | key(left) 76 | funny: "ha ha" 77 | #menu: key(alt) 78 | 79 | 80 | -------------------------------------------------------------------------------- /misc/tabs.talon: -------------------------------------------------------------------------------- 1 | tag: tabs 2 | - 3 | (open | new) tab: app.tab_open() 4 | last tab: app.tab_previous() 5 | next tab: app.tab_next() 6 | close tab: app.tab_close() 7 | reopen tab: app.tab_reopen() 8 | -------------------------------------------------------------------------------- /misc/talon_helpers.talon: -------------------------------------------------------------------------------- 1 | talon copy context: user.talon_add_context_clipboard() 2 | talon dump context: 3 | name = app.name() 4 | executable = app.executable() 5 | bundle = app.bundle() 6 | title = win.title() 7 | print("Name: {name}") 8 | print("Executable: {executable}") 9 | print("Bundle: {bundle}") 10 | print("Title: {title}") 11 | -------------------------------------------------------------------------------- /misc/temp.talon: -------------------------------------------------------------------------------- 1 | project client: insert('cd client && yarn && yarn start') 2 | project server: insert('cd server && yarn && yarn start:server') 3 | -------------------------------------------------------------------------------- /misc/toggles.talon: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /misc/window_management.talon: -------------------------------------------------------------------------------- 1 | new window: app.window_open() 2 | next window: app.window_next() 3 | last window: app.window_previous() 4 | close window: app.window_close() 5 | focus : user.switcher_focus(running_applications) 6 | list running: user.switcher_list_running() 7 | hide running: user.switcher_hide_running() 8 | -------------------------------------------------------------------------------- /modes/dictation_mode.talon: -------------------------------------------------------------------------------- 1 | mode: dictation 2 | - 3 | : 4 | insert(user.text) 5 | insert(" ") 6 | enter: key(enter) 7 | period: key(backspace . space) 8 | comma: key(backspace , space) 9 | question [mark]: key(backspace ? space) 10 | (bang | exclamation [mark]): key(backspace ! space) -------------------------------------------------------------------------------- /modes/modes.talon: -------------------------------------------------------------------------------- 1 | #defines the various mode commands 2 | mode: all 3 | - 4 | welcome back: 5 | user.mouse_wake() 6 | user.history_enable() 7 | speech.enable() 8 | sleep all: 9 | user.switcher_hide_running() 10 | user.history_disable() 11 | user.homophones_hide() 12 | user.help_hide() 13 | user.mouse_sleep() 14 | speech.disable() 15 | user.engine_sleep() 16 | talon sleep: speech.disable() 17 | talon wake: speech.enable() 18 | dragon mode: speech.disable() 19 | talon mode: speech.enable() 20 | ^dictation mode$: 21 | mode.disable("sleep") 22 | mode.disable("command") 23 | mode.enable("dictation") 24 | ^command mode$: 25 | mode.disable("sleep") 26 | mode.disable("dictation") 27 | mode.enable("command") 28 | [enable] debug mode: 29 | mode.enable("user.gdb") 30 | disable debug mode: 31 | mode.disable("user.gdb") 32 | ^force see sharp$: user.code_set_language_mode("csharp") 33 | ^force see plus plus$: user.code_set_language_mode("cplusplus") 34 | ^force go (lang|language)$: user.code_set_language_mode("go") 35 | ^force java script$: user.code_set_language_mode("javascript") 36 | ^force type script$: user.code_set_language_mode("typescript") 37 | ^force markdown$: user.code_set_language_mode("markdown") 38 | ^force python$: user.code_set_language_mode("python") 39 | ^force talon [language]$: user.code_set_language_mode("talon") 40 | ^clear language modes$: user.code_clear_language_mode() 41 | -------------------------------------------------------------------------------- /modes/sleep_mode.talon: -------------------------------------------------------------------------------- 1 | mode: sleep 2 | - 3 | settings(): 4 | #stop continuous scroll/gaze scroll with a pop 5 | user.mouse_enable_pop_stops_scroll = 0 6 | #enable pop click with 'control mouse' mode 7 | user.mouse_enable_pop_click = 0 8 | #this exists solely to prevent talon from walking up super easily in sleep mode at the moment with wav2letter 9 | : skip() 10 | -------------------------------------------------------------------------------- /scale.py: -------------------------------------------------------------------------------- 1 | from talon import Context 2 | ctx = Context() 3 | ctx.settings['imgui.scale'] = 1.3 -------------------------------------------------------------------------------- /text/generic_editor.talon: -------------------------------------------------------------------------------- 1 | find it: 2 | edit.find() 3 | 4 | next one: 5 | edit.find_next() 6 | 7 | go word left: 8 | edit.word_left() 9 | 10 | go word right: 11 | edit.word_right() 12 | 13 | go left: 14 | edit.left() 15 | 16 | go right: 17 | edit.right() 18 | 19 | go up: 20 | edit.up() 21 | 22 | go down: 23 | edit.down() 24 | 25 | go line start: 26 | edit.line_start() 27 | 28 | go line end: 29 | edit.line_end() 30 | 31 | go way left: 32 | edit.line_start() 33 | edit.line_start() 34 | 35 | go way right: 36 | edit.line_end() 37 | 38 | go way down: 39 | edit.file_end() 40 | 41 | go way up: 42 | edit.file_start() 43 | 44 | go page down: 45 | edit.page_down() 46 | 47 | go page up: 48 | edit.page_up() 49 | 50 | # selecting 51 | select line: 52 | edit.line_start() 53 | edit.extend_line_end() 54 | 55 | select all: 56 | edit.select_all() 57 | 58 | 59 | select left: 60 | edit.extend_left() 61 | 62 | select right: 63 | edit.extend_right() 64 | 65 | select up: 66 | edit.extend_line_up() 67 | 68 | select down: 69 | edit.extend_line_down() 70 | 71 | select word left: 72 | edit.extend_word_left() 73 | 74 | select word right: 75 | edit.extend_word_right() 76 | 77 | select way left: 78 | edit.extend_line_start() 79 | 80 | select way right: 81 | edit.extend_line_end() 82 | 83 | select way up: 84 | edit.extend_file_start() 85 | 86 | select way down: 87 | edit.extend_file_end() 88 | 89 | # editing 90 | indent [more]: 91 | edit.indent_more() 92 | 93 | (indent less | out dent): 94 | edit.indent_less() 95 | 96 | # deleting 97 | clear line: 98 | edit.delete_line() 99 | 100 | clear left: 101 | key(backspace) 102 | 103 | clear right: 104 | key(delete) 105 | 106 | clear up: 107 | edit.extend_line_up() 108 | edit.delete() 109 | 110 | clear down: 111 | edit.extend_line_down() 112 | edit.delete() 113 | 114 | clear word left: 115 | edit.extend_word_left() 116 | edit.delete() 117 | 118 | clear word right: 119 | edit.extend_word_right() 120 | edit.delete() 121 | 122 | clear way left: 123 | edit.extend_line_start() 124 | edit.delete() 125 | 126 | clear way right: 127 | edit.extend_line_end() 128 | edit.delete() 129 | 130 | clear way up: 131 | edit.extend_file_start() 132 | edit.delete() 133 | 134 | clear way down: 135 | edit.extend_file_end() 136 | edit.delete() 137 | -------------------------------------------------------------------------------- /text/homophones.talon: -------------------------------------------------------------------------------- 1 | (phones | homophones) help: user.homophones_show_help() 2 | phones : user.homophones_show(homophones_canonical) 3 | phones: user.homophones_show_selection() 4 | force phones : user.homophones_force_show(homophones_canonical) 5 | force phones: user.homophones_force_show_selection() 6 | hide phones: user.homophones_hide() 7 | 8 | (pick | sell | cell) : 9 | insert(homophones_selection) 10 | user.homophones_hide() 11 | 12 | : 13 | insert(homophones_formatted_selection) 14 | user.homophones_hide() -------------------------------------------------------------------------------- /text/line_commands.talon: -------------------------------------------------------------------------------- 1 | tag: line_commands 2 | - 3 | # this line: user.idea_select(selection_verbs) 4 | whole line : user.select_whole_line(selection_verbs, number) 5 | line : user.select_line(selection_verbs, number) 6 | # until line : user.select_until_line(selection_verbs, number) 7 | until : user.select_range(selection_verbs, number_1, number_2) 8 | line: user.select_current_line(selection_verbs) 9 | way left: user.select_way_left(selection_verbs) 10 | way right: user.select_way_right(selection_verbs) 11 | way up: user.select_way_up(selection_verbs) 12 | way down: user.select_way_down(selection_verbs) 13 | camel left: user.select_camel_left(selection_verbs) 14 | camel right: user.select_camel_right(selection_verbs) 15 | 16 | all: user.select_all(selection_verbs) 17 | left: user.select_left(selection_verbs) 18 | right: user.select_right(selection_verbs) 19 | up: user.select_up(selection_verbs) 20 | down: user.select_down(selection_verbs) 21 | word left: user.select_word_left(selection_verbs) 22 | word right: user.select_word_right(selection_verbs) 23 | 24 | # Movement 25 | line : user.go_to_line(number, navigation_verbs) 26 | # next (error | air): user.ide_next_error(navigation_verbs) 27 | # last (error | air): user.ide_last_error(navigation_verbs) 28 | # camel left: user.move_camel_left(navigation_verbs) 29 | # camel right: user.move_camel_right(navigation_verbs) 30 | -------------------------------------------------------------------------------- /text/symbols.talon: -------------------------------------------------------------------------------- 1 | question [mark]: "?" 2 | (downscore | underscore): "_" 3 | double dash: "--" 4 | (bracket | brack | left bracket): "{" 5 | (rbrack | are bracket | right bracket): "}" 6 | triple quote: "'''" 7 | (dot dot | dotdot): ".." 8 | #ellipses: "…" 9 | ellipses: "..." 10 | (comma and | spamma): ", " 11 | plus: "+" 12 | arrow: "->" 13 | dub arrow: "=>" 14 | new line: "\\n" 15 | carriage return: "\\r" 16 | line feed: "\\r\\n" 17 | empty dubstring: 18 | '""' 19 | key(left) 20 | empty escaped (dubstring|dub quotes): 21 | '\\"\\"' 22 | key(left) 23 | key(left) 24 | empty string: 25 | "''" 26 | key(left) 27 | empty escaped string: 28 | "\\'\\'" 29 | key(left) 30 | key(left) --------------------------------------------------------------------------------