On Wed, Mar 11, at 08:46 Anton Sharonov wrote:
> 
> So, for the moment the list of the programs which are using
> readline and allowing vi-like key bindings:
> 
>  a) directly :
> 
> - bash

Vi mode is also available in zsh and dash shells.
Note: Zsh is using it's own command line editor (ZLE), and Dash only if
is linked against editline¹ (though there is no support for multibyte
characters).

And vi mode is specified in POSIX,

http://www.opengroup.org/onlinepubs/009695399/utilities/sh.html#tag_04_128_13_03


As a side note and a bit of topic (but since Bash was mentioned and I
can't really understand Bash's popularity) and anyway I can't understand
why the Linux distributions ships with Bash as the default shell.

Zsh is some <exaggeration> thousands times </exaggeration> better as an
interactive shell!, and Dash it serves better for login and system scripts
because is much faster and stable than Bash (Ubuntu is using Dash as 
/bin/sh and Debian is going to follow).

The only excuse is, for writing extensive shell scripts (using specific Bash
extensions).
But in my opinion if you are going to write a complicated shell script,
again is better and faster, to use a portable scripting language like Ruby
or Python, than to rely on unportable Bashisms. Dash also can be used to
write shareable portable scripts between POSIX systems.

Here is an old benchmark (a loop) to compare the differences:

i=0
start=$(date +%s)
while [ "$i" -lt "10000000" ]; do
    i=$(($i+1))
done
echo "total time" $(($(date +%s) - $start)) "seconds"

bash  : 332 seconds in UTF-8
bash  : 220 seconds in C locale
dash  : 64  seconds
zsh   : 106 seconds

# A similar (in logic) loop in Vim, C and some scripting languages
just for a comparison:

vim   : 45 seconds
C     : 0  seconds
lua   : 02 seconds
python: 04 seconds
perl  : 04 seconds
ruby  : 05 seconds

1. http://www.thrysoee.dk/editline/
 
> Anton.

Regards,
Ag.



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to