Skip to content

Commit

Permalink
Merge branch 'main' into add-configuration-recommendations-to-read-me
Browse files Browse the repository at this point in the history
  • Loading branch information
jaresty authored Oct 12, 2024
2 parents 7efe818 + 74131e1 commit 9b77317
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 31 deletions.
6 changes: 6 additions & 0 deletions apps/arc/arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def tab_close_wrapper():
actions.sleep("180ms")
actions.app.tab_close()

def command_search(command: str = ""):
actions.key("cmd-l")
if command != "":
actions.sleep("200ms")
actions.insert(command)


@ctx.action_class("browser")
class BrowserActions:
Expand Down
6 changes: 1 addition & 5 deletions apps/arc/arc_mac.talon
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ os: mac
-
tag(): browser
tag(): user.tabs

please [<user.text>]:
key("cmd-l")
sleep(200ms)
insert(user.text or "")
tag(): user.command_search
5 changes: 1 addition & 4 deletions apps/eclipse/eclipse.talon
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ tag(): user.line_commands
# tag(): user.multiple_cursors
tag(): user.splits
tag(): user.tabs
tag(): user.command_search
# splits.py support end

please [<user.text>]:
key(ctrl-3)
insert(user.text or "")

# Sidebar
bar explore: key(alt-shift-w p)
# bar extensions:
Expand Down
5 changes: 5 additions & 0 deletions apps/eclipse/eclipse_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def split_window_vertically():
def split_window():
actions.key("alt-ctrl-s s")

def command_search(command: str = ""):
actions.key("ctrl-3")
if command != "":
actions.insert(command)

# splits.py support end

# find_and_replace.py support begin
Expand Down
7 changes: 6 additions & 1 deletion apps/jetbrains/jetbrains.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def select_range(line_start: int, line_end: int):
# if it's a single line, select the entire thing including the ending new-line5
if line_start == line_end:
actions.user.idea(f"goto {line_start} 0")
actions.user.idea("action EditorSelectLine"),
actions.user.idea("action EditorSelectLine")
else:
actions.user.idea(f"range {line_start} {line_end}")

Expand All @@ -314,6 +314,11 @@ def camel_left():
def camel_right():
actions.user.idea("action EditorNextWordInDifferentHumpsMode")

def command_search(command: str = ""):
actions.user.idea("action GotoAction")
if command != "":
actions.insert(command)

def line_clone(line: int):
actions.user.idea(f"clone {line}")

Expand Down
7 changes: 2 additions & 5 deletions apps/jetbrains/jetbrains.talon
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tag(): user.line_commands
tag(): user.multiple_cursors
tag(): user.splits
tag(): user.tabs
tag(): user.command_search
# multiple_cursors.py support end

# Auto complete
Expand All @@ -14,11 +15,7 @@ smart: user.idea("action SmartTypeCompletion")
(done | finish): user.idea("action EditorCompleteStatement")
# Copying
grab <number>: user.idea_grab(number)
# Actions
(action | please): user.idea("action GotoAction")
(action | please) <user.text>:
user.idea("action GotoAction")
insert(text)
action [<user.text>]: user.deprecate_command("2024-09-02", "action", "please")
# Refactoring
refactor: user.idea("action Refactorings.QuickListPopupAction")
refactor <user.text>:
Expand Down
14 changes: 7 additions & 7 deletions apps/vivaldi/vivaldi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ def vivaldi_history_panel():

def vivaldi_bookmarks_panel():
"""Toggles the Vivaldi bookmarks panel"""
actions.user.vivaldi_toggle_quick_commands()
actions.sleep("180ms")
actions.insert("Bookmarks Panel")
actions.user.command_search("Bookmarks Panel")
actions.key("enter")

def vivaldi_downloads_panel():
Expand All @@ -39,10 +37,6 @@ def vivaldi_notes_panel():
"""Toggles the Vivaldi notes panel"""
actions.key("ctrl-shift-o")

def vivaldi_toggle_quick_commands():
"""Toggles the Vivaldi Quick Commands tool"""
actions.key("ctrl-e")


@ctx.action_class("user")
class UserActions:
Expand All @@ -53,6 +47,12 @@ def tab_close_wrapper():
def tab_jump(number: int):
actions.key(f"ctrl-{number}")

def command_search(command: str = ""):
actions.key("ctrl-e")
if command != "":
actions.sleep("180ms")
actions.insert(command)


@ctx.action_class("browser")
class BrowserActions:
Expand Down
6 changes: 1 addition & 5 deletions apps/vivaldi/vivaldi.talon
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ app: vivaldi
-
tag(): browser
tag(): user.tabs
tag(): user.command_search

(sidebar | panel) history: user.vivaldi_history_panel()
(sidebar | panel) downloads: user.vivaldi_downloads_panel()
(sidebar | panel) bookmarks: user.vivaldi_bookmarks_panel()
(sidebar | panel) notes: user.vivaldi_notes_panel()

please [<user.text>]:
user.vivaldi_toggle_quick_commands()
sleep(180ms)
insert(user.text or "")
5 changes: 5 additions & 0 deletions apps/vscode/vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ def multi_cursor_select_more_occurrences():
def multi_cursor_skip_occurrence():
actions.user.vscode("editor.action.moveSelectionToNextFindMatch")

def command_search(command: str = ""):
actions.user.vscode("workbench.action.showCommands")
if command != "":
actions.insert(command)

def tab_jump(number: int):
if number < 10:
if is_mac:
Expand Down
6 changes: 2 additions & 4 deletions apps/vscode/vscode.talon
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ tag(): user.line_commands
tag(): user.multiple_cursors
tag(): user.splits
tag(): user.tabs
tag(): user.command_search

window reload: user.vscode("workbench.action.reloadWindow")
window close: user.vscode("workbench.action.closeWindow")
#multiple_cursor.py support end

please [<user.text>]:
user.vscode("workbench.action.showCommands")
insert(user.text or "")

go view [<user.text>]:
user.vscode("workbench.action.openView")
insert(user.text or "")
Expand Down
13 changes: 13 additions & 0 deletions tags/command_search/command_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from talon import Module

mod = Module()
mod.tag(
"command_search",
desc="A command for running an arbitrary command based on a search",
)


@mod.action_class
class command_search_actions:
def command_search(command: str = ""):
"""Searches for command based on text"""
3 changes: 3 additions & 0 deletions tags/command_search/command_search.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tag: user.command_search
-
^please [<user.text>]$: user.command_search(user.text or "")

0 comments on commit 9b77317

Please sign in to comment.