20111105

Modo VI en la línea de comandos - VI mode on the command line

Desde los primeros días de mi primer trabajo en el que tuve que enfrentarme con la consola de equipos GNU/Linux me acostumbré, por consejo de un ex-jefe y amigo, a utilizarla en modo de comandos vi.
Para conseguir esto, basta con introducir lo siguiente:
set -o vi

A partir de ese momento, la consola funciona como el editor vi, así tienes un modo de inserción y un modo de ejecución de comandos. Desde este, por ejemplo, puedes realizar búsquedas en tu historial de comandos, como si buscases dentro de un documento de texto con vi.
Para volver al modo habitual, introduce lo siguiente:
set -o emacs

Por defecto los sistemas suelen venir en modo emacs, por lo que si como yo, prefieres el modo vi, puedes hacer que sea el predeterminado añadiendo la siguiente entrada al fichero /etc/inputrc:
set editting-mode vi

A disfrutarlo (o sufrirlo según el caso ;P)

Since first days I start working with GNU/Linux I got used to type and work with the vi mode enabled on the command line. To achieve this, just type the following:
set -o vi

Once you have change into the vi mode, the command line works as the vi editor, so it has the insert and the commands modes to work with. So if you, for instance, wants to search for a recently typed command, you can look for it on the same way you'll do on the vi editor.
To return to the previos configuration, just type:
set -o emacs

By default, the systems use to be configured on the emacs mode, but if you like the vi mode, you can do it the the default mode just adding to the /etc/inputrc the following line:
set editting-mode vi

Enjoy it (or suffer with it ;P)

PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.

No hay comentarios: