Control
Global grammars
 Folders
 General
 Lines
  Implementation details
 Tasks
 Keystrokes
 Repeat
 Edit
 Latex
 Number grammar
 Oops
 Show numbers plus
 Tags
 Brackets
 Modes
Specific grammars
Unimacro test
Games

Going to and doing actions with lines

With the grammar lines you can easily jump to lines, numbered or relative to the current line, and perform additional actions.

  • Lines can be selected, with or without line number
  • Lines (numbered or relative) can have an additional action, like delete
  • Lines can be moved or copied up or down or to another numbered line
  • Selected lines can have the same actions by the keyword THAT
  • New (december 2013): jump to line numbers modulo hundred
  • Add some paragraph (para) commands (March 2016)

This grammar relies heavily on actions, because the keystrokes that perform the different actions are very different across different applications. Implementations are now made or tried for Win32Pad, Excel, Emacs, Pythonwin, Komodo and UltraEdit.

The grammar (basic, without translations or synonyms):

command

comment

line {number}

Jump to the line. Relies on the grammar number, which is tested in English and Dutch

line {number} {action}

Do an additional action, like select, cut, copy, paste, paste over, duplicate (see table below)

line {number} through {number} [{action}]

select or do action on more (numbered) lines (you can change "through" to "to" with edit lines if you wish)'],

line {number} plus {count} [{action}]

select or do action on more lines (first numbered)

{count} lines {action}

Do action for more lines

next|previous line [{action}]

goto or do action for next or previous line, so after or before the current line

next|previous {1-20} lines {action}

Do action for more lines, after or before the current line

{line definition} copy|move up|down {count}

copy or move the lines up or down

{line definition} copy|move to {number}

copy or move the lines to the specified line number

THAT {action}

instead of {line definition} also the keyword THAT can be taken

 

Para actions, basically for Word:

command

comment

{count} paras {action}

Do action for more paragraphs

next|previous para {action}

Goto or do action for next of previous para, so after or before the current para

next|previous {1-20} paras {action}

Do action for more paras, after or before the current para

THAT {action}

instead of {para definition} also the keyword THAT can be taken

 

Actions

Here is part of the list simpleactions, corresponding to {action} in above table:

spoken form

action

comments

copy

<<copy>>

the copy action is nearly always {ctrl+c}

copy to DragonPad

HW copy that to DragonPad

actions do not have to be keystrokes

cut

<<cut>>

 

delete

<<delete>>

 

duplicate

<<duplicate>>

 

edit

HW edit that

link this grammar to the grammar edit

emacs

HW edit that python code, 'link to the grammar edit, see more information about see connection with voicecoder , including a little demo movie. A bit obsolete end 2013.

end

<<endafterselection>>

leave the cursor at the end of line

paste

<<homeafterselection>><<paste>>

paste, but prevent overwriting the selection here

paste over

<<paste>>

paste over the selection

select

 

if you go to one line, this action selects the line. When you want more lines, this action does nothing extra.

(un)comment

{alt+3} and {alt+4}

only for Pythonwin

 

Line numbers modulo hundred

Challenged by Mark Lillibridge, who implemented an option like this in Vocola and Emacs, a start is made to do this from Unimacro. This grammar must then have knowledge about the state of the application. This has been done for a limited number of applications: win32pad, ultraedit and excel. See:

Introspection

With the commands show lines and edit lines you can inspect the grammar and change things.