1. Open the vim directory in vim and you will see the following interface: In this interface, you can use the j, k key to move up and down, and then press enter to enter a directory, or open a file. You can see a bunch of commands above: [-] to the parent directory [D] delete a file (uppercase) [R] Change the file name (uppercase) [s] to the file Layout
1. Open the vim directory in vim and you will see the following interface: In this interface, you can use the j, k key to move up and down, and then press enter to enter a directory, or open a file. You can see a bunch of commands above: [-] to the parent directory [D] delete a file (uppercase) [R] Change the file name (uppercase) [s] to the file Layout
1. vim open the Directory
Vim directory,You will see the following interface:
In this interface,You can use the j and k keys to move up and down, and press enter to enter a directory or open a file.. You can see a bunch of commands above:
- [-] To the parent directory
- [D] delete an object in uppercase)
- [R] Change the file name (uppercase)
- [S] Sort files in lower case)
- [X] execution File
Of course, the opened file will overwrite the existing opened file-that is, you only see one file.
If you want to change the current browsing directory or view the current browsing directory, you can use the same command as shell:
: Cd
-Change the current directory
: Pwd-view the current directory
2. Buffer Zone
Actually, you use"VimDirectory"All opened files are not closed, and these files are in the buffer zone. You can use the following command to view the buffer:
: Ls
In Vim, you will see the following interface:
You can see that Vim has opened four files, numbered 4, 5, 6, and 7. If you want to switch the files to be opened, do not press Enter, if you press it, you will not be able to see it: the buffer list output by ls). You can use the following command to switch the file (4 after the buffer indicates that it is switched to file 4, that is, src/http/ngx_http.c):
: Buffer 4
Or:
: Buffer src/http/ngx_http.c
Note,
- You can complete Vim commands just like entering commands in Shell and pressing the Tab key to complete.
3. split-screen window browsing
I believe you already know how to split windows in the text "Vim window split screen. In fact, I do not use the command to split windows, but instead use the command to browse files to separate windows. For example:
Split up and down the current window and browse the directory below:
: He is all called: hsf-e (view the directory on the split screen below)
If you want to be on it, add one after: He !,
: He! (Browse the directory on the split screen)
If you want to split the Left and Right screens, you can:
: Ve is all called: vswitche (browse the directory between the split screens on the left, to the right is: Ve !)
It is made by using: He and: Ve to view three files at the same time:
The redirection and switching between split screens are mentioned in the text "Vim window split screen:Press Ctrl + W first, and then press the direction key: h j k l