How can I open vim with a particular line number at the top?

后端 未结 3 1175
难免孤独
难免孤独 2020-12-23 19:13

I know it is possible to have vim open a file at particular line number using this syntax:

vim +500 filename

However, I would like it to op

3条回答
  •  悲&欢浪女
    2020-12-23 19:56

    This should do it:

    vim +'500|norm! zt' filename
    

    Or you could just start the habit of using zt (top), zz (center), and zb (bottom); In my case, it is so automatic, I wouldn't really require the extra invocation argument

提交回复
热议问题