From help :help i_ctrl-a:CTRL-A      Insert previously inserted text.  {not in Vi}Let's say I have an empty buffer and I'm in normal mode.I type i to go in insert mode.I type (), then move the cursor one character to the left by hitting <C-h> (which I mapped to <left> in insert mode), type foo,  and go back in normal mode by hitting escape.  The buffer contains: (foo)I thought, wrongly, that the previously inserted text would be (foo) but it's not.The previously inserted text is only foo which can be checked by typing :registers . or hitting <C-a> in insert mode again.Why does hitting an arrow key reset the previously inserted text ?Is there a way to make the dot register store all the text that was inserted the last time I went in insert mode even though I hit an arrow key ?
Why is the previously inserted text reset after using an arrow key?
key bindings;cursor movement;register
In insert mode, the left arrow key actually exits insert mode, moves the cursor, then re-enters insert mode. That breaks your change into two changes: inserting () and inserting foo. This behavior is discussed under:help ins-special-specialThe solution is to remap the left arrow key to include CTRL-G U. The example in the Vim Reference Manual is hard to find because it's not directly tagged. First go to:help i_CTRL-G_Uthen scroll down 42 lines to An example for using CTRL-G U: For the left arrow key, use this mapping:inoremap <Left> <C-G>U<Left>It seems to work, but the display of the . register by the :registers command looks weird after executing your (foo) example. On my Windows machine, it looks like this:.  ()^GU<80>klfoo