sponsor Vim development Vim logo Vim Book Ad

readline.vim : Readline-style mappings for command-line mode

 script karma  Rating 13/4, Downloaded by 120  Comments, bugs, improvements  Vim wiki

created by
Elias Åström
 
script type
utility
 
description
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-line 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.

The word movement and deletion commands have different behavior 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 behavior for word movement and deletion commands.

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 with g:readline_ctrl_k)
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.  Meta mappings using modifiers can be explicitly enabled using g:readline_meta. 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 files to ~/.vim using the `unzip' command:

    $ unzip readline.zip -d ~/.vim

After doing that. Open Vim and run the `helptags' to generate tags for documentation:

    :helptags ~/.vim/doc

If using a plug-in manager, refer to its documentation.
 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
readline.zip 1.8 2018-06-18 7.0 Elias Åström Fix bugs were mappings would interact with wildmenu
readline.zip 1.7 2018-05-27 7.0 Elias Åström - Fix meta mappings on Nvim
- Add g:readline_meta to enable meta modifier mappings
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.1 2017-12-26 7.0 Elias Åström Fixed a few bugs in mappings
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.
   
OSDN.net Logo