Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 793 Bytes

open-files-side-by-side-with-vim.md

File metadata and controls

32 lines (27 loc) · 793 Bytes
aliases category classification date date_modified draft id image links local_archive_links pinned print series tags title type
open-files-side-by-side-with-vim
vim
public
2022-11-16 09:22:41 -0800
2022-11-16 09:22:41 -0800
false
20221116172241
false
false
vim
split
open
file
Open Files Side-By-Side with Vim
tech-note

I'll often want to open a couple of files in Vim and then split the main window so I have one file on the left, and one file on the right. I've just learnt that you can tell Vim to open each in it's own split, a vertical split or a horizontal split.

# Vertical split:
vim -O <file1> <file2>

# Horizontal split:
vim -o <file1> <file2>

It works with more than one file as well, so you could open three files, and have a pane for each.