[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: zsh and bash [was: can't the shell do a better job]



On Tue, 11 Jan 2005, Sam Watkins wrote:

First, I'm sorry it took me so long to reply. I slacked off checking my
debian-user mail. :/

On Fri, Jan 07, 2005 at 07:54:54PM -0600, Aaron Hall wrote:
* The completion system is very good, and smart completions for many
  different commands are standard. I think you can get write a
  completion to get zsh to feed your fish, but that requires knowledge
  of styles.

Is the smart completions significantly better than or different from
/etc/bash_completion?

I can't say for sure; I've never used bash as my interactive shell. From
a brief skimming of the manual, it looks like the -F and -C options
bring it closest to the "new" zsh system. (The "old" zsh system uses a
command called compctl, which is similar to tcsh's complete command).

* You can bind keys to scripts that manipulate the command line you're
  currently editing. One keystroke pops me into vi where I can edit,
  quit, and run my edited command.

Apparently you can do this in bash too, with ^X^E.  You need to set
EDITOR or VISUAL to your favorite editor else it uses emacs.  This will
be very useful for converting one-liners into scripts, thanks for
mentioning it.

The system isn't limited to that -- you can rewrite any of the bound
keys. I've got another couple widgets that modify ^A and ^E (which I got
used to in tcsh) to work in vi-command mode. They move the cursor to the
front or end of the line, *and* get me out of vi-command mode back into
standard insert mode. Usually, ^A and ^E do nothing in zsh's vi-command
mode, and if I had just bound the pre-existing commands for those
keystrokes, they'd move me to one end of the line or other, but
wouldn't put me in insert mode.

You can get the editor widgets to do some fairly fancy tricks (modifying
the line you're working on and such), but I've never had an itch to do
that, myself.

- Aaron

--
Aaron Hall           :      Advertising may be described as the science of
ahall@vitaphone.net  :      arresting human intelligence long enough to
                     :      get money from it.
                     :                           -- Stephen Butler Leacock



Reply to: