#7 vi-style editing mode

open
nobody
None
5
2002-12-29
2002-12-29
Matthew Gruenke
No

First, I should point out that libraries exist that
implement this functionality. If your license is
compatible with libreadline (GPL), you can easily get
not only vi-type support (configured via the user's
~/.inputrc), but also emacs & more.

If libreadline isn't an option, then I believe VIM (Vi
IMproved - vim.org) provides a library for integration
of their editor into other applications.

So, onto the meat of the request. I'd like to be able
to edit my text, in the main chat interface, using a
vi-like command mode. The bash shell serves as a good
example of what I want (since it uses libreadline). It
starts each command-line in insert mode. When I hit
escape (if I've configured my .inputrc to use vi mode),
I'm placed in something like vi command mode.

While some commands aren't supported, others map nicely
to such an application. For example, if I use '/' or
'?', which normally start a regexp-based search query
(forward or backward), it searches back or forth
through my command history, since what I'm editing is
fundamentally a single line.

Discussion

  • Pierre
    Pierre
    2004-06-01

    Logged In: YES
    user_id=512388

    What is the purpose of this ?

     
  • Logged In: YES
    user_id=343027

    The purpose would be to have a vi-style command mode for
    typing messages. If you use GNU's libreadline (or similar),
    you can get this functionality virtually for free.