Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

While in normal mode I can delete all the characters after the cursor by typing d$. I'd like to achieve the same but in insert mode in the same way that you can delete things to the left of the cursor with Ctrl + W

share|improve this question
add comment

1 Answer 1

up vote 9 down vote accepted

There are many ways:

  • esc, shift+C
  • ctrl+O, shift+D
  • shift+end, del
  • shift+end, s

Don't be afraid of falling back to the normal mode even for a short instant.

share|improve this answer
    
The first two worked perfectly, however, I had problems with the third one. Does S mean Shift? ; Shift-end <del> and Shift-end + s did not work? –  pedrosaurio Jul 13 '12 at 13:30
    
<C-o>D -- new to me. Awesome! –  kenny Jul 13 '12 at 15:13
    
Indeed, S stands for shift. I guess you are using plain vim under console. gvim has a better support of the keyboard that the one the default configuration of all consoles offers to vim. –  Luc Hermitte Jul 13 '12 at 15:14
    
@LucHermitte That last one doesn't work in vim or in gvim. It works in notepad. –  Izkata Jul 13 '12 at 15:36
1  
+1 Do not fear normal mode.. This is the essential feature of Vim in my opinion. –  Herman Torjussen Jul 16 '12 at 16:27
show 1 more comment

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.