[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Manual - Shortcuts

In message <570f547ba7Lists@xxxxxxxxxxx>
          "Richard Torrens (lists)" <Lists@xxxxxxxxxxx> wrote:

> Section on Shortcuts done:
> http://stronged.torrens.org/man/modes/syntaxmodefile.html#Shortcuts

Referring to Shortcuts as macros can be confusing as the actions
recorded using the Learn function (s-F9) are also called macros.

Other text editors use terms like Insertion templates or Snippets, in
4.70 I'm using the name Snippets. The Shortcuts/Snippets in 4.70 are a
lot more powerful than those in older versions.

> But there are two comments in the History section of the StrongHelp I do
> not understand:
>  * New parameter for Shortcuts; 'Space', expands the shortcut only if
> followed by space.

Jeremy has already explained this very well. Requiring a space at the
end of the shortcut prevents it from being triggered unintentionally.

>  * Shortcuts can recall previously entered fields.

The markers for the cursor position (\@) can be followed by a number.
This number refers to a previous cursor position. When the cursor
reaches this numbered field the text from the position it refers to is

If we have this shortcut: ``f    function \@()\n-- end of \@0

After typing ``f and filling in the function name we might have:

  function Foobar()
  -- end of

The cursor will just after Foobar. If we now hit return the cursor will
be moved to after 'end of ' and the text from cursor position 0 will be
copied here, in this case 'Foobar', so that we end up with:

  function Foobar()
  -- end of Foobar

Hopefully that makes it clear enough.


StrongED Developer

To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives and instructions at