2

How do I run vim with file.txt and screen center at line 100? Basically I would like to use zz mapping when starting Vim.

This does not work: vim -c "zz" file.txt +100

3

zz is a normal mode command, so use :normal:

vim "+normal zz" file.txt +100
vim -c "normal zz" file.txt +100
5

Another option would be to run multiple commands in one line

vim README.md +"56;norm zz"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.