Re: [code] Storing commands

From: juh <juh+textadept.att.mailbox.org>
Date: Thu, 5 Mar 2020 15:54:02 +0100

Am 05.03.20 um 14:41 schrieb Mitchell:
> Hi Juh,
>
> On Thu, 5 Mar 2020, juh wrote:
>
>> Hi all,
>>
>> sometimes I use the pipe command function to reformat the text in
>> different ways, eg.
>>
>> awk '{gsub(/\. /,".\n");print}'
>>
>> sed -e 's/\.  */.\n/g' -e 's/\.$/.\n/g'
>>
>>
>> As I can't memorize these commands I am looking for a way to store them
>> anywhere, something like a "macro" for so.
>
> You can use a keybinding defined in your *~/.textadept/init.lua*:
>
>   keys.something = function()
>     textadept.editing.filter_through("awk '{...}'")
>   end

Thanks a lot.

I get an error message with this:

keys.cQ = function()
    textadept.editing.filter_through("awk '{gsub(/\. /,".\n");print}'")
  end

invalid escape sequence

How can I correctly escape things. Sorry, I am new to Lua.

juh

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 05 Mar 2020 - 09:54:02 EST

This archive was generated by hypermail 2.2.0 : Fri 06 Mar 2020 - 06:53:00 EST