readline vim commands

I've been using set -o vi for a while but didn't realize its full potential for a while.

Key Function Description
Ctrl-drl_vi_eof_maybeSignals EOF if line is empty, otherwise deletes char.
Ctrl-erl_emacs_editing_modeSwitch to Emacs editing mode.
Ctrl-grl_abortCancel current operation; beep.
Ctrl-hrl_backward_charMove cursor left one character.
Ctrl-jrl_newlineAccept line (like Enter).
Ctrl-krl_kill_lineDelete from cursor to end of line.
Ctrl-lrl_clear_screenClear and redraw the screen.
Ctrl-mrl_newlineAccept line.
Ctrl-nrl_get_next_historyNext line in history.
Ctrl-prl_get_previous_historyPrevious line in history.
Ctrl-qrl_quoted_insertInsert next typed character literally.
Ctrl-rrl_reverse_search_historySearch backward in history.
Ctrl-srl_forward_search_historySearch forward in history.
Ctrl-trl_transpose_charsSwap previous two characters.
Ctrl-url_unix_line_discardDelete everything before cursor.
Ctrl-vrl_quoted_insertInsert next key literally.
Ctrl-wrl_vi_unix_word_ruboutDelete previous word.
Ctrl-yrl_yankPaste last killed text.
Ctrl-_rl_vi_undoUndo last edit.
SPACErl_forward_charMove cursor right.
#rl_insert_commentInsert comment marker and accept line.
$rl_end_of_lineMove to end of line.
%rl_vi_matchJump to matching bracket.
&rl_vi_tilde_expandExpand ~ in filename contexts.
*rl_vi_completeVi-style completion.
+rl_get_next_historyNext history entry.
,rl_vi_char_searchRepeat last character search backward.
-rl_get_previous_historyPrevious history entry.
.rl_vi_redoRepeat last change.
/rl_vi_searchSearch forward.
0rl_beg_of_lineMove to beginning of line.
1–9rl_vi_arg_digitSet numeric argument prefix.
;rl_vi_char_searchRepeat last f/F/t/T search.
=rl_vi_completeComplete word.
?rl_vi_searchSearch backward.
Arl_vi_append_eolAppend at end of line.
Brl_vi_prev_wordMove backward by word.
Crl_vi_change_toChange text to end of motion.
Drl_vi_delete_toDelete text to motion.
Erl_vi_end_wordMove to end of word.
Frl_vi_char_searchFind character backward.
Grl_vi_fetch_historyGo to history line N.
Irl_vi_insert_begInsert at beginning of line.
Nrl_vi_search_againRepeat last search (same direction).
Prl_vi_putPaste text after cursor.
Rrl_vi_replaceEnter replace mode.
Srl_vi_substSubstitute entire line (delete + insert).
Trl_vi_char_searchSearch before character backward.
Url_revert_lineUndo all changes to line.
Wrl_vi_next_wordMove forward by word.
Xrl_vi_ruboutDelete previous character.
Yrl_vi_yank_toYank (copy) text to motion.
\rl_vi_completeComplete word.
^rl_vi_first_printMove to first non-whitespace character.
_rl_vi_yank_argInsert last argument from previous command.
`rl_vi_goto_markJump to mark.
arl_vi_append_modeAppend after cursor.
brl_vi_prev_wordBack one word.
crl_vi_change_toChange text until motion.
drl_vi_delete_toDelete until motion.
erl_vi_end_wordMove to end of current word.
frl_vi_char_searchFind character forward.
hrl_backward_charMove left.
irl_vi_insert_modeEnter insert mode.
jrl_get_next_historyMove down in history.
krl_get_previous_historyMove up in history.
lrl_forward_charMove right.
mrl_vi_set_markSet a mark.
nrl_vi_search_againRepeat search forward.
prl_vi_putPaste before cursor.
rrl_vi_change_charReplace a single character.
srl_vi_substSubstitute characters (delete + insert).
trl_vi_char_searchSearch until before character.
url_vi_undoUndo last edit.
wrl_vi_next_wordMove forward one word.
xrl_vi_deleteDelete character under cursor.
yrl_vi_yank_toYank text defined by motion.
|rl_vi_columnMove to specified column.
~rl_vi_change_caseToggle case of character.

Also if you like seeing the current mode don't forget to put set show-mode-in-prompt on into /etc/inputrc or ~/.inputrc

source commands for text

edit this page