Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 7 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.

while

 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
1  
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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.