[Practical.vim (2012.9)]. DREW.NEIL.TIP49 Study Summary

Source: Internet
Author: User

Find by Character

The command to quickly navigate to a character in Vim is f

The The FX command does nothing. Vim searches forward for a occurrence of the "X" character, but no matches is found, so the cursor doesn ' t move. The FO command finds an occurrence of the ' o ' character, so the cursor was positioned on top of the first match.
fxThe command does not move the cursor because there is no x character in the paragraph, so the cursor does not move. The fo command found the character o, so the cursor moves to the first character o .

After using the f command, ; You can move the cursor to the next matching character, as follows

In addition, we can also use F t t T , the command to move the cursor to a specific character as follows:

FIn contrast to the query direction, move to the front of the f t next matching character and move to the back of the T previous match character, in contrast to the direction of the move.

These move commands can be used in conjunction with the Delete command d to quickly delete a specific range of characters, as follows:

First the command navigates to the f, location , , and then removes , all characters from the end except the period, so the command is t. positioned before the character . . drepresents the deletion.

In general, I tend to use and in f{char} F{char} Normal mode when I want to move the cursor quickly within the current line, W Hereas I tend to use the t{char} and T{char} character search commands on combination with d{motion} or c{motion} .
When you move quickly, you usually use f{char} commands or F{char} commands to change the text content t{char} T{char} .

[Practical.vim (2012.9)]. DREW.NEIL.TIP49 Study Summary

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.