From: "Jérémie Roquet" <arkanosis@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Cc: meino.cramer@gmx.de
Subject: Re: Completion question
Date: Tue, 7 Jun 2011 10:53:20 +0200 [thread overview]
Message-ID: <BANLkTinLwhit9V-_UPf3aixyZNufhcSzwA@mail.gmail.com> (raw)
In-Reply-To: <20110606223321.GA3047@solfire>
2011/6/7 <meino.cramer@gmx.de>:
>>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
next prev parent reply other threads:[~2011-06-07 9:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110602191951.566gmx1@mp009.gmx.net>
2011-06-06 22:33 ` meino.cramer
2011-06-07 5:12 ` Jun T.
2011-06-07 8:29 ` Peter Stephenson
2011-06-07 8:53 ` Jérémie Roquet [this message]
2004-08-31 11:02 Completion Question Sean Johnston
2004-08-31 11:51 ` Oliver Kiddle
-- strict thread matches above, loose matches on Subject: below --
2003-02-06 1:32 completion question Le Wang
2003-02-10 11:06 ` Oliver Kiddle
2002-08-09 6:51 Completion question Byron Foster
2002-08-09 7:28 ` Sven Wischnowsky
2002-08-11 3:29 ` Byron Foster
2002-06-11 11:40 jarausch
2002-06-11 11:55 ` Sven Wischnowsky
2001-07-30 2:15 completion question Eric D. Friedman
2001-07-30 2:32 ` Bart Schaefer
[not found] <20010704142951.B4036@dlux.hu>
2001-07-04 12:50 ` Andrej Borsenkow
2001-07-04 13:02 ` Nadav Har'El
2001-07-04 13:27 ` Andrej Borsenkow
2001-07-04 14:45 ` dLux
2001-07-04 15:43 ` Sven Wischnowsky
2001-07-04 15:47 ` Sven Wischnowsky
2001-07-04 10:57 dLux
2001-07-04 11:10 ` Andrej Borsenkow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTinLwhit9V-_UPf3aixyZNufhcSzwA@mail.gmail.com \
--to=arkanosis@gmail.com \
--cc=meino.cramer@gmx.de \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).