Re: [code] Storing commands

From: Mitchell <m.att.foicica.com>
Date: Tue, 17 Mar 2020 16:52:06 -0400 (EDT)

Hi,

On Thu, 5 Mar 2020, Mitchell wrote:

> 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.

I have committed a change[1] that adds support for per-mode command history.

Cheers,
Mitchell

[1]: https://foicica.com/hg/textadept/rev/7c9277883e58

-- 
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 Tue 17 Mar 2020 - 16:52:06 EDT

This archive was generated by hypermail 2.2.0 : Wed 18 Mar 2020 - 06:43:22 EDT