zsh-users
 help / color / mirror / code / Atom feed
* Re: Completion
@ 2000-02-22 11:36 Sven Wischnowsky
  2000-02-22 14:24 ` Completion Andy Spiegl
  0 siblings, 1 reply; 56+ messages in thread
From: Sven Wischnowsky @ 2000-02-22 11:36 UTC (permalink / raw)
  To: zsh-users


Andy Spiegl wrote:

> Hi Bart,
> 
> > zstyle '*:ssh:*:my-accounts' users-hosts tractrix:kom.auc.dk ...
> > zstyle '*:rsh:*:my-accounts' users-hosts alboege:fictitious.com ...
> > 
> > There are also styles that are lists of hosts, users, other-accounts, etc.,
> > but you can cover most of the cases for ssh with just this one.
> Is there anything similar for scp/rcp?
> 
> tcsh has a completion rule like this:
>  complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@'  'n/*/$hosts/:'

Urgh. Anyone want to argue about the syntax of compctl or the
completion functions again? ;-)

> I suppose this could be done in zsh (because everything can be done with
> zsh), but I am still not fit enough with the zsh syntax. :-(  So I would be 
> glad if someone had done it already.

Eh? The completion system contains functions[1] for rcp and scp, so it
should work out-of-the-box.

Bye
 Sven

[1] They are actually functions for the r{sh,login,...} and ssh suites.

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 56+ messages in thread
* completion
@ 2014-12-10 23:15 Ray Andrews
  2014-12-10 23:31 ` completion Lawrence Velázquez
  2014-12-11  0:34 ` completion Oliver Kiddle
  0 siblings, 2 replies; 56+ messages in thread
From: Ray Andrews @ 2014-12-10 23:15 UTC (permalink / raw)
  To: Zsh Users

Peter, Oliver:

In chapter 10 of 'the book', at one point you start doing this:

     zstyle ':completion:::::' completer _complete _approximate

... I missed any leading explanation of what those five colons
are doing.

Playing with matcher-list, you have some good ideas there.
I currently have all that completion/matcher stuff copied in
from some website of sample .zshrc's  and it was all taken on
faith, since I hadn't the slightest clue how all that stuff works.
Since I'm now trying to understand it, the current line I have
contains this:

     zstyle ':completion:*' matcher-list    ...   'r:|[._-]=* r:|=* l:|=*'

... at the risk of insanity, what is that incantation doing, and
do I want it?  Gentle generalities are fine.


^ permalink raw reply	[flat|nested] 56+ messages in thread
* completion
@ 2012-12-03 17:44 Ray Andrews
  2012-12-03 18:31 ` completion Ray Andrews
  0 siblings, 1 reply; 56+ messages in thread
From: Ray Andrews @ 2012-12-03 17:44 UTC (permalink / raw)
  To: zsh-users

Gentlemen:

I'm trying to get command line completion to only offer me lines that 
are an exact match for what has already been typed.  The number of 
things you can set in .zshrc is a bit overwhelming. I have all this just 
for 'completion' and I confess I have little idea what does what:

zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*:killall:*' command 'ps -u $USER -o cmd'
zstyle ':completion:*' menu select
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:cd:*' ignore-parents parent pwd

Can anyone rationalize all that?  I'm going to hack away at it blindly 
in the mean time, but some fatherly advice would be apreciated.

Tx.


^ permalink raw reply	[flat|nested] 56+ messages in thread
* Completion
@ 2007-05-15 15:27 Anonymous bin ich
  2007-05-15 16:23 ` Completion Peter Stephenson
  0 siblings, 1 reply; 56+ messages in thread
From: Anonymous bin ich @ 2007-05-15 15:27 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 124 bytes --]

Hi!

I want to add a completion which lists only those files/directories which
belong to a certain user(s). Is it possible?

[-- Attachment #2: Type: text/html, Size: 134 bytes --]

^ permalink raw reply	[flat|nested] 56+ messages in thread
* Completion
@ 2006-02-20 12:54 Etienne Chové
  2006-02-20 18:51 ` Completion Clint Adams
  0 siblings, 1 reply; 56+ messages in thread
From: Etienne Chové @ 2006-02-20 12:54 UTC (permalink / raw)
  To: zsh-users

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm trying to make a completion for a script, the command look like :
whos nom=nom1&prenom=prenom2

