3 ms·
My personal take is just you have to remember what you did last to choose between "a" and "i". If you do i123<Esc>iabc, you get "12abc3" rather then "123abc".
by tliltocatl 2y ago
My personal take is just you have to remember what you did last to choose between "a" and "i". If you do i123<Esc>iabc, you get "12abc3" rather then "123abc".
And then as the link says:
- <Esc> moves to the left [...] but if you do i_Ctrl-O or i_Ctrl-\_Ctrl-O [...] it moves to the right!!
- An empty line still allows normal mode to have a cursor, but since there are zero characters this cursor is kind of “fake”.
- cess11 2y agoNone of those are inconsistent. If a is confusing for you, use i, A and o, that'll be enough for most things you want. Most of the time you'll drop into insert mode through cw, cib and the like anyway. What do you mean by empty lines? Does your vim somehow have lines in the buffer that aren't in the file?
- tliltocatl 2y ago\n\n
- cess11 2y agoThat's two characters, i.e. not empty?
- teo_zero 2y agoI think the parent poster meant that two newlines in file are displayed as an empty line. That's ok. What's odd is that the cursor is allowed to stay in the empty line, as if it was on a virtual character at the end of the line. However, if the line is not empty, the cursor is not allowed to go one character right of the last one.
- teo_zero 2y agoThe point is that they teach you that 'i' enters insert mode and '<esc>' exits it. This is not true! It it was true and 'i' and '<esc>' only switched mode, then the sequence 'i<esc>' would have no effect. Instead 'i<esc>' leaves the cursor on another character.