Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnicollo committed Jul 20, 2024
2 parents 22c328e + 5b43105 commit 881e97e
Show file tree
Hide file tree
Showing 100 changed files with 1,786 additions and 229 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
minimum_pre_commit_version: "3.2.0"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -35,18 +35,18 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.1
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: remove-tabs
types: [file]
files: \.talon$
args: ["--whitespaces-count=4"]
- repo: https://github.com/wenkokke/talonfmt
rev: 1.10.1
rev: 1.10.2
hooks:
- id: talonfmt
args: ["--in-place"]
1 change: 1 addition & 0 deletions BREAKING_CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ applied given the delay between changes being submitted and the time they were r
and merged.

---
* 2024-05-30 Deprecate 'drop down <user.number_small>' in favor of overridable 'choose' helper
* 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
Expand Down
6 changes: 5 additions & 1 deletion apps/eclipse/eclipse_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def split_window():

# splits.py support end

# find_and_replace.py support begin
# find.py support begin

def find(text: str):
"""Triggers find in current editor"""
Expand All @@ -125,6 +125,10 @@ def find_next():
def find_previous():
actions.key("shift-enter")

# find.py support end

# find_and_replace.py support begin

def find_everywhere(text: str):
"""Triggers find across project"""
actions.key("ctrl-h")
Expand Down
13 changes: 12 additions & 1 deletion apps/emacs/emacs.talon
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,16 @@ rectangle (yank | paste): user.emacs("yank-rectangle")
rectangle copy: user.emacs("copy-rectangle-as-kill")
rectangle number lines: user.emacs("rectangle-number-lines")

# ----- XREF SUPPORT ----- #
[xref] find definition: user.emacs("xref-find-definitions")
[xref] find definition other window: user.emacs("xref-find-definitions-other-window")
[xref] find definition other frame: user.emacs("xref-find-definitions-other-frame")
[xref] find references: user.emacs("xref-find-references")
[xref] find references [and] replace: user.emacs("xref-find-references-and-replace")
xref find apropos: user.emacs("xref-find-apropos")
xref go back: user.emacs("xref-go-back")
visit tags table: user.emacs("visit-tags-table")

# ----- PROJECT SUPPORT ----- #
project [find] file: user.emacs("project-find-file")
project [find] (regex | grep): user.emacs("project-find-regexp")
Expand Down Expand Up @@ -324,7 +334,8 @@ merge next: user.emacs("smerge-next")
merge last: user.emacs("smerge-prev")
merge keep upper: user.emacs("smerge-keep-upper")
merge keep lower: user.emacs("smerge-keep-lower")
merge keep this: user.emacs("smerge-keep-current")
merge keep base: user.emacs("smerge-keep-base")
merge keep (this | current): user.emacs("smerge-keep-current")
merge refine: user.emacs("smerge-refine")
merge split: user.emacs("smerge-resolve")

Expand Down
11 changes: 10 additions & 1 deletion apps/emacs/emacs_commands.csv
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ global-hl-line-mode,, g-hl-l-m
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
highlight-regexp, meta-s h r
hl-line-mode,, hl-l-m
indent-region, meta-ctrl-\
indent-rigidly, ctrl-x tab
Expand Down Expand Up @@ -102,6 +102,7 @@ next-buffer, ctrl-x right
next-error, meta-g n
occur, meta-s o
open-rectangle, ctrl-x r o
other-frame, ctrl-x 5 o
other-window, ctrl-x o
outline-backward-same-level, ctrl-c @ ctrl-b
outline-demote, ctrl-c @ ctrl->
Expand Down Expand Up @@ -214,9 +215,17 @@ unhighlight-regexp, meta-s h u
universal-argument, ctrl-u
vc-annotate, ctrl-x v g
view-lossage, ctrl-h l
visit-tags-table,, v-t-t
visual-line-mode,, visu-l-m
whitespace-cleanup,, wh-cl
whitespace-mode,, white-m
widen, ctrl-x n w
xref-find-apropos, meta-ctrl-.
xref-find-definitions, meta-.
xref-find-definitions-other-frame, ctrl-x 5 .
xref-find-definitions-other-window, ctrl-x 4 .
xref-find-references, meta-?
xref-find-references-and-replace
xref-go-back,"meta-,"
yank, ctrl-y
yank-rectangle, ctrl-x r y
6 changes: 0 additions & 6 deletions apps/finder/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ class UserActions:
def file_manager_open_parent():
actions.key("cmd-up")

def file_manager_go_forward():
actions.key("cmd-]")

def file_manager_go_back():
actions.key("cmd-[")

def file_manager_current_path():
title = ui.active_window().title