I wrote a completion funtion like :
<begin>
#compdef whos

_recherche () {
  if compset -S '' -P '(|*&)'; then
    compadd -S '=' - nom prenom
  elif compset -P '*A'; then
    compadd - nom1 nom2
  elif compset -P '*prenom='; then
    compadd - prenom1 prenom2
  fi
}

_arguments \
  '*:expression:_recherche'
</end>

But it won't complete prenom because it match with the first condition. Is
th'ere a easy colution to have completion ?

Thanks.

- --
Etienne
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD+bv1vsnSxJjnYzIRAruxAJ9O4jfI/P17yeDEY2HNHFq8JrvLdACeKfbl
rXNChIVCM9RlyPbWdudv6AA=
=ow3l
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 56+ messages in thread
* Completion
@ 2003-12-22 23:15 Seth Kurtzberg
  0 siblings, 0 replies; 56+ messages in thread
From: Seth Kurtzberg @ 2003-12-22 23:15 UTC (permalink / raw)
  To: Zsh Users' List

I have a question about zsh completion.  It does just about everything 
exactly the way I want it to after setting up the various configuration 
switches.

There is one problem I don't know how to solve.  When I run the java 
command, zsh will not do completion on arguments following a classpath 
flag (for example, java -classpath . abc/def/ClassFileName).  Can this 
be fixed with a configuration flag?

Thanks in advance,

-----------------------------------------------------------------
Seth Kurtzberg
CTO
ISEC Research and Network Operations Center
480-314-1540
888-879-5206
seth@isec.us
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 56+ messages in thread
* Re: Completion
@ 2000-02-22 14:58 Sven Wischnowsky
  0 siblings, 0 replies; 56+ messages in thread
From: Sven Wischnowsky @ 2000-02-22 14:58 UTC (permalink / raw)
  To: zsh-users


I wrote:

> ...
> (and how: using `rsh ... ls' or
>    zftp)

Oh, and of course, completion for zftp (and the convenience functions
that come with it) works. Including completion of remote files and so on.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 56+ messages in thread
* Re: Completion
@ 2000-02-22 14:47 Sven Wischnowsky
  2000-02-22 15:01 ` Completion Andy Spiegl
  0 siblings, 1 reply; 56+ messages in thread
From: Sven Wischnowsky @ 2000-02-22 14:47 UTC (permalink / raw)
  To: zsh-users


Andy Spiegl wrote:

> Hi Sven,
> 
> > > tcsh has a completion rule like this:
> > >  complete rcp 'c%*@*:%`set q=$:-0;set q="$q:s/@/ /";set q="$q:s/:/ /";set q=($q " ");rsh $q[2] -l $q[1] ls -dp $q[3]\*`%' 'c%*:%`set q=$:-0;set q="$q:s/:/ /";set q=($q " ");rsh $q[1] ls -dp $q[2]\*`%' 'c%*@%$hosts%:' 'C@[./$~]*@f@'  'n/*/$hosts/:'
> > 
> > Urgh. Anyone want to argue about the syntax of compctl or the
> > completion functions again? ;-)
> :-)
> 
> > Eh? The completion system contains functions[1] for rcp and scp, so it
> > should work out-of-the-box.
> Hm, no, not really.  Maybe I am blind (happens too often anyway), but here
> only user@host and option completions are done.  But maybe - from looking
> at the tcsh-code - it was not clear what I meant.

No it wasn't... until I now looked closer and found the calls to `rsh'.

> Say I press TAB after this:
>  $ scp foo me@bar:/usr/local/_
> Then I would like to see the files and directories on the remote host "bar",
> but what I see is the possible completions for my own host.

Hm. Depending on what you think about us[1], you may think that we:

1) weren't sure if we should do that (and how: using `rsh ... ls' or
   zftp), because there may be systems without rsh (offering only
   ssh), because you may need something like .rhosts for this to work, 
   which is evil, because it can get pretty expensive, right[2]?
2) were just too lazy to implement that[3]


Bye
 Sven

[1] I think I wrote the two initially, but I also think someone else
    had his fingers in them after that.
[2] This only really means that we should make it configurable: to use 
    either rsh or zftp or not try remote-completion and so on...
[3] Actually, I *had* thought about trying to do that, was slightly
    scared because of 2) and then forgot.

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 56+ messages in thread
* Completion
@ 2000-02-15  8:42 Claus Alboege
  2000-02-21 22:20 ` Completion Bart Schaefer
  0 siblings, 1 reply; 56+ messages in thread
From: Claus Alboege @ 2000-02-15  8:42 UTC (permalink / raw)
  To: zsh-users

Hi,

Could anyone tell me how to make zsh (3.1.6-*) complete in this fasion:

ssh <hostname from hostlist> -l <username from userlist>

Sorry for this RTFM like question :)


-- 
Mvh Claus Alboege


^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2015-01-14  2:57 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-22 11:36 Completion Sven Wischnowsky
2000-02-22 14:24 ` Completion Andy Spiegl
2000-02-22 18:01   ` Completion Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2014-12-10 23:15 completion Ray Andrews
2014-12-10 23:31 ` completion Lawrence Velázquez
2014-12-11  0:34 ` completion Oliver Kiddle
2014-12-11  1:17   ` completion Ray Andrews
2014-12-11  5:44     ` completion Bart Schaefer
2014-12-11 16:40       ` completion Ray Andrews
2014-12-11 17:28         ` completion Bart Schaefer
2014-12-11 19:34           ` completion Ray Andrews
2015-01-07 15:01             ` completion Vincent Lefevre
2015-01-07 15:28               ` completion Peter Stephenson
2015-01-07 16:58                 ` completion Mikael Magnusson
2015-01-07 17:06                   ` completion Peter Stephenson
2015-01-07 18:33                   ` completion Ray Andrews
     [not found]                     ` <CAH+w=7Z_B2ghc21QgHxA8FEV7W8uQnjEwtPqK3tL-kjPihjicA@mail.gmail.com>
2015-01-07 19:54                       ` completion Bart Schaefer
2015-01-07 18:48               ` completion Bart Schaefer
2015-01-07 19:24                 ` completion Ray Andrews
2015-01-07 19:33                   ` completion Lawrence Velázquez
2015-01-07 20:06                     ` completion Ray Andrews
2015-01-07 19:51                   ` completion Bart Schaefer
2015-01-07 20:15                     ` completion Ray Andrews
2015-01-07 20:42                     ` completion Bart Schaefer
2015-01-07 23:00                       ` completion Ray Andrews
2015-01-08  5:09                         ` completion Bart Schaefer
2015-01-08  8:31                         ` completion Bart Schaefer
2015-01-08 16:52                           ` completion Ray Andrews
2015-01-08  0:43                 ` completion Vincent Lefevre
2015-01-08  0:57                   ` completion ZyX
2015-01-08  1:15                     ` completion Vincent Lefevre
2015-01-08  6:03                       ` completion Bart Schaefer
2015-01-08  5:26                   ` completion Bart Schaefer
2015-01-08 12:36                     ` completion Vincent Lefevre
2015-01-10  2:12                       ` completion Bart Schaefer
2015-01-12  9:09                         ` completion Vincent Lefevre
2015-01-12 16:43                           ` completion Bart Schaefer
2015-01-13 16:03                             ` completion Vincent Lefevre
2015-01-14  2:56                               ` completion Bart Schaefer
2015-01-08 17:12                     ` completion Ray Andrews
2015-01-09  9:37                       ` completion Vincent Lefevre
2015-01-10  5:33                       ` completion Bart Schaefer
2012-12-03 17:44 completion Ray Andrews
2012-12-03 18:31 ` completion Ray Andrews
2007-05-15 15:27 Completion Anonymous bin ich
2007-05-15 16:23 ` Completion Peter Stephenson
2006-02-20 12:54 Completion Etienne Chové
2006-02-20 18:51 ` Completion Clint Adams
2006-02-20 19:47   ` Completion Etienne Chové
2003-12-22 23:15 Completion Seth Kurtzberg
2000-02-22 14:58 Completion Sven Wischnowsky
2000-02-22 14:47 Completion Sven Wischnowsky
2000-02-22 15:01 ` Completion Andy Spiegl
2000-02-15  8:42 Completion Claus Alboege
2000-02-21 22:20 ` Completion Bart Schaefer
2000-02-22 10:37   ` Completion Andy Spiegl

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).