Skip to content

line_commands

The community/tags/line_commands directory provides a set of generic line navigation and manipulation commands for Talon. It defines a tag, user.line_commands, which enables these commands when active.

The core logic is found in line_commands.py, which defines the actions that can be performed.

  • extend_until_line(line: int): Extends the current selection to the specified line.
  • select_range(line_start: int, line_end: int): Selects a range of lines from line_start to line_end.
  • extend_camel_left(): Extends the selection by camel case/subword to the left.
  • extend_camel_right(): Extends the selection by camel case/subword to the right.
  • camel_left(): Moves the cursor to the left by camel case/subword.
  • camel_right(): Moves the cursor to the right by camel case/subword.
  • line_clone(line: int): Clones the specified line at the current cursor position.

These actions are then used in line_commands.talon to create voice commands. Some notable commands include:

  • go <number>: Jumps to the specified line number.
  • go <number> end: Jumps to the specified line number and moves the cursor to the end of the line.
  • comment [line] <number>: Comments out the specified line.
  • comment <number> until <number>: Comments out the lines from the first number until the second.
  • clear [line] <number>: Deletes the specified line.
  • clear <number> until <number>: Deletes the specified lines.
  • copy [line] <number>: Copies the specified line.
  • copy <number> until <number>: Copies the specified lines.
  • cut [line] <number>: Cuts the specified line.
  • cut [line] <number> until <number>: Cuts the specified lines.
  • (paste | replace) <number> until <number>: Pastes over the specified lines.
  • (select | cell | sell) [line] <number>: Selects the specified line.
  • (select | cell | sell) <number> until <number>: Selects the specified lines.
  • tab that: Indents the current line.
  • tab [line] <number>: Indents the specified line.
  • tab <number> until <number>: Indents the specified lines.
  • retab that: Unindents the current line.
  • retab [line] <number>: Unindents the specified line.
  • retab <number> until <number>: Unindents the specified lines.
  • drag [line] down: Moves the current line down.
  • drag [line] up: Moves the current line up.
  • drag up [line] <number>: Moves the specified line up.
  • drag up <number> until <number>: Moves the specified lines up.
  • drag down [line] <number>: Moves the specified line down.
  • drag down <number> until <number>: Moves the specified lines down.
  • clone [line] <number>: Clones the specified line.
  • select camel left: Extends selection by camel case/subword to the left.
  • select camel right: Extends selection by camel case/subword to the right.
  • go camel left: Moves cursor by camel case/subword to the left.
  • go camel right: Moves cursor by camel case/subword to the right.

The file also includes deprecated commands such as lend and bend which provide aliases to edit.line_end() and edit.line_start() respectively and provides deprecation warnings.

In summary, this directory provides a comprehensive set of voice commands for line navigation, selection, and manipulation, using the Talon framework. The python file defines the actions, and the talon file binds these actions to voice commands.