1、2, the basic operation of VIA) enter VIAfter the system prompt symbol enters VI and file name, enter the VI full screen edit screen:$VI myfileBut one thing to pay special attention to is that after you enter VI, you are in the mode (command), and you have to switch to Insert mode to enter the text.
2、The first use of VI people will want to use the arrow keys to move the cursor, the computer has been called bleep, his mad, so after entering the VI, the first not to move into insert mode (Insert mode)!B) switch to insert mode (Insert mode) to edit the fileUnder the command line mode (command mode)
3、, press the letter I to enter Insert mode, then you can start typing.C) Insert switchingYou are currently in the mode, and you can only enter the text all the time, if you find the wrong word! If you want to move back with the cursor keys, delete the word first, press the ESC key, go to command line
4、 mode (command mode), and then delete the text.D) quit VI and save the fileIn the command line mode (command mode), click : the colon key enters Last line mode, for example: W filename (enter W filename) save the article as the specified file name filename.) WQ (enter WQ, save and exit VI) q! (enter
5、 Q, do not save, force VI)3, command line mode (command mode) function keys1) insert modePress to switch to insert mode insert mode, press to enter the insert mode, then start the file from the current position of the cursor;When you press a to enter the insert mode, enter the text from the next pos
6、ition in the current cursor;According to the O into the insert mode, is to insert a new line, starting from the input text.2) switch from insert mode to command line modePress the ESC key.3) move cursorVI can move directly up and down with the cursor on the keyboard, but the regular VI uses lowercas
7、e English letters H, JKL, respectively, to control the cursor, left, bottom, top and right.Ctrl + B move the screen to the back.F move the screen to the front.U the screen moves back half.d move the screen to the front half pagePress the number 0 move to the beginning of the article.G move to the en
8、d of the article.$ move to cursor at the end of the line the move to cursor W the cursor jumps to the beginning of the next worde the cursor to jump to the next word suffixPress B to return the cursor to the beginning of the word#l the cursor to the line of the # position, such as: 5L, 56l.4) delete
9、 textX each time the cursor is deleted, a character is removed from the cursors location.#x for example, 6x means the 6 characters of the back of the cursor where the cursor is deleted. uppercase X, and each time the cursor is deleted, a character in front of the cursor is deleted.#X20X means the 20
10、 characters in front of the cursor where the cursor is deleted.DD deletes the cursors line.#dd delete rows from the cursor to #5) copyYW the cursor to where the suffix characters are copied to the buffer.#yw copy # words to the bufferYY copy the cursor line to the buffer.#yy6yy means copying 6 lines of text from the line in which the cursor is located.P put the characters in the buffer to the cursors location. Note: all replication commands associated with Y must work with to complete cop
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1