SilentDev
SilentDev

Reputation: 22777

how to split already opened gvim file

So I am using lubuntu and have gvim installed. Suppose I have two files in the current directory, file1.py and file2.py (both python files) and I want to open file1. So I do

gvim file1.py

and it opens, which is good. But now suppose I want to open file2.py by vertically (or horizontally) splitting the already open gvim window into two, how would I go about doing so from the terminal?

Also, how do I close only one file which is open splitscreen? So say I have file1.py and file2.py open in one window (vertically split) and I want to close file1.py?

Upvotes: 2

Views: 6106

Answers (2)

FDinoff
FDinoff

Reputation: 31459

Use the following to split horizontally.

:split file2.py

Use the following to split vertically.

:vsplit file2.py

To close the current window just use :q.


Take a look at :h windows.txt

Upvotes: 4

kikuchiyo
kikuchiyo

Reputation: 3421

:vsplit file2.py

Do the above to accomplish this.

Upvotes: 0

Related Questions