> For the complete documentation index, see [llms.txt](https://notes.eliasnorrby.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.eliasnorrby.com/vim/open-files-in-splits.md).

# Opening a list of files in split windows

To open a list of files in split windows, we can use the `-o` and `-O` flags:

```bash
# Opens files in horizontal splits
vim -o file1 file2 file3

# The same, but with vertical splits
vim -O file1 file2 file3
```

Likewise, the `-n` flag can be used to open files in a tab each.

See `:help -o` for more information.
