From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24329 invoked by alias); 7 Jun 2011 09:00:26 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16087 Received: (qmail 22387 invoked from network); 7 Jun 2011 09:00:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.215.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=ZIcHbCFEAugW27ccFpwlWDaVCeulqNOnuxjMDzXbw4c=; b=jm8xAxIJ+6/VxuL/5vkW3d6oKRJxx8Uc08T5zciqZe/+bNbTHlNL4C9utNofxGsMeB Q1MWz3lAPBiwAifPGBnG5zpSWAvb+26PXBRAZIFnx1ZM1eCsnmFBQJh3ujmIeZiBBfbe Hlm7NzXNZWeEPvUy05KGDaGh8peZMPyYLaefk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=WzYONqfStpx+WGcWWBgf3yIj2fQxWbp9GM+qQZOi9w0L2XWczr3Wnir9a2gaR2pILn Doj7Kkjtve7tWf1eCN3yjwjBELtaoSe4P7XJa71StWKE06iepINA2Y04VTF4jw7ia4E0 uP1tQOJF3cHht9Zw1z3sOylR7TB55Y2xfC95E= MIME-Version: 1.0 In-Reply-To: <20110606223321.GA3047@solfire> References: <20110602191951.566gmx1@mp009.gmx.net> <20110606223321.GA3047@solfire> From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Tue, 7 Jun 2011 10:53:20 +0200 Message-ID: Subject: Re: Completion question To: Zsh Users Cc: meino.cramer@gmx.de Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/6/7 : >>mpla/home/me/data/subdira/subdirb/The Long and winding commandline.wav > =C2=A0 =C2=A0 ^ > > If I press TAB now, nothing happens, since zsh seems to take the > whole commandline into account while searching for a possible > completion. And of course > "mpla/home/me/data/subdira/subdirb/The Long and winding commandline.wav" > is not know as a command on my system... ;) > > Is it possible to configure zsh to only take the string from the > beginning up to the position of the cursor into account for the > completion processing ? Maybe a stupid answer, but you just have to add a space for the completion to work as expected, ie: =E2=80=9Cmpla /home/me/data/subdira/subdirb/The Long and winding commandlin= e.wav=E2=80=9D =E2=80=A6with the cursor just after =E2=80=9Cmpla=E2=80=9D. Since it's something you probably do often (at least I do), you may want to automatize: cmdit() { LBUFFER=3D' '$LBUFFER zle beginning-of-line } zle -N cmdit bindkey WHATEVERKEYYOUWANT cmdit I personally have a set of programs I often add at the beginning of a line (sudo, dist, archive extractor, gdb, valgrind=E2=80=A6), now=C2=B9 I o= nly have to type something like : M-x s for sudo M-x g for gdb M-x v for valgrind =E2=80=A6 The cursor does not move, so I can add additional parameters at the end, if needed. Best regards, =C2=B9 https://github.com/Arkanosis/Arkonf/blob/master/zsh/.zsh/prefix --=20 J=C3=A9r=C3=A9mie