voice_control / text_editing.talon
1# Text editing2copy that | copy this | copy [the] selection:3 # help: Copy the selected text4 edit.copy()56cut that | cut this | cut [the] selection:7 # help: Cut the selected text8 edit.cut()910paste that | paste this | paste [[the] clipboard] here:11 # help: Paste the contents of the clipboard at the cursor12 edit.paste()1314redo that | redo this:15 # help: Redo the last undo16 edit.redo()1718undo that | undo this | scratch that:19 # help: Undo the last change20 edit.undo()2122capitalize that | capitalize this | capitalize [the] selection | cap that | cap this | cap [the] selection:23 # help: Make the selected text capitalized24 text = edit.selected_text()25 start = string.slice(text, 0, 1)26 start = start or ""27 start = string.upper(start)28 rest = string.slice(text, 1)29 rest = rest or ""30 if text: insert("{start}{rest}")3132correct that | correct this | correct [the] selection:33 # help: Open the correction window showing correction options for the selected text34 correct.show()3536bold that | bold this | bold [the] selection:37 # help: Bold the selection38 edit.bold()39italicize that | italicize this | italicize [the] selection:40 # help: Italicize the selection41 edit.italic()42underline that | underline this | underline [the] selection:43 # help: Underline the selection44 edit.underline()4546lowercase that | lowercase this | lowercase [the] selection:47 # help: Make the selected text lowercase48 text = edit.selected_text()49 if text: insert(string.lower(text))5051put [curly] braces around that | put [curly] braces around [the] selection:52 # help: Put curly braces around the selected text53 text = edit.selected_text()54 paste("{{{text}}}")55put [double] curly quotes around that | put [double] curly quotes around [the] selection | curly quote that | put [double] smart quotes around that | put [double] smart quotes around [the] selection | smart quote that:56 # help: Put double curly quotes around the selected text57 text = edit.selected_text()58 paste('“{text}”')59put [double] quotes around that | put [double] quotes around [the] selection | quote that:60 # help: Put double quotes around the selected text61 text = edit.selected_text()62 paste('"{text}"')63put parentheses around that | put parentheses around [the] selection:64 # help: Put parentheses around the selected text65 text = edit.selected_text()66 paste("({text})")67put single curly quotes around that | put single curly quotes around [the] selection | put single smart quotes around that | put single smart quotes around [the] selection:68 # help: Put single curly quotes around the selected text69 text = edit.selected_text()70 paste("‘{text}’")71put single quotes around that | put single quotes around [the] selection:72 # help: Put single quotes around the selected text73 text = edit.selected_text()74 paste("'{text}'")75put [square] brackets around that | put [square] brackets around [the] selection:76 # help: Put square brackets around the selected text77 text = edit.selected_text()78 paste("[{text}]")7980uppercase that | uppercase this | uppercase [the] selection:81 # help: Make the selected text uppercase82 text = edit.selected_text()83 if text: insert(string.upper(text))8485capitalize <edit.target>:86 # help: Capitalize the target text87 edit.target_capitalize(edit.target)88lowercase <edit.target>:89 # help: Lowercase the target text90 edit.target_lower(edit.target)91uppercase <edit.target>:92 # help: Uppercase the target text93 edit.target_upper(edit.target)9495replace <edit.target> with <phrase> | change <edit.target> to <phrase>:96 # help: Replace the target text with the phrase97 edit.target_replace(edit.target, "{phrase}")9899correct [the word] <edit.target>:100 # help: Open the correction window and show correction options for the target text101 correct.target(edit.target)102103bold <edit.target>:104 # help: Bold the target text105 edit.target_bold(edit.target)106107italicize <edit.target>:108 # help: Italicize the target text109 edit.target_italic(edit.target)110111underline <edit.target>:112 # help: Underline the target text113 edit.target_underline(edit.target)114115insert <phrase> after <edit.target>:116 # help: Insert the phrase after the target text117 edit.target_insert_after(edit.target, " {phrase}")118insert <phrase> before <edit.target>:119 # help: Insert the phrase before the target text120 edit.target_insert_before(edit.target, "{phrase} ")121122put [curly] braces around <edit.target>:123 # help: Put curly braces around the target text124 edit.target_wrap(edit.target, "{", "}")125put [double] curly quotes around <edit.target> | put [double] smart quotes around <edit.target>:126 # help: Put double curly quotes around the target text127 edit.target_wrap(edit.target, '“', "”")128put [double] quotes around <edit.target>:129 # help: Put double quotes around the target text130 edit.target_wrap(edit.target, '"', '"')131put parentheses around <edit.target>:132 # help: Put parentheses around the target text133 edit.target_wrap(edit.target, '(', ')')134put single curly quotes around <edit.target> | put single smart quotes around <edit.target>:135 # help: Put single curly quotes around the target text136 edit.target_wrap(edit.target, "‘", "’")137put single quotes around <edit.target>:138 # help: Put single quotes around the target text139 edit.target_wrap(edit.target, "'", "'")140put [square] brackets around <edit.target>:141 # help: Put square brackets around the target text142 edit.target_wrap(edit.target, "[", "]")