No plug-in Vim programming skills

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.