[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Simple keybinding request
From: |
Sharon Kimble |
Subject: |
Re: Simple keybinding request |
Date: |
Sun, 09 Apr 2017 14:03:42 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Danny YUE <sheepduke@gmail.com> writes:
> On 2017-04-09 10:05, Sharon Kimble <boudiccas@skimble.plus.com> wrote:
>> How can I bind '<ref name="%"/>' to some keys to make it easier to enter
>> please? I've got it as a yasnippet but its using 5 keys to enter it, and
>> if I can just use say 3 keys it will speed things up. What it actually
>> does is to enter a citation-repeat in mediawiki-mode.
>>
>> Thanks
>> Sharon.
>
> Try below whiling editing your new yasnippet item:
>
Thanks for replying Danny.
> # -*- mode: snippet -*-
> # name: ref
> # key: ref
> # --
> <ref name="$0"/>
>
> The snippet above binds the snippet to "ref" key.
> '$0' makes the cursor move there after expansion completed.
I didn't know about '$0' so thanks for that, its working very nicely.
Thanks
Sharon.
--
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 8.6, fluxbox 1.3.5-2, emacs 25.1.1.1
signature.asc
Description: PGP signature