Skip to content
TrySitePrice

Vim Open File And Go To Specific Function or Line Number

Best/Tutorial

In Vim, you can open a file and go to a specific function or line number by using the following command:

vim +

For example, if you want to open a file named "example.txt" and go to line number 50, the command would be:

vim +50 example.txt

If you want to go to a specific function, you can use the following command:

vim +/

For example, if you want to open a file named "example.txt" and go to the function named "main", the command would be:

vim +/main example.txt

Once you are in Vim, you can navigate the file and make changes as needed.