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)
-
diw
to delete inside a word; anddaw
to delete outside the word (to remove surrounding empty space). ↩ -
dit
to delete the text enclosed by a tag; anddat
to delete the starting and ending tags together with the text. ↩ -
di(
to delete the text inside the parentheses; andda(
to delete the text inside the parentheses including the parentheses themselves. Also works with opening and closing<
,[
and{
. ↩ -
di"
to delete the text inside quotation marks; andda"
to delete outside the quotation mark (to remove surrounding quotations marks as well). Also works with'
and`
. ↩ -
The difference between using
d
andc
in only that the latter after deleting the text switches to insert mode. ↩