Open Files into Vim from the Terminal as buffers, splits, and tabs

Michael Chan
InstructorMichael Chan

Share this video with your friends

Send Tweet
Published 3 years ago
Updated 2 years ago

You can open files into Vim directly from the terminal. This works for both single files and multiple files. In addition to reading these files into buffers, you can open them as splits or tabs. This video covers the basics of opening files from the terminal…

Michael Chan: [00:00] To open files in Vim right from the terminal, run Vim but with a space and a path to a file you'd like opened, then hit Enter. This can also be done with multiple files using more paths separated by spaces. By default, these files are inserted into Vim as buffers. These buffers can be listed using the buffers command or ls for short.

[00:29] If you prefer to see both files, they can be opened into splits using the -o flag. This shows both buffers as horizontal splits. Doing the same, but with -O reads both files into vertical splits. Finally, use the -p flag to read both files into tabs.