Star (*) VIM Command

How to use Star (*) Command in Linux VIM editor?

Explanation


* command is used to find the next occurrence of searched string. After a string is searched the cursor will be focused on the first occurrence of the string, to move the cursor to the next occurrence we can use this command.

Usage:

* (star)

Example:

  • Open the file test.txt using the command
    $ vim test.txt
  • We can notice the following text in the file.
    Hiox India Vim Tutorial Hscripts
    India is seventh largest country in world
    I love India, I'm proud to be an Indian

  • Search of letter India is done using this command
    Enter /India
  • The cursor will point to the first occurrence of the string from the current position.
    Star Vim Command
  • To move the cursor to the next occurrence
    Press *
    Find Next Occurrence of Searched String Vim

Ask Questions

Ask Question