Is it possible to split Vim window to view multiple files at once?

  • When working with multiple files, it would be very handy if we can see more than one file in the screen at once. Is there any way in Vim to split the window (horizontally or vertically) so each split can show a different file?

  • Yes, vim has the ability to split both horizontally using :split and vertically using :vsplit which both work just like :edit for opening a file, except they open it in a horizontal / vertical split respectively.

    Additionally, I would recommend to also read :h window-move-cursor for moving around different splits with ease.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM