Skip to content

sa on this and the next n words? #1039

Closed Answered by pkazmier
proofer asked this question in Q&A
Discussion options

You must be logged in to vote

Sure, there are several ways you can do that with standard vim motions:

  1. Assuming your cursor is on the start of the first word, you can press sa4e", which will add a surrounding (sa) around the current position and the end of the next four words (4e) using quotation marks ("). If you are unsure of how many words, you could do veeeesa", which will give you visual feedback on the words you are going to place quotes around.
  2. If your cursor was not at the start of the first word, but in the middle, you could use the "around word" textobject, but you'll have to back off by one character, so you don't quote an empty space at the end. Because you need to adjust the selection, you'll want to use …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by proofer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants