From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Danny YUE Newsgroups: gmane.emacs.help Subject: Re: Simple keybinding request Date: Mon, 10 Apr 2017 00:12:10 +0800 Message-ID: <87r311k1b9.fsf@gmail.com> References: <87d1clhp69.fsf@skimble.plus.com> <87inmdyj77.fsf@gmail.com> <8737dhg2c1.fsf@skimble.plus.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1491754447 6695 195.159.176.226 (9 Apr 2017 16:14:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Apr 2017 16:14:07 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.2.1 Cc: help-emacs , Danny YUE To: Sharon Kimble Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 09 18:14:03 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxFTT-0000rQ-5T for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 18:13:59 +0200 Original-Received: from localhost ([::1]:59054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxFTY-0002nf-Q3 for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 12:14:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxFT5-0002nY-5u for help-gnu-emacs@gnu.org; Sun, 09 Apr 2017 12:13:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxFT2-0003B2-1Y for help-gnu-emacs@gnu.org; Sun, 09 Apr 2017 12:13:35 -0400 Original-Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:33794) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cxFT1-0003At-SF for help-gnu-emacs@gnu.org; Sun, 09 Apr 2017 12:13:31 -0400 Original-Received: by mail-pf0-x244.google.com with SMTP id o126so6310148pfb.1 for ; Sun, 09 Apr 2017 09:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=Hbe0X3UlVT8jqwZXxoPIr90nA69tyLKRTQhnRbXWotM=; b=espYfCJ9Tlm4AUcp+cqGBb6k4vyWGxD3Z/HxcLxnelM4P9Z+zeaGLlogV2y6CBFNn5 Gv/jVvJh+6Md0NOUuHDhD3ZGCjn1uhhC4jKU0Oi8dMO0eyodNsvGVJo3jTDnBPlNfQ92 32z00Hb1/HenldzTxJgV4JAMAzGYCRBhHiPXHVzA3XOJYB4KjIOzn5/ZOfzp4xvBrG7u uk3LxapVt819ads0OYEQJq1cyOGHAYyXD5Lls/9gu5315fmhAXIypVJqhLFJPe9Z4UHU PkDE9HsHNkYujNn1QUc8F9mzIV7ajpWIAniLBbwWOd0sI7GCXGSHsU9IuicCGW6vHb4f /82w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=Hbe0X3UlVT8jqwZXxoPIr90nA69tyLKRTQhnRbXWotM=; b=HcZjewPWxl6Wd82ydDRbbnoopRwpvcLKwAGvHB221IQkWlwoEg2YjN2gKBXB6olkjI uyO+fNCYmZXvaLD8//xYNcQVTyNKDD2umAVmrfZYyx5YQA0c2CPeiz/tVn/b1bKCbD9m uwrH+Vzh6p5WVpTBpWmhi5+NoFWWcKN+CeYeS2qo1xQQeRSAsTn257EeaNDijXuxtmLv VCr7GA80FFXjnpe9rzNt0DTJA9bQFF3LJLXp+4P5pSNT5tuhL1ZXOhqDMLJlFX5HA6Vn wFV1OL5iNeSS+2NuxtF6WT36VhwQhSLAOhn9LGC6YNyzXLhu/PBerJR+03Cip56oqrYJ chtQ== X-Gm-Message-State: AN3rC/4WnuaaoCgDYL/h//rc/JxTmXESJOf+nz0KFK8/TLWG7uvQTjVUF2ckIMY34gTugg== X-Received: by 10.84.150.101 with SMTP id g92mr5803778plg.149.1491754411025; Sun, 09 Apr 2017 09:13:31 -0700 (PDT) Original-Received: from localhost (23.83.238.120.16clouds.com. [23.83.238.120]) by smtp.gmail.com with ESMTPSA id l127sm19902568pga.7.2017.04.09.09.13.29 (version=TLS1_2 cipher=AES128-GCM-SHA256 bits=128/128); Sun, 09 Apr 2017 09:13:29 -0700 (PDT) In-reply-to: <8737dhg2c1.fsf@skimble.plus.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::244 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112731 Archived-At: On 2017-04-09 13:03, Sharon Kimble wrote: > Danny YUE writes: > >> On 2017-04-09 10:05, Sharon Kimble wrote: >>> How can I bind '' 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 >> # -- >> >> >> 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. Just FYI: Maybe you already guessed it, you can use '$1', '$2' etc to specify manual completion positions and cycle them using key . If you specify multiple '$1', they will be updated simultaneously when you edit one of them. e.g. $0 Danny