VIM - ex window switching command line

1 Overview

  1. operating
    1. vim edit multiple files simultaneously
  2. Promise
    1. ctrl
      1. When using the buttons ctrl + w, writing ^W
  3. Thinking
    1. I remember this by two mechanisms
      1. ex command buffer
      2. Split Screen

2. Scene

  1. file
    1. Failel
    2. file2
    3. file3

3. ex command buffer

  1. Outline
    1. vim can open multiple files at the same time
    2. Presented here is an operation performed by ex expression

1. Open

  1. command
    > vim file1 file2

  2. result
    1. Enter vim
    2. Edit file1
  3. problem
    1. file2 it?
      1. There are ways you can view the list of currently open files

2. Check parameters

  1. command

    : args
  2. result

    # 显示在 vim 最底下
    # [] 包裹的, 是 当前打开的文件
    # 再按 enter 返回
    [file1] file2

3. Review the list of files

  1. command

    :ls
  2. result

    # %a 表示当前的位置
    :ls
      1 %a   "file1"                        第 1 行
      2      "file2"                        第 0 行
    
  3. problem
    1. Can I switch it?

4. Switch

  1. Command 1: previous / next

    # 顺序为 args 和 ls 的文件列表
    # 第一个文件无法使用 N
    # 最后一个文件, 无法使用 n
    # 其实还可以这样 ^6
    :N/n
  2. Command 2: Switch to the specified position

    # <num> 为 ls 命令返回列表的 文件编号
    :b <num>
  3. note
    1. Before switching, you need to save
      1. Feel a bit strange, but the encounter like this

5. Open a new file

  1. command

    # <filename> 为文件名
    :e <filename>

6. Quit

  1. Outline
    1. This command is not to say

7. Other

  1. ref
    1. Learning vi and vim editor
  2. problem
    1. You can only edit one file at the same time, this is not so easy to miss

Guess you like

Origin www.cnblogs.com/xy14/p/11431862.html