vim:打开水平和垂直拆分的 4 个文件 [英] vim: open 4 files split horizontally AND vertically

查看:27
本文介绍了vim:打开水平和垂直拆分的 4 个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在命令行,vim可以打开水平分割的4个文件,

On the command line, vim can open 4 files split horizontally,

vim -o file1 file2 file3 file4

或垂直拆分 4 个文件,

or 4 files split vertically,

vim -O file1 file2 file3 file4

如何打开 4 个文件,使它们水平和垂直拆分,就像这样?:

How do I open 4 files such that they are split both horizontally and vertically, like this?:

-----------
|    |    |
| 1  |  2 |
|    |    |
-----------
|    |    |
| 3  |  4 |
|    |    |
-----------

推荐答案

-o-O 不是那么优雅:

Not that elegant with -o or -O:

vim file4 -c 'split file2' -c 'vsplit file1' -c 'wincmd j' -c 'vsplit file3'

这篇关于vim:打开水平和垂直拆分的 4 个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