What do f and t commands do in vim and exactly how they work?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your first stop with questions like these should be vim’s internal help,
:h fand:h t. However, in this case, those entries are a bit cryptic without an example. Suppose we had this line (^= cursor position):These commands find characters on a line. So
fbwould place the cursor here:tis likefbut places the cursor on the preceding character. Sotbwould give you:You can remember these commands as
find andtill. Also, you can prepend the commands with a number to move to the nth occurrence of that character. For example,3fbwould move to the third b to the right of the cursor. My example sentence only has one b though, so the cursor wouldn’t move at all.