Expand Down
1 change: 1 addition & 0 deletions apps/firefox/firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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 = """
Expand Down
64 changes: 64 additions & 0 deletions apps/foxit_reader/foxit_reader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
from talon import Context, Module, actions

mod = Module()
ctx = Context()

# --- App definition ---
mod.apps.foxit_reader = r"""
os: windows
and app.name: /^Foxit Reader/
os: windows
and app.exe: /^foxitreader\.exe$/i
os: windows
and app.name: Foxit PDF Reader
os: windows
and app.exe: /^foxitpdfreader\.exe$/i
"""
# Context matching
ctx.matches = """
app: foxit_reader
"""


@ctx.action_class("app")
class AppActions:
# app.tabs
def tab_open():
actions.key("ctrl-o")

def tab_reopen():
actions.app.notify("Foxit does not support this action.")


@ctx.action_class("user")
class UserActions:
# user.tabs
def tab_jump(number):
actions.app.notify("Foxit does not support this action.")

def tab_final():
actions.app.notify("Foxit does not support this action.")

def tab_duplicate():
actions.app.notify("Foxit does not support this action.")

# user.pages
def page_current() -> int:
actions.key("ctrl-g")
page = actions.edit.selected_text()
return int(page)

def page_next():
actions.key("right")

def page_previous():
actions.key("left")

def page_jump(number: int):
actions.key("ctrl-g")
actions.insert(str(number))
actions.key("enter")

def page_final():
# actions.key("fn-right")
actions.key("end")
11 changes: 11 additions & 0 deletions apps/foxit_reader/foxit_reader.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
app: foxit_reader
-
tag(): user.tabs
tag(): user.pages

tab close all: key(ctrl-shift-w)

[page] rotate right: key("shift-ctrl-keypad_equals")
[page] rotate left: key("shift-ctrl-keypad_minus")

go back: key(alt-left)
44 changes: 44 additions & 0 deletions apps/meld/meld.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from talon import Context, Module, actions

mod = Module()
ctx = Context()

apps = mod.apps
apps.meld = """
os: windows
and app.name: Visual diff and merge tool
os: windows
and app.exe: meld.exe
"""

ctx.matches = r"""
app: meld
"""


@ctx.action_class("app")
class AppActions:
def tab_open():
actions.key("ctrl-n")

def tab_previous():
actions.key("ctrl-alt-pageup")

def tab_next():
actions.key("ctrl-alt-pagedown")

def tab_reopen():
print("Meld does not support this action.")


@ctx.action_class("user")
class UserActions:
def tab_jump(number):
if number < 10:
actions.key(f"alt-{number}")

def tab_final():
print("Meld does not support this action.")

def tab_duplicate():
print("Meld does not support this action.")
6 changes: 6 additions & 0 deletions apps/meld/meld.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app: meld
-
tag(): user.tabs

change next: key(alt-down)
change (previous | last): key(alt-up)
7 changes: 4 additions & 3 deletions apps/nautilus/nautilus.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ class UserActions:
def tab_jump(number: int):
actions.key(f"alt-{number}")

# user.file_manager
def file_manager_go_back():
# user.navigation
def go_back():
actions.key("alt-left")

def file_manager_go_forward():
def go_forward():
actions.key("alt-right")

# user.file_manager
def file_manager_open_parent():
actions.key("alt-up")

Expand Down
6 changes: 5 additions & 1 deletion apps/notepad++/notepad++_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def tab_final():
print("Notepad doesn't support this...")
# actions.key("ctrl-numpad_0")

# find_and_replace.py support begin
# find.py support begin

def find(text: str):
"""Triggers find in current editor"""
Expand All @@ -111,6 +111,10 @@ def find_next():
def find_previous():
actions.key("shift-enter")

# find.py support end

# find_and_replace.py support begin

def find_everywhere(text: str):
"""Triggers find across project"""

Expand Down
22 changes: 22 additions & 0 deletions apps/notepad/notepad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from talon import Context, Module, actions

ctx = Context()
mod = Module()

mod.apps.notepad = r"""
os: windows
and app.exe: notepad.exe
"""

ctx.matches = r"""
app: notepad
"""


@ctx.action_class("win")
class win_actions:
def filename():
filename = actions.win.title().split(" - ")[0]
if "." in filename:
return filename
return ""
5 changes: 5 additions & 0 deletions apps/notepad/notepad.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
app: notepad
-

tag(): user.tabs
tag(): user.find_and_replace
4 changes: 0 additions & 4 deletions apps/powershell/powershell_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ def file_manager_refresh_title():
"$Host.UI.RawUI.WindowTitle = 'Windows PowerShell: ' + $(get-location)"
)
actions.key("enter")
# action(user.file_manager_go_back):
# key("alt-left")
# action(user.file_manager_go_forward):
# key("alt-right")

def file_manager_open_parent():
actions.insert("cd ..")
Expand Down
21 changes: 21 additions & 0 deletions apps/stata/stata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from talon import Context, Module

mod = Module()
ctx = Context()

mod.apps.stata = r"""
os: windows
and app.name: Stata
os: windows
and app.exe: /^statase\-64\.exe$/i
"""

ctx.matches = r"""
app: stata
"""


@ctx.action_class("code")
class CodeActions:
def language():
return "stata"
25 changes: 25 additions & 0 deletions apps/stata/stata_do_file_editor.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Commands for the Stata Do-File Editor
os: windows
app: stata
win.title: /^Do-file Editor/
-
do this: key(ctrl-d)

do line:
edit.select_line()
key(ctrl-d)

do (all | file):
edit.select_all()
edit.copy()
key(ctrl-d)

do way up:
edit.extend_file_start()
edit.copy()
key(ctrl-d)

do way down:
edit.extend_file_end()
edit.copy()
key(ctrl-d)
Loading

0 comments on commit 881e97e

Please sign in to comment.