Skip to content

Commit

Permalink
Merge branch 'main' of github.com:talonhub/community
Browse files Browse the repository at this point in the history
* 'main' of github.com:talonhub/community: (73 commits)
  add lowercased firefox-esr to firefox.py (talonhub#1410)
  configurable number prefix without mouse grid (talonhub#1342)
  Update app.exe matching to work with both public and beta Talon (talonhub#1385)
  Add comment line to javascript (talonhub#1387)
  Add detail to documentation (talonhub#1380)
  Switch to black pre-commit mirror (talonhub#1378)
  Update app_name_overrides.windows.csv to use Windows Terminal instead of iTerm2 (talonhub#1379)
  [pre-commit.ci] pre-commit autoupdate (talonhub#1376)
  coalesce some list updates (talonhub#1348)
  Remove unused setting from c code language (talonhub#1368)
  mouse: adding synonyms for starting left drag. (talonhub#1356)
  Adds commands to focus on the last application (talonhub#1336)
  Stop using “brackets” to mean “braces” (talonhub#1344)
  Update settings descriptions (talonhub#1371)
  Revert changes to `user.mouse_enable_pop_click` (talonhub#1370)
  Fix typo in `mouse.py` variable name (talonhub#1372)
  Convert boolean settings to boolean (talonhub#1360)
  Add ruby op-or-equals command (talonhub#1347)
  added app name Mate-terminal (fork of Gnome-terminal) (talonhub#1367)
  added app name Caja (fork of Nautilus) (talonhub#1366)
  ...
  • Loading branch information
sisi-sh committed Apr 1, 2024
2 parents 96608a9 + aaa62f0 commit f150dff
Show file tree
Hide file tree
Showing 182 changed files with 2,663 additions and 1,068 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
minimum_pre_commit_version: "2.9.0"
minimum_pre_commit_version: "3.2.0"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -23,23 +23,23 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
- repo: https://github.com/ikamensh/flynt/
rev: "1.0.0"
rev: "1.0.1"
hooks:
- id: flynt
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
rev: v1.5.4
hooks:
- id: remove-tabs
types: [file]
Expand Down
6 changes: 5 additions & 1 deletion BREAKING_CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ applied given the delay between changes being submitted and the time they were r
and merged.

---
* 2023-06-06 Deprecate `go marks` command for VSCode. Use 'bar marks' instead.
* 2024-01-27 Deprecate '<user.number_string>' command without a spoken prefix like `numb`.
See `numbers.talon` and `numbers_unprefixed.talon.` If in the future you want to still use
unprefixed numbers, you will need to comment out the
`tag(): user.prefixed_numbers` line in your `settings.talon` file.
* 2023-06-06 Deprecate `go ` command for VSCode. Use 'bar marks' instead.
* 2023-02-04 Deprecate `murder` command for i3wm. Use 'win kill' instead.
* 2022-12-11 Deprecate user.insert_with_history. Just use `user.add_phrase_to_history(text);
insert(text)` instead. See #939.
Expand Down
41 changes: 14 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Note that it is also possible to install `community` by [downloading and extract
4. `help alphabet` will display the alphabet
5. `command history` will toggle a display of the recent commands
6. `help format` will display the available formatters with examples.
7. Many useful, basic commands are defined in https://github.com/talonhub/community/blob/main/core/edit/standard.talon
7. Many useful, basic commands are defined in https://github.com/talonhub/community/blob/main/core/edit/edit.talon
- `undo that` and `redo that` are the default undo/redo commands.
- `paste that`, `copy that`, and `cut that` for pasting/copy/cutting, respectively.
8. For community-generated documentation on Talon itself, please visit https://talon.wiki/
Expand Down Expand Up @@ -127,7 +127,7 @@ https://github.com/talonhub/community/blob/main/core/text/text.talon#L8

### Mouse commands

See https://github.com/talonhub/community/blob/main/plugin/mouse/mouse.talon
See https://github.com/talonhub/community/blob/main/plugin/mouse/mouse.talon for commands to click, drag, scroll, and use an eye tracker. To use a grid to click at a certain location on the screen, see [mouse_grid](https://github.com/talonhub/community/tree/main/core/mouse_grid).

### Generic editing commands

Expand Down Expand Up @@ -245,6 +245,8 @@ tag(): user.tabs
For instance, kubectl commands (kubernetes) aren't relevant to everyone.

Note also that while some of the command sets associated with these tags are defined in talon files within [tags](https://github.com/talonhub/community/tree/main/tags), others, like git, are defined within [apps](https://github.com/talonhub/community/tree/main/apps). Additionally, the commands for tabs are defined in [tabs.talon](https://github.com/talonhub/community/blob/main/core/windows_and_tabs/tabs.talon).

### Unix utilities

If you have a Unix (e.g. OSX) or Linux computer, you can enable support for a number of
Expand All @@ -264,34 +266,19 @@ with community enabled.
For Jetbrains commands to work you must install https://plugins.jetbrains.com/plugin/10504-voice-code-idea
into each editor.

## Settings
## Additional commands

Several options are configurable via a single settings file out of the box. Any setting can be made context specific as needed (e.g., per-OS, per-app, etc).
There are other commands not described fully within this file. As an overview:

https://github.com/talonhub/community/blob/main/settings.talon
- The apps folder has command sets for use within different applications
- The core folder has various commands described [here](https://github.com/talonhub/community/blob/main/core/README.md)
- The lang folder has commands for writing [programming languages](https://github.com/talonhub/community?tab=readme-ov-file#programming-languages)
- The plugin folder has various commands described [here](https://github.com/talonhub/community/blob/main/plugin/README.md)
- The tags folder has various other commands, such as using a browser, navigating a filesystem in terminal, and managing multiple cursors

```
#adjust the scale of the imgui to my liking
imgui.scale = 1.3
# enable if you'd like the picker gui to automatically appear when explorer has focus
user.file_manager_auto_show_pickers = 0
#set the max number of command lines per page in help
user.help_max_command_lines_per_page = 50
# set the max number of contexts display per page in help
user.help_max_contexts_per_page = 20
# The default amount used when scrolling continuously
user.mouse_continuous_scroll_amount = 80
#stop continuous scroll/gaze scroll with a pop
user.mouse_enable_pop_stops_scroll = 1
#enable pop click with 'control mouse' mode
user.mouse_enable_pop_click = 1
#When enabled, the 'Scroll Mouse' GUI will not be shown.
user.mouse_hide_mouse_gui = 0
#hide cursor when mouse_wake is called to enable zoom mouse
user.mouse_wake_hides_cursor = 0
#the amount to scroll up/down (equivalent to mouse wheel on Windows by default)
user.mouse_wheel_down_amount = 120
```
## Settings

Several options are configurable via a [single settings file](settings.talon) out of the box. Any setting can be made context specific as needed (e.g., per-OS, per-app, etc).

The most commonly adjusted settings are probably

Expand Down
6 changes: 3 additions & 3 deletions apps/adobe/adobe_acrobat_reader_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

# --- App definition ---
mod = Module()
mod.apps.adobe_acrobat_reader_dc = """
mod.apps.adobe_acrobat_reader_dc = r"""
os: windows
and app.name: Adobe Acrobat DC
os: windows
and app.exe: Acrobat.exe
and app.exe: /^acrobat\.exe$/i
os: windows
and app.name: Adobe Acrobat Reader DC
os: windows
and app.exe: AcroRd32.exe
and app.exe: /^acrord32\.exe$/i
"""
# TODO: mac context and implementation
28 changes: 28 additions & 0 deletions apps/arc/arc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from talon import Context, Module, actions, app

ctx = Context()
mod = Module()

mod.apps.arc = "app.name: Arc"
mod.apps.arc = """
os: mac
app.bundle: company.thebrowser.Browser
"""
ctx.matches = r"""
app: arc
"""


@ctx.action_class("user")
class UserActions:
def tab_close_wrapper():
actions.sleep("180ms")
actions.app.tab_close()


@ctx.action_class("browser")
class BrowserActions:
def show_extensions():
actions.app.tab_open()
actions.browser.go("arc://extensions")
10 changes: 10 additions & 0 deletions apps/arc/arc_mac.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
app: arc
os: mac
-
tag(): browser
tag(): user.tabs

please [<user.text>]:
key("cmd-l")
sleep(200ms)
insert(user.text or "")
8 changes: 8 additions & 0 deletions apps/arc/little-arc_mac.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
user.running: arc
os: mac
-
# This assumes that you have not disabled Little Arc
little arc [<user.text>]:
key("cmd-alt-n")
sleep(200ms)
insert(user.text or "")
2 changes: 1 addition & 1 deletion apps/conemu/conemu.talon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
os: windows
app.exe: ConEmu64.exe
app.exe: /^conemu64\.exe$/i
-

tag(): terminal
Expand Down
1 change: 0 additions & 1 deletion apps/eclipse/eclipse.talon
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ app: eclipse
tag(): user.find_and_replace
tag(): user.line_commands
# tag(): user.multiple_cursors
# tag(): user.snippets
tag(): user.splits
tag(): user.tabs
# splits.py support end
Expand Down
17 changes: 0 additions & 17 deletions apps/eclipse/eclipse_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,6 @@ def save_all():

@ctx.action_class("user")
class UserActions:
# generic_snippet.py support beginHelp close
# def snippet_search(text: str):
# actions.user.vscode("Insert Snippet")
# actions.insert(text)

# def snippet_insert(text: str):
# """Inserts a snippet"""
# actions.user.vscode("Insert Snippet")
# actions.insert(text)
# actions.key("enter")

# def snippet_create():
# """Triggers snippet creation"""
# actions.user.vscode("Preferences: Configure User Snippets")

# generic_snippet.py support end

# splits.py support begin
# requires https://marketplace.eclipse.org/content/handysplit
def split_clear_all():
Expand Down
6 changes: 3 additions & 3 deletions apps/emacs/emacs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging
from typing import Optional

from talon import Context, Module, actions
from talon import Context, Module, actions, settings

mod = Module()
setting_meta = mod.setting(
mod.setting(
"emacs_meta",
type=str,
default="esc",
Expand All @@ -28,7 +28,7 @@


def meta(keys):
m = setting_meta.get()
m = settings.get("user.emacs_meta")
if m == "alt":
return " ".join("alt-" + k for k in keys.split())
elif m == "cmd":
Expand Down
13 changes: 8 additions & 5 deletions apps/emacs/emacs.talon
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ save buffers kill emacs: user.emacs("save-buffers-kill-emacs")
save some buffers: user.emacs("save-some-buffers")
sort lines: user.emacs("sort-lines")
sort words: user.emacs("sort-words")
file [loop] continue: user.emacs("fileloop-continue")

go directory: user.emacs("dired-jump")
other go directory: user.emacs("dired-jump-other-window")

[toggle] debug on error: user.emacs("toggle-debug-on-error")
[toggle] debug on quit: user.emacs("toggle-debug-on-quit")
[toggle] input method: user.emacs("toggle-input-method")
[toggle] truncate lines: user.emacs("toggle-truncate-lines")
[toggle] word wrap: user.emacs("toggle-word-wrap")
Expand Down Expand Up @@ -204,8 +206,9 @@ search toggle case [fold | sensitive]: user.emacs_meta("c")
search toggle regex: user.emacs_meta("r")

highlight lines matching [regex]: user.emacs("highlight-lines-matching-regexp")
highlight phrase: user.emacs("highlight-phrase")
highlight regex: user.emacs("highlight-regexp")
unhighlight regex: user.emacs("unhighlight-regexp")
unhighlight (regex | phrase): user.emacs("unhighlight-regexp")
unhighlight all:
user.emacs_prefix()
user.emacs("unhighlight-regexp")
Expand Down Expand Up @@ -286,8 +289,8 @@ rectangle number lines: user.emacs("rectangle-number-lines")

# ----- PROJECT SUPPORT ----- #
project [find] file: user.emacs("project-find-file")
project [find] regexp: user.emacs("project-find-regexp")
project [query] replace regexp: user.emacs("project-query-replace-regexp")
project [find] (regex | grep): user.emacs("project-find-regexp")
project [query] replace regex: user.emacs("project-query-replace-regexp")
project (dired | directory): user.emacs("projectile-dired")
project [run] shell: user.emacs("projectile-run-shell")
project [run] eshell: user.emacs("projectile-run-eshell")
Expand All @@ -298,8 +301,8 @@ project [run] shell command: user.emacs("projectile-run-shell-command-in-root")
project [run] async shell command:
user.emacs("projectile-run-async-shell-command-in-root")
project (switch [to buffer] | buffer | buff): user.emacs("projectile-switch-to-buffer")
project kill buffers: user.emacs("projectile-kill-buffers")
project switch project: user.emacs("project-switch-project")
project kill [buffers]: user.emacs("projectile-kill-buffers")
project switch [project]: user.emacs("project-switch-project")

# ----- VC/GIT SUPPORT ----- #
vc (annotate | blame): user.emacs("vc-annotate")
Expand Down
12 changes: 9 additions & 3 deletions apps/emacs/emacs_commands.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ balance-windows, ctrl-x +
beginning-of-buffer, meta-<
browse-kill-ring,, b-k-r
buffer-menu, ctrl-x ctrl-b
next-buffer, ctrl-x right
previous-buffer, ctrl-x left
bury-buffer,, bur
byte-compile-file,, by-c
byte-recompile-directory
byte-recompile-file
clear-rectangle, ctrl-x r c
clone-indirect-buffer,, clo-i
comment-dwim, meta-;
comment-line,, comment-l
comment-region, ctrl-c ;
compile
compile-defun,, co-def
copy-rectangle-as-kill, ctrl-x r meta-w
copy-rectangle-to-register, ctrl-x r r
Expand Down Expand Up @@ -62,6 +64,7 @@ global-visual-line-mode,, gl-v-l-m
goto-line, meta-g meta-g
highlight-lines-matching-regexp, meta-s h l
highlight-regexp, meta-s h r
highlight-phrase, meta-s h p
hl-line-mode,, hl-l-m
indent-region, meta-ctrl-\
indent-rigidly, ctrl-x tab
Expand Down Expand Up @@ -95,6 +98,7 @@ mark-whole-buffer, ctrl-x h
move-beginning-of-line, ctrl-a
move-end-of-line, ctrl-e
narrow-to-region, ctrl-x n n
next-buffer, ctrl-x right
next-error, meta-g n
occur, meta-s o
open-rectangle, ctrl-x r o
Expand Down Expand Up @@ -125,6 +129,7 @@ overwrite-mode,, overwr
package-autoremove
pop-global-mark, ctrl-x ctrl-@
pop-to-mark-command, ctrl-u ctrl-space
previous-buffer, ctrl-x left
previous-error, meta-g p
project-find-file, ctrl-x p f
project-find-regexp, ctrl-x p g
Expand Down Expand Up @@ -192,7 +197,8 @@ tab-next, ctrl-x t o
tab-previous, ctrl-x t O
tab-undo, ctrl-x t u
text-mode,, text-m
toggle-debug-on-error
toggle-debug-on-error,, t-d-on-e
toggle-debug-on-quit,, t-d-on-q
toggle-input-method, ctrl-\
toggle-truncate-lines, ctrl-x x t
toggle-word-wrap
Expand Down
4 changes: 4 additions & 0 deletions apps/firefox/firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
apps.firefox = "app.name: Firefox"
apps.firefox = "app.name: Firefox Developer Edition"
apps.firefox = "app.name: firefox"
apps.firefox = "app.name: Firefox-esr"
apps.firefox = "app.name: firefox-esr"
apps.firefox = "app.name: LibreWolf"
apps.firefox = "app.name: waterfox"
apps.firefox = """
os: windows
and app.name: Firefox
Expand Down
2 changes: 1 addition & 1 deletion apps/gdb/gdb_active.talon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ os: linux
# XXX - this matches .gdb files atm
#win.title: /gdb/
tag: terminal
tag: user.gdb
and tag: user.gdb
-
tag(): user.debugger
until <number>: "until {number}"
Expand Down
4 changes: 2 additions & 2 deletions apps/git/git.talon
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ git {user.git_command} [<user.git_arguments>]:
git commit [<user.git_arguments>] message [<user.prose>]:
args = git_arguments or ""
message = prose or ""
user.insert_between("git commit{args} --message '{message}", "'")
user.insert_between('git commit{args} --message "{message}', '"')
git stash [push] [<user.git_arguments>] message [<user.prose>]:
args = git_arguments or ""
message = prose or ""
user.insert_between("git stash push{args} --message '{message}", "'")
user.insert_between('git stash push{args} --message "{message}', '"')

# Optimistic execution for frequently used commands that are harmless (don't
# change repository or index state).
Expand Down
Loading

0 comments on commit f150dff

Please sign in to comment.