Vi/vim operation

Source: Internet
Author: User

Vi/vim is a text editor under the Unix/linux operating system.
Due to the nature of unix/linux files, Vi/vim can edit any file in any format.
The following are common knowledge points, for informational purposes only:

  1. Editing mode: Vi/vim + file path. Where the file path can be either an absolute path or a relative path. If this file does not exist, a new file will be created.
  2. There are two types of patterns commonly used in Vi/vim: command-line mode and input mode.
  3. commands to switch from command-line mode to input mode:
    New (Append)
    A: From the cursor position to start the new data, the data after the cursor with the new data to move forward.
    A: Start adding data from the end of the column where the cursor is located.
    Inserting (insert)
    I: Insert data from the cursor position, and the data after the cursor moves with the new data.
    I: Insert data from the first non-whitespace character in the column where the cursor is located.
    Start (Open)
    O: Add a new column under the Cursor column and enter the input mode.
    O: Add a column above the cursor column and enter the input mode.
    In instruction mode type: Q,:Q!,:WQ or: X (note: number), you will exit VI. of which: Wq and: X is to save the exit, and: Q is to exit directly, if the file has a new change, vi will prompt you to save the file and: Q command will also be invalid, then you can use: w command saved the file and then use: Q Exit, or with: Wq or: X command exit, if you do not want to save the changed file, you need command, this command will exit VI without saving the file.
    Common Operations (Command-line mode):
    Ctrl+f: Turn down one page
    Ctrl+b: one page Up
    /+ Word: Find
    DD: Delete a row

Vi/vim operation

Related Article

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.