By accident I just discovered an awesome feature of Vim – by typing das in normal mode it Deletes Around the current Sentence.

I knew about Deleting (and Changing5) Around (and Inside) Words1, Tags2, parentheses3 of many kinds, quotation marks4 … but that just blew my mind today! ☺

hook out → looking forward to eating frog legs tomorrow (technically today)


  1. diw to delete inside a word; and daw to delete outside the word (to remove surrounding empty space). 

  2. dit to delete the text enclosed by a tag; and dat to delete the starting and ending tags together with the text. 

  3. di( to delete the text inside the parentheses; and da( to delete the text inside the parentheses including the parentheses themselves. Also works with opening and closing <, [ and {

  4. di" to delete the text inside quotation marks; and da" to delete outside the quotation mark (to remove surrounding quotations marks as well). Also works with ' and 96

  5. The difference between using d and c in only that the latter after deleting the text switches to insert mode. 


Related Posts


Published

Category

Tehne

Tags