delete word after or around cursor in VIM

前端 未结 16 632
一向
一向 2020-12-07 06:59

I\'m now switching to VIM from TextMate. I found ^+W in INSERT mode very useful. However, I\'d like to delete not only the word before cursor, but

16条回答
  •  死守一世寂寞
    2020-12-07 07:15

    I'd like to delete not only the word before cursor, but the word after or around cursor as well.

    In that case the solution proposed by OP (i.e. using ) can be combined with the accepted answer to give:

    inoremap  daw
    

    alternatively (shorter solution):

    inoremap  vawobd
    

    Sample input:

    word1 word2 word3 word4
                   ^------------- Cursor location
    

    Output:

    word1 word4
    

提交回复
热议问题