1

In vim, you can open a file with the cursor in particular line

Example: open file.txt with the cursor over the line 10

vim file.txt +10

With -O you can open the same file with vertical split

vim -O file.txt file.txt

How can I open the same file with a vertical split and with the cursor over specific lines?

something like

vim -O file.txt +10 file.txt +20
1

Please use following command vim +20 file.txt +"vsplit +10 file.txt"

Switch window with CTRL+w l (CTRL+w h)

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.