Re: [code] Storing commands

From: Mitchell <m.att.foicica.com>
Date: Thu, 5 Mar 2020 08:41:53 -0500 (EST)

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

Similarly you can use a `ui.dialogs.filteredlist()` dialog to prompt for a predefined command to run if you have a static list and don't want to assign key bindings or menus for each one.

If you want some sort of mechanism to store arbitrary commands on the fly, then you'll have to code up something yourself.

I will make a note on my TODO list to look into storing command entry commands like in a terminal prompt.

Cheers,
Mitchell

-- 
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 - 08:41:53 EST

This archive was generated by hypermail 2.2.0 : Fri 06 Mar 2020 - 06:52:51 EST