1 Overview
- operating
- vim edit multiple files simultaneously
- Promise
- ctrl
- When using the buttons ctrl + w, writing
^W
- When using the buttons ctrl + w, writing
- ctrl
- Thinking
- I remember this by two mechanisms
- ex command buffer
- Split Screen
- I remember this by two mechanisms
2. Scene
- file
- Failel
- file2
- file3
3. ex command buffer
- Outline
- vim can open multiple files at the same time
- Presented here is an operation performed by ex expression
1. Open
command
> vim file1 file2
- result
- Enter vim
- Edit file1
- problem
- file2 it?
- There are ways you can view the list of currently open files
- file2 it?
2. Check parameters
command
: args
result
# 显示在 vim 最底下 # [] 包裹的, 是 当前打开的文件 # 再按 enter 返回 [file1] file2
3. Review the list of files
command
:ls
result
# %a 表示当前的位置 :ls 1 %a "file1" 第 1 行 2 "file2" 第 0 行
- problem
- Can I switch it?
4. Switch
Command 1: previous / next
# 顺序为 args 和 ls 的文件列表 # 第一个文件无法使用 N # 最后一个文件, 无法使用 n # 其实还可以这样 ^6 :N/n
Command 2: Switch to the specified position
# <num> 为 ls 命令返回列表的 文件编号 :b <num>
- note
- Before switching, you need to save
- Feel a bit strange, but the encounter like this
- Before switching, you need to save
5. Open a new file
command
# <filename> 为文件名 :e <filename>
6. Quit
- Outline
- This command is not to say
7. Other
- ref
- Learning vi and vim editor
- problem
- You can only edit one file at the same time, this is not so easy to miss