Vi editor for learning linux

Source: Internet
Author: User
Run the "vifilename: open or create a file" command in the vi editor of linux, and place the cursor in the first line vi + nfilename: open the file, place the cursor at the beginning of line n vi + filename: open the file and place the cursor at the beginning of line n vi +/pattern... vi editor for learning linux
Run vi filename: open or create a file, place the cursor at the beginning of the first line vi + n filename: open the file, and place the cursor at the beginning of line n vi + filename: open the file, place the cursor at the beginning of the last line vi +/pattern filename: open the file, and place the cursor at the first string matching pattern vi-r filename: a system crash occurred when editing with vi last time. restore filename vi filename .... filename: open multiple files, edit and move the cursor commands in sequence h: Move the cursor to the left one character j: Move the cursor down one line k: Move the cursor up one line l: move the cursor one character to the right to insert a text command a: before the cursor I: After the cursor o: open a new line under the current line delete the command ndw: delete the n-1 characters (ndd) starting at and following the cursor: delete the current row and the n-1 row do: delete to the beginning of the Row d $: delete to the end of the row Ctrl + u: delete the text search command/patte entered in the input mode Rn: Search for pattern from the beginning of the cursor to the end of the file? Pattern: Search for pattern from the beginning of the cursor. command w: Save current file x: Save current file and exit q: Exit vi q! : Do not save the file and exit vi register operation nyy: save the content of the current row and its next n rows to the register? N is a number nyw: save the current row and its n characters to the register? N is a number nyl: save the current row and its next n characters to the register? N is a number p: Get register? And place it at the cursor position. Ndd: delete n lines of text from the current row and its bottom, and put the deleted content in the delete register No. 1.
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.