4

I am new to ubuntu. I am using vim for quite sometime now. I came across autocmd BufNewFile command to automatically add some text when a file with some particular etension is created.I have attached the pic of how it looks after that command. But I want the cursor to be in a different position rather than line 9. DEFAULT I want the cursor to be on line 6.example of what OP wants

Seth
  • 59,332

2 Answers2

4

If you want to move to (for instance) line 10 in the file, you would type :10

You can put commands like this on the command line with vim +10

user10489
  • 5,533
0

So, let's say you are on line 9 and want to be on line 3.

You could push k 6 times. Or you could type 6 k or you could (as suggested in the other answer) type :3return or you could type 3g.

There's a number of other combinations that would work as well.

user10489
  • 5,533