summaryrefslogtreecommitdiff
path: root/devdocs/bash/readline-vi-mode.html
blob: 86455f138b665bfa0d868cd85b50dbd9ae2c793a (plain)
1
2
3
4
5
6
<h1 class="section">Readline vi Mode</h1> <p>While the Readline library does not have a full set of <code>vi</code> editing functions, it does contain enough to allow simple editing of the line. The Readline <code>vi</code> mode behaves as specified in the <small>POSIX</small> standard. </p> <p>In order to switch interactively between <code>emacs</code> and <code>vi</code> editing modes, use the ‘<samp>set -o emacs</samp>’ and ‘<samp>set -o vi</samp>’ commands (see <a href="the-set-builtin">The Set Builtin</a>). The Readline default is <code>emacs</code> mode. </p> <p>When you enter a line in <code>vi</code> mode, you are already placed in ‘insertion’ mode, as if you had typed an ‘<samp>i</samp>’. Pressing <code>ESC</code> switches you into ‘command’ mode, where you can edit the text of the line with the standard <code>vi</code> movement keys, move to previous history lines with ‘<samp>k</samp>’ and subsequent lines with ‘<samp>j</samp>’, and so forth. </p><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>Licensed under the GNU Free Documentation License.<br>
    <a href="https://www.gnu.org/software/bash/manual/html_node/Readline-vi-Mode.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/Readline-vi-Mode.html</a>
  </p>
</div>