3

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

Doorknob
  • 15,237
  • 3
  • 48
  • 70
name
  • 965
  • 2
  • 8
  • 8

2 Answers2

5

Another option would be to run multiple commands in one line

vim README.md +"56;norm zz"
A B
  • 387
  • 2
  • 9
4

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

vim "+normal zz" file.txt +100
vim -c "normal zz" file.txt +100
Doorknob
  • 15,237
  • 3
  • 48
  • 70
muru
  • 24,838
  • 8
  • 82
  • 143