Skip to main content
Formatting
Source Link
Dhruva Sagar
  • 5.6k
  • 2
  • 23
  • 18

You already seem to be aware of the 'ap' text-object that represents a paragraph, similar to that there exist 2 text-objects to deal with sentences, 'is' & 'as' for inner sentence & a (or around) sentence. You should use these along with sentence motions '(', ')' for moving them around if need be.

eg.) For moving sentence two before sentence one. I would use the following key combinations in vim : `)das(P``)das(P

Explanation :

  • ): helps you move to the beginning of the second sentence.
  • das: deletes the sentence.
  • (: Moves back to the beginning of the first sentence (previous sentence to be precise)
  • P: Pastes the previously deleted sentence before the current one.

You already seem to be aware of the 'ap' text-object that represents a paragraph, similar to that there exist 2 text-objects to deal with sentences, 'is' & 'as' for inner sentence & a (or around) sentence. You should use these along with sentence motions '(', ')' for moving them around if need be.

eg.) For moving sentence two before sentence one. I would use the following key combinations in vim : `)das(P``

Explanation :

  • ): helps you move to the beginning of the second sentence.
  • das: deletes the sentence.
  • (: Moves back to the beginning of the first sentence (previous sentence to be precise)
  • P: Pastes the previously deleted sentence before the current one.

You already seem to be aware of the 'ap' text-object that represents a paragraph, similar to that there exist 2 text-objects to deal with sentences, 'is' & 'as' for inner sentence & a (or around) sentence. You should use these along with sentence motions '(', ')' for moving them around if need be.

eg.) For moving sentence two before sentence one. I would use the following key combinations in vim : )das(P

Explanation :

  • ): helps you move to the beginning of the second sentence.
  • das: deletes the sentence.
  • (: Moves back to the beginning of the first sentence (previous sentence to be precise)
  • P: Pastes the previously deleted sentence before the current one.
Source Link
Dhruva Sagar
  • 5.6k
  • 2
  • 23
  • 18

You already seem to be aware of the 'ap' text-object that represents a paragraph, similar to that there exist 2 text-objects to deal with sentences, 'is' & 'as' for inner sentence & a (or around) sentence. You should use these along with sentence motions '(', ')' for moving them around if need be.

eg.) For moving sentence two before sentence one. I would use the following key combinations in vim : `)das(P``

Explanation :

  • ): helps you move to the beginning of the second sentence.
  • das: deletes the sentence.
  • (: Moves back to the beginning of the first sentence (previous sentence to be precise)
  • P: Pastes the previously deleted sentence before the current one.