In gvim editor how to split the editor window horizontally? so that includes two files and can see simultaneously ?
2 Answers
From command line:
open specified files as horizontal splits
gvim -o report.log power.log area.log
open specified files as vertical splits
gvim -O report.log power.log area.log
Within the editor
open file for editing in new horizontal split screen
:split filename
:sp filename
open file for editing in new vertical split screen
:vsplit filename
:vs filename
Check out :h windows.txt for more help
Ctrl+W, S (upper case) for horizontal splitting
-
it got splitted but i want two different files to be viewed in splitted windows.Sruthi Chowdavarapu– Sruthi Chowdavarapu2016-07-15 04:38:50 +00:00Commented Jul 15, 2016 at 4:38
-
you don't, its a shortcut key.HashTables– HashTables2016-07-15 04:43:06 +00:00Commented Jul 15, 2016 at 4:43
-
then to view two different files in the same window by splitting then what should i do?Sruthi Chowdavarapu– Sruthi Chowdavarapu2016-07-15 04:51:11 +00:00Commented Jul 15, 2016 at 4:51
-
superuser.com/a/486535/410599HashTables– HashTables2016-07-15 05:13:28 +00:00Commented Jul 15, 2016 at 5:13
-
1@SruthiChowdavarapu, you execute
:e anotherfilenamein one half of the split.maxschlepzig– maxschlepzig2016-07-15 06:38:00 +00:00Commented Jul 15, 2016 at 6:38