From owner-freebsd-questions@FreeBSD.ORG Thu Sep 26 22:12:56 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7022C36B for ; Thu, 26 Sep 2013 22:12:56 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F9662E86 for ; Thu, 26 Sep 2013 22:12:56 +0000 (UTC) Received: from r56.edvax.de (port-92-195-74-65.dynamic.qsc.de [92.195.74.65]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 95F4AA712; Fri, 27 Sep 2013 00:12:53 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r8QMCk8O003965; Fri, 27 Sep 2013 00:12:46 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Fri, 27 Sep 2013 00:12:46 +0200 From: Polytropon To: Gary Kline Subject: Re: minor vi/vim qstn Message-Id: <20130927001246.b2d12d91.freebsd@edvax.de> In-Reply-To: <20130926205819.GB24184@ethic.thought.org> References: <20130925212741.GA19434@ethic.thought.org> <20130926002327.6502d1b9.freebsd@edvax.de> <20130926002104.GA12932@ethic.thought.org> <20130926030600.8850ddc5.freebsd@edvax.de> <20130926024708.GA3908@ethic.thought.org> <20130926152629.89e6dd72.freebsd@edvax.de> <20130926195132.GA24184@ethic.thought.org> <20130926220506.d9c11563.freebsd@edvax.de> <20130926205819.GB24184@ethic.thought.org> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2013 22:12:56 -0000 On Thu, 26 Sep 2013 13:58:19 -0700, Gary Kline wrote: > Organization: Thought Unlimited. Public service Unix since 1986. > Of_Interest: With 27 years of service to the Unix community. > > On Thu, Sep 26, 2013 at 10:05:06PM +0200, Polytropon wrote: > > I also assume the zsh has some settings on how many commands > > should be kept in history. The system's /etc/csh.cshrc provides > > the csh's equivalent: > > > > set history = 100 > > set savehist = 100 > > > I'remember seeing this a long time ago. in my ~/.zshrc I've got > iit in all CAPS. > > > > HISTFILE=~/.zhistory > SAVEHIST='5000' > HISTSIZE=1000 > > > got to google this; been tooo long since I glanced at the code! That's probably correct, it reflects the "sh-like aspects" of code (as I said, csh is a terrible scripting shell, and this is also true regarding its configuration files). So those entries look correct. I'm not a zsh user, so I can't say this for sure. I'm heavily infected with csh already. ;-) On Thu, 26 Sep 2013 14:15:17 -0700, Gary Kline wrote: > FWIW, I just tried: > > alias -- h='history 50' > > > works as it ought; last time I tried, the history quit > after ~10. [?] The reason might be that the history, at this point in time, did only contain 10 entries. I don't know how the content of ~/.zhistory behaves if more than one shell is running for a given user... The Z shell is very customizable and can automate routine tasks (regarding the shell dialog) in a pleasant manner. If you want the last 10 commands to be displayed before the shell prompt appears, try something like this in ~/.zshrc: function precmd { history 10 | awk 'BEGIN {histcmds=10} { printf("\t%2d\t%s\n", -(histcmds-i), $0); i++ }' | grep -v "histcmds" } Not tested, but it seems to be much easier as zsh simply defines a function "precmd" and doesn't require the user to fight with quotes, doublequotes and escaping as csh successfully does. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...