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

2 Answers 2


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

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

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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