Vim User Manual 阅读笔记 usr_08.txt Splitting windows 窗口分割

|08.1| Split a window

:split

CTRL-W w 或者 CTRL-W CTRL-W 切换窗口

CLOSE THE WINDOW 关闭某窗口

To close a window, 不会误关最后一个窗口,相对于":quit 或者 :zz"

:close

关闭其他窗口,只保留当前

:only

|08.2| Split a window on another file

分割并新开一个文件

:split 文件名

新开一个空文件

:new

|08.3| Window size

新切分窗口并设定高度

:3split 文件名

调整窗体高度(大小 )CTRL-W + / CTRL-W -

前置数字,就是调整多少size

{height}CTRL-W _ 将窗口高度调整到hight

|08.4| Vertical splits 纵向分割

:vsplit

:vertical new :vne

移动 分割的窗口

|----------|---------------------------------|
| CTRL-W h | move to the window on the left |
| CTRL-W j | move to the window below |
| CTRL-W k | move to the window above |
| CTRL-W l | move to the window on the right |

CTRL-W t move to the TOP window

CTRL-W b move to the BOTTOM window

更多搜索 Q_wi

|08.5| Moving windows

|-------------|------------------------------|
| CTRL-W K 大写 | 将分割窗口移动到最上端 |
| CTRL-W H 大写 | move window to the far left |
| CTRL-W J 大写 | move window to the bottom |
| CTRL-W L 大写 | move window to the far right |

|08.6| Commands for all windows

|--------|------------------|
| :qall | 退出所有窗口,如有改动,可确认! |
| :wall | 保存所有窗口 |
| :wqall | 保存所有并退出 |
| :qall! | 强退所有窗口 |

|08.7| Viewing differences with vimdiff 使用vimdiff查看差异

OPENING A WINDOW FOR ALL ARGUMENTS 以横向分割窗口打开多个文件,-o 参数

To make Vim open a window for each file, start it with the "-o" argument: >

vim -o one.txt two.txt three.txt

Vimdiff file1 file2 在 windows下好像不能用

THE FOLD COLUMN

Zc / zo 关/开 折叠部分,或者点击 + / -

DIFFING IN VIM

在VIM内部进行diff

:edit main.c

:vertical diffsplit main.c~

The ":vertical" command is used to make the window split vertically. If you omit this, you will get a horizontal split.

缺省为horizontal ,指定vertical 即可

Patch mode 暂时不会

If you have a patch or diff file, you can use the third way to start diff mode. First edit the file to which the patch applies. Then tell Vim the name of the patch file: >

:edit main.c

:vertical diffpatch main.c.diff

SCROLL BINDING 滚动绑定

:set noscrollbind / :set scrollbind

JUMPING TO CHANGES 跳转到变化的地方

]c / [c

REMOVING CHANGES

highlighting updated in all situations 更新变化对比

:diffupate

|----|-------------|--------------------|
| Dp | Diff put | 把当前差异除的文字复制到另一个窗口 |
| Do | Diff obtain | 把另一个窗口的差异文字复制到当前窗口 |
| dg | | |

|08.8| Various

For Normal mode commands a CTRL-W is prepended. CTRL-^ jumps to the alternate file, CTRL-W CTRL-^ splits the window and edits the alternate file.

指示在什么位置新开窗口

When splitting a window you can prepend a modifier command to tell where the

window is to appear:

:leftabove {cmd} left or above the current window

:aboveleft {cmd} idem

:rightbelow {cmd} right or below the current window

:belowright {cmd} idem

:topleft {cmd} at the top or left of the Vim window

:botright {cmd} at the bottom or right of the Vim window

|08.9| Tab pages

新开一个tab,编辑另一个文件

:tabedit <thatfile>

tabedit中间没有空格

新开一个tab,编辑同一个文件

:tab split

切换tab

gt

新开一个tab,打开内容

:tab help gt

相关推荐
wdfk_prog4 小时前
[Linux]学习笔记系列 -- [drivers][I2C]I2C
linux·笔记·学习
觉醒大王5 小时前
哪些文章会被我拒稿?
论文阅读·笔记·深度学习·考研·自然语言处理·html·学习方法
方安乐5 小时前
科普:股票 vs 债券的区别
笔记
徐小夕@趣谈前端6 小时前
拒绝重复造轮子?我们偏偏花365天,用Vue3写了款AI协同的Word编辑器
人工智能·编辑器·word
风一样的航哥6 小时前
标题:从卡顿到流畅:深度剖析 Word 2013 与 Word 2021 处理高清图片文档的性能鸿沟
编辑器
傻小胖7 小时前
22.ETH-智能合约-北大肖臻老师客堂笔记
笔记·区块链·智能合约
浅念-7 小时前
C++入门(2)
开发语言·c++·经验分享·笔记·学习
张人玉8 小时前
VisionPro 定位与卡尺测量学习笔记
笔记·学习·计算机视觉·vsionprp
songyuc8 小时前
【BiFormer】BiFormer: Vision Transformer with Bi-Level Routing Attention 译读笔记
笔记·transformer
觉醒大王9 小时前
强女思维:着急,是贪欲外显的相。
java·论文阅读·笔记·深度学习·学习·自然语言处理·学习方法