zsh-users
 help / color / mirror / code / Atom feed
* completion and history
@ 1998-03-01 20:12 Jimmy Mäkelä
  1998-03-02  6:53 ` Mircea Damian
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jimmy Mäkelä @ 1998-03-01 20:12 UTC (permalink / raw)
  To: zsh-users

I have got this compctl to unzip files into a directory based on their name,
but i would like to know of a cleaner way to do this, especially the
function. How would i for example do if i wanted to be able to add a -dNAME
for each of the arguments before the current on the commandline like:
unzip 1.zip 2.zip 3.zip <TAB> gives:
unzip 1.zip 2.zip 3.zip -d1 -d2 -d3

--------CUT-----------
compctl -x 'p[1]' -g '*.(zip|ZIP)' - 'p[2]' -K compzip -- unzip

>From the compzip function:
read -c z
z=`echo $z|awk '{print $2}'|awk -F . '{print $1}'`
reply=("-d$z")
return
----------------------

And how do i get the appendhistory thing to work, what have i done wrong:

% grep HIST .zshrc
HISTSIZE=200
HISTFILE=.zshistory

% ls -o .zshistory
-rw-------   1 jmy             0 Feb 23 20:16 .zshistory

% grep setopt .zshrc|grep hist
setopt   correctall autocd longlistjobs nobeep automenu appendhistory
setopt   autoresume histignoredups pushdsilent noclobber


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

* Re: completion and history
  1998-03-01 20:12 completion and history Jimmy Mäkelä
@ 1998-03-02  6:53 ` Mircea Damian
  1998-03-02  8:26   ` Geoff Wing
  1998-03-03 16:32   ` history file reset to 0 Vincent Lefevre
  1998-03-02  8:42 ` completion and history Geoff Wing
  1998-03-02  8:56 ` Peter Stephenson
  2 siblings, 2 replies; 8+ messages in thread
From: Mircea Damian @ 1998-03-02  6:53 UTC (permalink / raw)
  To: zsh-users

On Sun, Mar 01, 1998 at 09:12:09PM +0100, Jimmy Mäkelä wrote:
> And how do i get the appendhistory thing to work, what have i done wrong:
> 
> % grep HIST .zshrc
> HISTSIZE=200
> HISTFILE=.zshistory
> 
> % ls -o .zshistory
> -rw-------   1 jmy             0 Feb 23 20:16 .zshistory
> 
> % grep setopt .zshrc|grep hist
> setopt   correctall autocd longlistjobs nobeep automenu appendhistory
> setopt   autoresume histignoredups pushdsilent noclobber

I do have the same problem(?) with history.
I'm using zsh 3.0.5.

setopt appendhistory nobgnice correctall extendedhistory histnostore listtypes
setopt setopt histignoredups histignorespace nobeep autocd autolist nonomatch


Question:
 How do I make TAB to work in the same way that it does in bash? (2x<TAB>
gives a list of possible completions)

-- 
Mircea Damian
Kappa Administrator
dmircea@roedu.net, dmircea@lbi.ro, dmircea@kappa.ro
MD65-RIPE, MD2225, MD1-6BONE


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

* Re: completion and history
  1998-03-02  6:53 ` Mircea Damian
@ 1998-03-02  8:26   ` Geoff Wing
  1998-03-03 16:32   ` history file reset to 0 Vincent Lefevre
  1 sibling, 0 replies; 8+ messages in thread
From: Geoff Wing @ 1998-03-02  8:26 UTC (permalink / raw)
  To: zsh-users

Mircea Damian <dmircea@mail.kappa.ro> typed:
:On Sun, Mar 01, 1998 at 09:12:09PM +0100, Jimmy Mäkelä wrote:
:> And how do i get the appendhistory thing to work, what have i done wrong:
:> % grep HIST .zshrc
:> HISTSIZE=200
:> HISTFILE=.zshistory
:> % ls -o .zshistory
:> -rw-------   1 jmy             0 Feb 23 20:16 .zshistory
:> % grep setopt .zshrc|grep hist
:> setopt   correctall autocd longlistjobs nobeep automenu appendhistory
:> setopt   autoresume histignoredups pushdsilent noclobber
:I do have the same problem(?) with history.
:I'm using zsh 3.0.5.
:setopt appendhistory nobgnice correctall extendedhistory histnostore listtypes
:setopt setopt histignoredups histignorespace nobeep autocd autolist nonomatch

Use a pathname when you initialise HISTFILE: ``HISTFILE=~/.zhistory''

:Question:
: How do I make TAB to work in the same way that it does in bash? (2x<TAB>
:gives a list of possible completions)

RTFM, zsh_options.  Look for AUTO_MENU and MENU_COMPLETE
-- 
Geoff Wing   <gcw@pobox.com>            Mobile : 0412 162 441 
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/


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

* Re: completion and history
  1998-03-01 20:12 completion and history Jimmy Mäkelä
  1998-03-02  6:53 ` Mircea Damian
@ 1998-03-02  8:42 ` Geoff Wing
  1998-03-02 15:57   ` Jimmy Mäkelä
  1998-03-02  8:56 ` Peter Stephenson
  2 siblings, 1 reply; 8+ messages in thread
From: Geoff Wing @ 1998-03-02  8:42 UTC (permalink / raw)
  To: zsh-users

Jimmy Mäkelä <jmy@flashback.net> typed:
:I have got this compctl to unzip files into a directory based on their name,
:but i would like to know of a cleaner way to do this, especially the
:function. How would i for example do if i wanted to be able to add a -dNAME
:for each of the arguments before the current on the commandline like:
:unzip 1.zip 2.zip 3.zip <TAB> gives:
:unzip 1.zip 2.zip 3.zip -d1 -d2 -d3

Umm, you've got a funny version of unzip if you can specify more than one
archive.  Can it?  Also, your compzip function doesn't need to run any
other commands:

compzip() {
	local a b
	read -c a
	b=(${=a})
	reply=("-d${b[2]:r}")
}

:--------CUT-----------
:compctl -x 'p[1]' -g '*.(zip|ZIP)' - 'p[2]' -K compzip -- unzip
:
:From the compzip function:
:read -c z
:z=`echo $z|awk '{print $2}'|awk -F . '{print $1}'`
:reply=("-d$z")
:return
:----------------------
:
:And how do i get the appendhistory thing to work, what have i done wrong:
:% grep HIST .zshrc
:HISTSIZE=200
:HISTFILE=.zshistory

HISTFILE=~/.zshistory
-- 
Geoff Wing   <gcw@pobox.com>            Mobile : 0412 162 441 
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/


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

* Re: completion and history
  1998-03-01 20:12 completion and history Jimmy Mäkelä
  1998-03-02  6:53 ` Mircea Damian
  1998-03-02  8:42 ` completion and history Geoff Wing
@ 1998-03-02  8:56 ` Peter Stephenson
  1998-03-02  9:54   ` Mircea Damian
  2 siblings, 1 reply; 8+ messages in thread
From: Peter Stephenson @ 1998-03-02  8:56 UTC (permalink / raw)
  To: jmy, Zsh users list

> And how do i get the appendhistory thing to work, what have i done wrong:
> 
> % grep HIST .zshrc
> HISTSIZE=200
> HISTFILE=.zshistory

What you also need and hasn't yet been mentioned is to set SAVEHIST.
HISTSIZE specifies the size of the history that will be kept within
the shell, SAVEHIST the size that will be saved --- in your case
probably 0.  SAVEHIST=200 would be a good bet.

I feel another FAQ entry coming on.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +39 50 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy



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

* Re: completion and history
  1998-03-02  8:56 ` Peter Stephenson
@ 1998-03-02  9:54   ` Mircea Damian
  0 siblings, 0 replies; 8+ messages in thread
From: Mircea Damian @ 1998-03-02  9:54 UTC (permalink / raw)
  To: Zsh users list

On Mon, Mar 02, 1998 at 09:56:56AM +0100, Peter Stephenson wrote:
> > And how do i get the appendhistory thing to work, what have i done wrong:
> > 
> > % grep HIST .zshrc
> > HISTSIZE=200
> > HISTFILE=.zshistory
> 
> What you also need and hasn't yet been mentioned is to set SAVEHIST.
> HISTSIZE specifies the size of the history that will be kept within
> the shell, SAVEHIST the size that will be saved --- in your case
> probably 0.  SAVEHIST=200 would be a good bet.
> 
> I feel another FAQ entry coming on.

Yes you're right... As a new user I was puzzled. I think that a default
value of 30-50 entries would be better than an uninitialized variable.

-- 
Mircea Damian
Kappa Administrator
dmircea@roedu.net, dmircea@lbi.ro, dmircea@kappa.ro
MD65-RIPE, MD2225, MD1-6BONE
Phone: +40-1-7719245


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

* Re: completion and history
  1998-03-02  8:42 ` completion and history Geoff Wing
@ 1998-03-02 15:57   ` Jimmy Mäkelä
  0 siblings, 0 replies; 8+ messages in thread
From: Jimmy Mäkelä @ 1998-03-02 15:57 UTC (permalink / raw)
  To: zsh-users

On Mon, Mar 02, 1998 at 08:42:05AM +0000, Geoff Wing wrote:
> Umm, you've got a funny version of unzip if you can specify more than one
> archive.  Can it?  Also, your compzip function doesn't need to run any
> other commands:

no..i just wanted to know how i would have done _if_ it could :)

> compzip() {
> 	local a b
> 	read -c a
> 	b=(${=a})
> 	reply=("-d${b[2]:r}")
> }

thanks.


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

* history file reset to 0
  1998-03-02  6:53 ` Mircea Damian
  1998-03-02  8:26   ` Geoff Wing
@ 1998-03-03 16:32   ` Vincent Lefevre
  1 sibling, 0 replies; 8+ messages in thread
From: Vincent Lefevre @ 1998-03-03 16:32 UTC (permalink / raw)
  To: zsh-users

On Mon, Mar 02, 1998 at 08:53:48 +0200, Mircea Damian wrote:
> I do have the same problem(?) with history.
> I'm using zsh 3.0.5.

Me too. Sometimes, when I logout, the history file is reset to 0.
I have:

HISTFILE=$HOME/.zhistory
HISTSIZE=2000
SAVEHIST=2000

It seems to be a problem with the locking mechanism.

-- 
Vincent Lefevre <vlefevre@ens-lyon.fr> | Acorn Risc PC, StrongARM @ 202MHz
WWW: http://www.ens-lyon.fr/~vlefevre/ | 20+2MB RAM, Eagle M2, TV + Teletext
PhD st. in Computer Science, 2nd year  | Apple CD-300, SyQuest 270MB (SCSI)
-----------------------------------------------------------------------------


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

end of thread, other threads:[~1998-03-03 16:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-01 20:12 completion and history Jimmy Mäkelä
1998-03-02  6:53 ` Mircea Damian
1998-03-02  8:26   ` Geoff Wing
1998-03-03 16:32   ` history file reset to 0 Vincent Lefevre
1998-03-02  8:42 ` completion and history Geoff Wing
1998-03-02 15:57   ` Jimmy Mäkelä
1998-03-02  8:56 ` Peter Stephenson
1998-03-02  9:54   ` Mircea Damian

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