Opening files side-by-side in vim
I had two text I wanted to view it’s differences and I was already in vim. So, I decided to open both files side-by-side. This is what I did:
- I created a new tab. In command mode, I typed
tabeand hit enter.
Tip: To switch to command mode, from normal mode, type:. - I opened the first file.
:e /tmp/1.
Note: The:denotes command mode. - I then opend the second file beside the first file:
:vsplit /tmp/2.

Further reading
Check the help page for split (:help split). While you’re there, type gO from normal mode to view the table of context. Perhaps something might catch your interest.
Thank you for flying arfs6.me :)