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

Michael Chan
InstructorMichael Chan
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 4 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.

egghead
egghead

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today