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
- For some programs: 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
link(/features/cooperationwithvoicecoder/index.html,*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
For some programs, who can "return" the current line number to this grammar with introspection, you can call "line numbers modulo hundred".
For example, when you are in line 1375, with "line eighty", you go to line 1380.
When you want to address numbers below 10: - Assume you are on line 358: when saying "line seven" you go to line 357, but when you say "line oh seven", you will go to line 407 (which is slightly nearer than line 307)
- when saying line "oh oh seven", you will always go to line 7.
For addressing numbers between 10 and 99 (including): - When you are still on line 358, and say "line twenty three", you go to line 323.
- When you say "line oh two three", you go to line 23.
Note: this feature only works when the current line number is above 99.
This feature has been implemented for a limited number of applications: win32pad, excel, Visual Studio (new, February 2021) and Komodo (a commercial IDE program, also new February 2021). See:
- link(/grammars/globalgrammars/lines/implementationdetails.html, implementation details) for this grammar and
- programming details about the action classes modules.
Introspection
With the commands show lines and edit lines you can inspect the grammar and change things. |