f"
and f'
to move to the next double quote or single quote.
F"
and F'
to move to the previous double quote or single quote.
Used when you want to select or copy text including the quotes.
t"
and t'
to move to the last character before the next double quote or single quote.
T"
and T'
to move to the first character after the previous double quote or single quote.
Used when you want to select or copy text inside the quotes.
- Position cursor to the quote, ie:
"
- Press
yf"
to copy the text from the cursor until the next"
character - Press
p
somewhere else to paste the text
- Position cursor on the first character inside quote, let's use
'
this time - Press
yt'
to copy the text from the cursor until the last character before the'
- Press
p
somewhere elase to paste the text
You can repeat the selection process by just repeating the ;
key.
- First, do the fist motion/selection first, ex: select text within single quotes
- Position cursor at the first character inside
'
- Press
yt'
to copy text within the single quote - Press
p
somewhere to paste the text - Select another text to copy, but this time, just press
y;
- This will yank/copy text by repeating the previous selection motion, ie:
t'
- Then paste it again
- You can use
;
over and over again, saving keystrokes
Note: Only the t'
motion is repeated.