Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using vim in the cygwin terminal right now.

I am looking for a way to go behind the last character of a line to append words. When I use $i all I type is inserted before the last character.

share|improve this question
up vote 14 down vote accepted

just press A:

 A   Append text at the end of the line [count] times.

(from :help A)

your initial try is not working because you go to EOL with $, but then you use i instead of a:

 i   Insert text before the cursor [count] times.
     When using CTRL-O in Insert mode |i_CTRL-O| the count
     is not supported.


 a   Append text after the cursor [count] times.  If the
     cursor is in the first column of an empty line Insert
     starts there.  But not when 'virtualedit' is set!

but as i said: the real solution is A.

share|improve this answer

Create a .vimrc file in your home directory. An empty one will do. This will get vim out of its default vi compatibility mode. This will allow you to move the cursor to the end of the line using End or the arrow keys when in insert mode.

share|improve this answer
This doesn't address the question at all. – Daenyth Jul 28 '10 at 22:08
Edited to explain how getting out of compatibility mode can help. – ak2 Jul 29 '10 at 4:52
Good to know, thank you! – mit Jul 29 '10 at 15:10
Actually this is what I really wanted. I was not aware that on all my other (non cygwin) installations the .vimrc file already existed. This explains the unused behaviouor of vim on cygwin. – mit Jul 29 '10 at 15:11
Or they disable vi compatibility mode in vim's global config. – ak2 Jul 31 '10 at 14:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .