惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
Y
Y Combinator Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
D
Docker
罗磊的独立博客
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
B
Blog
Vercel News
Vercel News
Recent Announcements
Recent Announcements
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
宝玉的分享
宝玉的分享

博客园 - JackieHan

ubuntu i3 xterm中文输入显示问题解决 ubuntu vim markdown 实时预览 ubuntu docker方式部署docker registry v2 docker 安装 gogs(go git server) 及问题解决 ubuntu14.04 server 安装docker Ubuntu Tomcat Ubuntu ssh 代理 全网访问速度优化 git 操作 vim使用指北 ---- Advanced Editing vim使用指北 ---- Global Replacement vi/vim使用指北 ---- Introducting the ex Editor ubuntu 点点滴滴 vi/vim使用指北 ---- Learning the vi and Vim Editors 读书 笔记 vi/vim使用指北 ---- Beyond the Basic vi/vim使用指北 ---- Moving Around in a Hurry vi/vim使用指北 ---- Sample Editing linux权威指南 简记 idea 使用
vim使用指北 ---- Multiple Windows in Vim
JackieHan · 2014-09-24 · via 博客园 - JackieHan

2014-09-24 01:34  JackieHan  阅读(339)  评论()    收藏  举报

多窗口打开多个文件

vim -o file1 file2 ... ---- 默认上下分割窗口

vim -0n file1 file2 ... ---- vim默认会上下等分n个窗口

分割窗口

:[v]split file ---- 以横向分割(带v)或纵向分割当前窗口打开文件(等比分割)

:[n][v]split/new [++opt] [+cmd] [file] ----  n:从顶部开始在新窗口中现实多少行,opt:vim选项,cmd:在新窗口中执行的命令,file:新窗口中现实的文件。例如:15split ++fileformat=unix otherfile

快速简单的分割窗口可以使用快捷键:Ctrl+w,s Ctrl+S

:sview filename  ---- 以只读模式打开一个新窗口来现实文件,纵向分割

:sfind [++option] {+cmd] filename ---- 查找文件名为filename的文件,在新窗口打开。如果没有找到则不分割窗口

在窗口中移动光标

Ctrl+w,h/j/k/l --- 上下左右切换当前窗口

Ctrl+w,Ctrl+w ---- 循环顺序皆幻当前窗口

移动窗口

Ctrl+w r ---- 窗口互换位置,不改变光标

Ctrl+w,x ---- 窗口互换位置,光标切换