From: gwing@primenet.com.au
To: kzhong@onewave.com (Zhong Kaixiang)
Cc: zsh-users@math.gatech.edu
Subject: Re: HISTSIZE and prompt
Date: Sat, 5 Apr 1997 17:36:01 +1000 (EST) [thread overview]
Message-ID: <19970405073602.13018.qmail@primenet.com.au> (raw)
In-Reply-To: <c=US%a=_%p=OneWave%l=OW56-970404155307Z-3406@ow56.onewave.com> from "Zhong, Kaixiang" at "Apr 4, 97 10:53:07 am"
Zhong, Kaixiang wrote:
:In .zshrc, I set HISTSIZE to 100, and it does store previous 100
:commands.
:However, when I type history, it only shows last 16 commands.
:Is there any other variables I should set?
>From the manual:
history
Same as fc -l
fc .... [ first [last ] ]
..... If first is not specified, it will be set
to -1 (the most recent event), or to -16 if the -l
flag is given .....
:Another thing I notices is:
:if I set
:1) 'setopt cdablevars ' to enable that the argument of cd can be an env
:variable,
:2) prompt='%~>'
:3) mydir=/home/kzhong/dir/mydir
:after I 'cd ~mybin', my prompt looks like "~mydir>"
:but if I change 3) to
:3) dir=/home/kzhong/dir/mydir
:and after I 'cd ~dir', my prompt looks like "~/dir/mydir" instead of
:"~dir".
:How can I make it looks like "~dir"?
I think there used to be (and may still be) something in the distribution
which was like this but with some other function name:
expanddir() { eval $1=$2; : ~$1 }
Then you would do:
% expanddir mydir /home/kzhong/dir/mydir
Of course, you could put some error checking in the function to check for the
right number of arguments, existance of $2 (and that it's a directory), etc.
>From the manual:
: [ arg ... ]
This command only expands parameters. A zero exit
code is returned.
Once you have used ``mydir'' as a named directory, ie. as ~mydir , it will be
used in your prompt as a named directory.
--
Geoff Wing [mason@primenet.com.au] Technical Manager
Phone : +61-3-9818 2977 PrimeNet - Internet Consultancy
Facsimile: +61-3-9819 3788 Web : <URL:http://www.primenet.com.au/>
Mobile : 0412 162 441
prev parent reply other threads:[~1997-04-05 7:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-04-04 15:53 Zhong, Kaixiang
1997-04-04 16:29 ` Zefram
1997-04-05 7:36 ` gwing [this message]
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=19970405073602.13018.qmail@primenet.com.au \
--to=gwing@primenet.com.au \
--cc=kzhong@onewave.com \
--cc=zsh-users@math.gatech.edu \
/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).