Re: [code] Storing commands

From: Mitchell <>
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 '{...}'")

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.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
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