Re: proposed small change to .cshrc

2001-01-10 Thread Matt Dillon


:
:On Tue, Jan 09, 2001 at 04:52:29PM -0800, Matt Dillon wrote:
:
:> If you just hit the up or down arrow without having partial text on the
:> line, it works just like normal history.  Once you start using it,
:> you will never be able to go back.
:
:As a side note - this is usually mapped to escpae-p - it is very useful.
:
:   David.

   Yes, but not as a multi-key keystroke.  Up-arrow is a thousand times 
   easier to hit.

-Matt



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: proposed small change to .cshrc

2001-01-10 Thread David Malone

On Tue, Jan 09, 2001 at 04:52:29PM -0800, Matt Dillon wrote:

> If you just hit the up or down arrow without having partial text on the
> line, it works just like normal history.  Once you start using it,
> you will never be able to go back.

As a side note - this is usually mapped to escpae-p - it is very useful.

David.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: proposed small change to .cshrc

2001-01-09 Thread Matt Dillon

:Matt Dillon writes:
:> if ( $?tcsh ) then
:> bindkey "^W" backward-delete-word
:> bindkey -k up history-search-backward
:> bindkey -k down history-search-forward
:> endif
:
:Why do you need the 'up' and 'down' ones.. doesn't it already do that
:without explicit configuration?
:
:-Archie

This is the history *search* function.  Lets say you did a complex
'find' command 5 minutes ago and a hundred intervening commands since,
and you want to run the 'find' again.  

You type:

% fin

If you did a bunch of find's, hit up arrow as many times as necessary.
You can type as few or as many characters as you like prior to hitting
the up arrow, depends on what you are looking for.

If you just hit the up or down arrow without having partial text on the
line, it works just like normal history.  Once you start using it,
you will never be able to go back.

This is how the Amiga used to do it.  It's the only right way.

-Matt



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: proposed small change to .cshrc

2001-01-09 Thread Archie Cobbs

Matt Dillon writes:
> if ( $?tcsh ) then
> bindkey "^W" backward-delete-word
> bindkey -k up history-search-backward
> bindkey -k down history-search-forward
> endif

Why do you need the 'up' and 'down' ones.. doesn't it already do that
without explicit configuration?

-Archie

__
Archie Cobbs * Packet Design * http://www.packetdesign.com


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: proposed small change to .cshrc

2001-01-09 Thread Daniel Eischen

On Tue, 9 Jan 2001, Peter Wemm wrote:
> Matt Dillon wrote:
> > 
> > :On Tue, Jan 09, 2001 at 09:45:14AM -0800, Archie Cobbs wrote:
> > :
> > :> +if ( `basename $SHELL` == "tcsh" ) then
> > :> +bindkey ^W backward-delete-word
> > :> +endif
> > :
> > :I generally test for tcsh like this:
> > :
> > :   if ( $?tcsh ) then
> > :   bindkey ^W backward-delete-word
> > :   endif
> > :
> > :-- 
> > :Jon Parise ([EMAIL PROTECTED])  .  Rochester Inst. of Technology
> > 
> > How about this:
> > 
> > if ( $?tcsh ) then
> > bindkey "^W" backward-delete-word
> > bindkey -k up history-search-backward
> > bindkey -k down history-search-forward
> > endif
> 
> I was about to write a 'over my dead body' here, but I tried it out and
> discovered that the POLA (for tcsh users) is not too bad after all.  In
> fact, I think I will add this to my .tcshrc :-)

Just use bash ;-)

-- 
Dan Eischen


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: proposed small change to .cshrc

2001-01-09 Thread Peter Wemm

Matt Dillon wrote:
> 
> :On Tue, Jan 09, 2001 at 09:45:14AM -0800, Archie Cobbs wrote:
> :
> :> +  if ( `basename $SHELL` == "tcsh" ) then
> :> +  bindkey ^W backward-delete-word
> :> +  endif
> :
> :I generally test for tcsh like this:
> :
> : if ( $?tcsh ) then
> : bindkey ^W backward-delete-word
> : endif
> :
> :-- 
> :Jon Parise ([EMAIL PROTECTED])  .  Rochester Inst. of Technology
> 
> How about this:
> 
> if ( $?tcsh ) then
> bindkey "^W" backward-delete-word
> bindkey -k up history-search-backward
> bindkey -k down history-search-forward
> endif

I was about to write a 'over my dead body' here, but I tried it out and
discovered that the POLA (for tcsh users) is not too bad after all.  In
fact, I think I will add this to my .tcshrc :-)

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: proposed small change to .cshrc

2001-01-09 Thread Matt Dillon


:On Tue, Jan 09, 2001 at 09:45:14AM -0800, Archie Cobbs wrote:
:
:> +if ( `basename $SHELL` == "tcsh" ) then
:> +bindkey ^W backward-delete-word
:> +endif
:
:I generally test for tcsh like this:
:
:   if ( $?tcsh ) then
:   bindkey ^W backward-delete-word
:   endif
:
:-- 
:Jon Parise ([EMAIL PROTECTED])  .  Rochester Inst. of Technology

How about this:

if ( $?tcsh ) then
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
endif

For personal use I also do (for tcsh):

set prompt = "%m:%/%# "

But the Amiga-style integrated history search is the feature I use the
most.   Having a multi-thousand line history actually becomes useful.

-Matt



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: proposed small change to .cshrc

2001-01-09 Thread Jon Parise

On Tue, Jan 09, 2001 at 09:45:14AM -0800, Archie Cobbs wrote:

> + if ( `basename $SHELL` == "tcsh" ) then
> + bindkey ^W backward-delete-word
> + endif

I generally test for tcsh like this:

if ( $?tcsh ) then
bindkey ^W backward-delete-word
endif

-- 
Jon Parise ([EMAIL PROTECTED])  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



proposed small change to .cshrc

2001-01-09 Thread Archie Cobbs

I think the patch below (in some form) was agreed upon a while ago
but nobody actually committed it.. in any case, are there any
objections?

This makes it so if root's shell is /bin/tcsh then CTRL-W erases
only the previous word instead of the entire line.

Thanks,
-Archie

__
Archie Cobbs * Packet Design * http://www.packetdesign.com

Index: src/etc/root/dot.cshrc
===
RCS file: /home/ncvs/src/etc/root/dot.cshrc,v
retrieving revision 1.27
diff -u -r1.27 dot.cshrc
--- dot.cshrc   2000/05/28 15:09:31 1.27
+++ dot.cshrc   2001/01/09 17:44:00
@@ -27,4 +27,7 @@
set history = 100
set savehist = 100
set mail = (/var/mail/$USER)
+   if ( `basename $SHELL` == "tcsh" ) then
+   bindkey ^W backward-delete-word
+   endif
 endif


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message