pillarOfLight
pillarOfLight

Reputation: 8982

make vi start by inserting and then move cursor down

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?

Upvotes: 0

Views: 97

Answers (1)

Bernhard
Bernhard

Reputation: 3694

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

 vi +3 -c 'startinsert' ~/j_exec.php

Upvotes: 4

Related Questions