sponsor Vim development Vim logo Vim Book Ad

readline.vim : Readline-style bindings for command mode

 script karma  Rating 9/3, Downloaded by 118    Comments, bugs, improvements  Vim wiki

created by
Elias Åström
script type
Readline is a library used for implementing line editing across many command-line tools (including `bash` and other shells and interpreters).  Readline ships with a default set of key-bindings that you are probably already familiar with.  The Readline default bindings is a mixture of traditional UNIX and EMACS bindings.

This plugins implements a subset of Readline's default keyboard commands to Vim's command-mode.  Mappings available include deletion and navigation by words and other useful stuff.

What makes this plugin different from similar plugins is that it implements a larger subset of the Readline mappings, and that it does a better job of mimicking the Readline behavior for each command.

Following is a summary of the mappings implemented by this plugin:

- C-b => Move backward
- C-f => Move forward
- M-b => Move one word backward
- M-f => Move one word forward
- C-a => Move to start of line
- C-e => Move to end of line
- C-d => Delete character
- M-Backspace => Rubout word
- M-d => Delete word
- C-w => Rubout space-delimited word
- C-u, C-x Backspace => Delete to start of line
- C-k => Deleted to end of line (can be disabled)
- C-y => Yank (paste) previously deleted text
- C-t => Transpose characters
- M-t => Transpose words
- M-u => Make word UPPERCASE
- M-l => Make word lowercase
- M-c => Make word Capitalized
- M-# => Comment out and execute the command-line
- M-=, M-? => List possible completions
- M-* => Insert possible completions
- C-x C-e => Open command-line window (like default Vim C-f)

The word boundaries for movement and deletion differ between Vim and Readline.  The biggest difference is that in Readline punctuation is always skipped when searching for a word boundary.  Another difference is that _ (underscore) is treated as a word delimiter.  This plugin implements the Readline behaivor for word movement and deletion commands.

This plugin does not use the Meta-key directly, because it causes conflicts with inserting accented characters on some keyboard layouts.  Instead Meta-key mappings can only be accessed by prefixing the keys with Esc.  Most terminal emulators can be configured to send keys prefixed with Esc when the Alt modifier is held.

Follow development at https://www.github.com/ryvnf/readline.vim.
install details
Extract the zip file into your ~/.vim directory (vimfiles on Windows):

<in unix shell>
$ unzip <zip-folder> ~/.vim/

Run helptags command so you can access help page using `:h readline`:

<in vim>
:helptags ~/.vim/doc

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
readline.zip 1.5 2018-04-16 7.0 Elias Åström Option to disable C-k mapping to preserve default digraph mapping
readline.zip 1.4 2018-03-20 7.0 Elias Åström Improved documentation
readline.zip 1.2 2017-12-27 7.0 Elias Åström Bugfix
readline.zip 1.1 2017-12-26 7.0 Elias Åström Fixed a few bugs in mappings
readline.zip 1.0 2017-12-26 7.0 Elias Åström Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo