4

VIM多窗口操作技巧

 3 years ago
source link: https://www.maixj.net/ict/vim-duochuangkou-24300
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

VIM多窗口操作技巧

2021年1月3日 / 3次阅读VIM

VIM多窗口功能,使得我们可以在字符界面构造出一个看起来很专业的工作界面。本文总结VIM多窗口功能的操作技巧。

$ vim -o file1 file2 ...

打开多个文件,水平分割窗口。

$ vim -O file1 file2 ...

打开多个文件,垂直分割窗口。

打开一个水平分割的窗口。

打开一个垂直分割的窗口。

ctrl+ww

按照窗口打开顺序,移动光标。

ctrl+w+(h|j|k|l)

用hjkl控制移动光标到各方向的窗口。

:res[ize] [+|-]num

设置(增加或减少)当前窗口的行数。

:vertical res[ize] [+|-]num

设置(增加或减少)当前窗口的列数,貌似这是唯一能够调整窗口列数的操作。

ctrl+w+(+)

给当前窗口增加一行。

ctrl+w+(-)

给当前窗口减少一行。

ctrl+w+(=)

平分上下窗口的行数。

ctrl+w+(_)

让当前窗口的行数最大。

水平开启文件浏览窗口。

垂直开启文件浏览窗口。

:xa
:wqa

保存所有修改,退出关闭所有窗口。

不保存修改,退出关闭所有窗口。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK