sponsor Vim development Vim logo Vim Book Ad

emacscommandline : makes command-line mode behave more like the Unix command line

 script karma  Rating 17/7, Downloaded by 381    Comments, bugs, improvements  Vim wiki

created by
Houtsnip -
 
script type
utility
 
description
This plugin makes the command-line mode behave more like the Unix command
line, by adding Emacs-style mappings (like in the Bash shell).  Some of the
mappings just map existing vim commands, but the rest implement functionality
that is not available natively.

Repository: https://github.com/houtsnip/vim-emacscommandline

MOVEMENT

CTRL-A         move cursor to beginning of line
CTRL-E         move cursor to end of line (i.e the native vim behaviour:
                 see c_CTRL-E).  Not actually a re-mapping, but noted here
                 anyway for completeness.
CTRL-B         move cursor one character backwards
CTRL-F         move cursor one character forwards (overwrites c_CTRL-F)
META-B         move cursor one word backwards
META-F         move cursor one word forwards

DELETION

CTRL-D         delete character under cursor
CTRL-K         kill line (delete from character under cursor to end of line)
                 (overwrites insert digraph: see c_CTRL-K.  This is a shame,
                 but personally I don't use this much in command-line mode.)
CTRL-U         backwards kill line (delete backwards to beginning of line)
                 (i.e. the same behaviour as in Bash: unix-line-discard)
META-D         delete word under cursor
META-Backspace delete word backwards
CTRL-W         delete backwards to previous white-space character
                 (i.e. the same behaviour as in Bash: unix-word-rubout)

HISTORY

CTRL-P         previous line in history (same as <Up>)
CTRL-N         next line in history (same as <Down>)
META-R         search history backwards
                 (It would be nice to use the mapping CTRL-R, but this is
                 already used for insert register: see c_CTRL-R.)

OTHER

CTRL-Y         paste (yank) last deleted text (overwrites c_CTRL-Y).
                 Note that in Emacs, 'yank' means 'paste', whereas in vim it
                 means 'copy'.  The same text is also available in the
                 registry 'c'.
CTRL-_         undo last change (overwrites c_CTRL-_)
CTRL-X_CTRL-U   "    "    "
CTRL-Z         toggle command-line as external command (overwrites suspend
                 vim in the terminal)

OLD KEYS

The old functions are all mapped to the same combination prefixed by CTRL-O.
So for example, to open the command-line window (see c_CTRL-F), press
instead CTRL-O_CTRL-F.

WARNING

This plugin buggers up the expression register (i.e. c_CTRL-R_=).  This is
a limitation of vim.  I don't know how to switch these mappings off in the
expression register and I don't think it's possible. However I never use the
expression register except in mappings, so it doesn't affect me.

 
install details
 

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
emacscommandline.tar.gz 1.1 2011-06-06 7.0 Houtsnip - Fixed <Backspace> and <Del> for multi-byte characters
emacscommandline.tar.gz 1.0 2011-04-18 7.0 Houtsnip - Initial upload
ip used for rating: 54.87.130.240

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