Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion question
- X-seq: zsh-users 16087
- From: Jérémie Roquet <arkanosis@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Completion question
- Date: Tue, 7 Jun 2011 10:53:20 +0200
- Cc: meino.cramer@xxxxxx
- 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=
- In-reply-to: <20110606223321.GA3047@solfire>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20110602191951.566gmx1@mp009.gmx.net> <20110606223321.GA3047@solfire>
2011/6/7 <meino.cramer@xxxxxx>:
>>mpla/home/me/data/subdira/subdirb/The Long and winding commandline.wav
> ^
>
> 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:
“mpla /home/me/data/subdira/subdirb/The Long and winding commandline.wav”
…with the cursor just after “mpla”.
Since it's something you probably do often (at least I do), you may
want to automatize:
cmdit() {
LBUFFER=' '$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…), now¹ I only have
to type something like :
M-x s for sudo
M-x g for gdb
M-x v for valgrind
…
The cursor does not move, so I can add additional parameters at the
end, if needed.
Best regards,
¹ https://github.com/Arkanosis/Arkonf/blob/master/zsh/.zsh/prefix
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author