Question

so I run this command:

vi -c 'startinsert' ~/j_exec.php

which will startup vi and the moment vi opens it will enter insert mode immediately

Now j_exec.php will always contain <?php in the beginning so I want it so that it will ALSO move the cursor down so that the cursor will start 2 lines BENEATH the <?php line right after it executes 'startinsert'

how do I go about modifying this command to do so?

Was it helpful?

Solution

You can supply the line number to go to when starting vim, by adding +N, e.g.

 vi +3 -c 'startinsert' ~/j_exec.php
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top