如何打开顶部带有特定行号的vim? [英] How can I open vim with a particular line number at the top?
本文介绍了如何打开顶部带有特定行号的vim?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道可以使用以下语法在特定行号处打开vim文件:
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 open with the specified line at the top of the editor window, not in the middle.
推荐答案
您可以在打开文件后发出zt
,例如:vim +500 filename -c 'normal zt'
.
You could issue zt
after opening the file, so something like: vim +500 filename -c 'normal zt'
.
这篇关于如何打开顶部带有特定行号的vim?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文