4 ms·
It's readline that has the vi mode set editing-mode vi in .inputrc will enable it everywhere.
by glymor 17y ago
It's readline that has the vi mode
set editing-mode vi
in .inputrc will enable it everywhere.
- james2vegas 17y agoluckily not everything on the command line uses readline, else there'd be way more gpl licensed command line tools. vi mode has been in nsh and pdksh, independent of gnu readline. It is also part of the specification for sh at opengroup.org: http://www.opengroup.org/onlinepubs/000095399/utilities/sh.html http://www.opengroup.org/onlinepubs/000095399/utilities/sh.h... Interesting note about emacs mode though: In early proposals, the KornShell-derived emacs mode of command line editing was included, even though the emacs editor itself was not. The community of emacs proponents was adamant that the full emacs editor not be standardized because they were concerned that an attempt to standardize this very powerful environment would encourage vendors to ship strictly conforming versions lacking the extensibility required by the community. The author of the original emacs program also expressed his desire to omit the program. Furthermore, there were a number of historical systems that did not include emacs, or included it without supporting it, but there were very few that did not include and support vi. The shell emacs command line editing mode was finally omitted because it became apparent that the KornShell version and the editor being distributed with the GNU system had diverged in some respects. The author of emacs requested that the POSIX emacs mode either be deleted or have a significant number of unspecified conditions. Although the KornShell author agreed to consider changes to bring the shell into alignment, the standard developers decided to defer specification at that time. At the time, it was assumed that convergence on an acceptable definition would occur for a subsequent draft, but that has not happened, and there appears to be no impetus to do so. In any case, implementations are free to offer additional command line editing modes based on the exact models of editors their users are most comfortable with.