From owner-freebsd-current@FreeBSD.ORG Fri Feb 10 17:28:20 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9C17106564A; Fri, 10 Feb 2012 17:28:20 +0000 (UTC) (envelope-from wkoszek@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by mx1.freebsd.org (Postfix) with ESMTP id 0BB938FC17; Fri, 10 Feb 2012 17:28:19 +0000 (UTC) Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by freebsd.czest.pl (8.14.5/8.14.5) with ESMTP id q1AHP3fg015313; Fri, 10 Feb 2012 17:25:03 GMT (envelope-from wkoszek@freebsd.czest.pl) Received: (from wkoszek@localhost) by freebsd.czest.pl (8.14.5/8.14.5/Submit) id q1AHP3tR015312; Fri, 10 Feb 2012 17:25:03 GMT (envelope-from wkoszek) Date: Fri, 10 Feb 2012 17:25:03 +0000 From: "Wojciech A. Koszek" To: Warren Block Message-ID: <20120210172503.GB8483@FreeBSD.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.7 (freebsd.czest.pl [212.87.224.105]); Fri, 10 Feb 2012 17:25:03 +0000 (UTC) Cc: Chris Rees , Eitan Adler , freebsd-current Current , Gonzalo Nemmi , Colin Percival Subject: Re: Enhancing the user experience with tcsh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 17:28:20 -0000 On czw, lut 09, 2012 at 11:50:06 -0700, Warren Block wrote: > On Fri, 10 Feb 2012, Gonzalo Nemmi wrote: > ` > > On Thu, Feb 9, 2012 at 9:52 PM, Eitan Adler wrote: > >> In conf/160689 (http://www.freebsd.org/cgi/query-pr.cgi?pr=160689) > > >> there has been some discussion about changing the default cshrc file. > > In the same line that Wojciech on the PR ".cshrc should be updated for > > modern hardware" I always set this ones on /usr/share/skel/dot.cshrc > > > > bindkey "\e[1~" beginning-of-line #make Home key work; > > bindkey "\e[2~" overwrite-mode #make Ins key work; > > bindkey "\e[3~" delete-char #make Delete key work; > > bindkey "\e[4~" end-of-line #make End key work; > > > > Besides that I add an "if [ -d $HOME/bin ]" and add it to $PATH if it > > exists, but that has nothing to do with ".cshrc should be updated for > > modern hardware" ... it jsut comes in really handy. > > The question becomes "how much is too much?" For example, ever since a > thread in the forums showed examples of csh/tcsh autocompletion, I've > thought the default .cshrc should be stuffed with them. Not for typing > reduction so much as self-documenting commands like > > complete chown 'p/1/u/' > complete man 'C/*/c/' > complete service 'n/*/`service -l`/' > > 'service' autocompletes with a list of services--it helps the user by > showing valid choices. Same with 'chown', it gives a list of users. > > Then there's this, which probably isn't quite right but has been useful > to me (thanks to forum members for help with it): > > complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' > > That completes with all lower-case make targets for the current > directory. > > Package operations are easier when the package names autocomplete: > > complete pkg_delete 'c/-/(i v D n p d f G x X r)/' \ > 'n@*@`ls /var/db/pkg`@' > complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' \ > 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@' > > There's lots more that could be done. Are they appropriate for a stock > .cshrc? Maybe now is the time. One of the solutions for this problem would be to have: "source /usr/share/..../csh/autocomplete.csh" in .cshrc. I don't know what the shell speed impact might be, however. -- Wojciech A. Koszek wkoszek@FreeBSD.czest.pl http://FreeBSD.czest.pl/~wkoszek/