I was an emacs
user, and I have to switch to vim
. But I miss some basic emacs commands in vim
insert mode:
C-A
C-E
C-K
C-Y
C-x C-s
- … and some other
I know that I can press Escape
and then press some of the following keys and finally press key i
:
^
$
d$
p
:w
[Enter]- …
However I will like to stay in vim
insert mode and avoid pressing Escape
/i
keys.
On the web, I have found customizations for emacs
(vi-mode
, vip
, viper
, vimpulse
, vim-mode
, evil
). But not yet found the opposite: customize vim
to use emacs
commands…
I am interested about the emacs
commands in vim
insert mode only. Just some basic commands, as bash
commands: C-A
, C-E
, C-K
, C-Y
, C-U
… (yep C-U
is not a default emacs
command but I like it too).
Best Answer
I am responding to this question four years later because the answer provided is a partial solution that does not completely address the original question.
I have the exact same desire as olibre, and wanted to come up with a complete solution. I come at it from a different perspective -- I'm used to Emacs line editing in bash -- but the issue is the same. I want to carry that over into Vim insert mode (only).
The following addresses all of the keybinding requests in the original question posed by olibre, plus few extras:
The only bindings I cannot seem to get to work at this point areI have gotten Alt combinations to work based on another post's suggestion to just use the special characters. I have inserted them above.<Alt-B>
and<Alt-F>
, which would skip entire words. Whenever I bind<Esc>
,<Alt>
, or<Meta>
combinations, gVim (v7.4 on Windows) outputs accented characters. Please feel free to edit this answer if you have a solution to this issue.Edit
-- (edit is not by original answer poster) --
I used the following under Neovim and Windows 10. You might need to change the "A" into "M" on other OSs as "alt" might be "meta" elsewhere. I haven't played with it enough.