We often use the vim editor when editing text in our daily work. Although vim is powerful and almost omnipotent, it is difficult to get started when we get used to word, in addition, it is not easy to remember frequently-used commands. I will write down the frequently-used command list for you to quickly query and use. You are welcome to supplement and perfect it
Common Vim commands and usage 1 switch insert mode: In command mode, insert the (lower case) cursor and then insert the (upper case) cursor at the end of the line to insert the I (lower case) insert I (uppercase) before the cursor start insert I (uppercase) insert o (lowercase) at the beginning of the row where the cursor is located Insert a new empty line insert O (uppercase) insert an empty row before the
Vi/vim Text EditorGeneral mode:DD: Delete cursor when moving forwardDND: Delete n rowsU: Undo Step Up actionYY: Copy when moving forwardP: Pastex: Delete a letterDW: Delete a wordYW: Copy a wordshift+^: Moving to the Wardrobeshift+$: Move to Row bitShift+g: Moving to the end of the leafN+shift+g: Move to Target row: W (Save): Q (Exit):! (Forced exit): S%/old character/new character (bulk substitution)/words to look for: Set nu/: Set Nonu display line
1 * Copyright (c) Level 2012, Yantai University School of Computer Science2 * All rights reserved.3 * Pay Record Super4 * Completion Date: May 15, 20155 * Version number: v1.06 * Learning topic: VIM Common commands7 * Working environment: Red Hat 5.88 * Benefits of Use:9 * Usage Time:10 * How to use:11 * Learning Content:Welcome to qq:2272172668 Email:[email Protected]650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/E0/wKioL1VVVGTzO2bhAAL
Tags: modify size direction basic command Save delete Vim return sectionOne, move the cursor # hjkl# 2w forward two words # 3e move forward to the end of the 3rd Word # 0 Move to the beginning of the line # $ The end of the current row # GG file The first line # G file last line # line number +g Specify line # VIM basic Commands
=utf-8" Sets the current file encoding format to Utf-8, or can be set to another encoding formatMulti-file editing"Vim file1 file2" Open two files at a time": N" edits the next file": N" Edit Previous file": Files" lists all files that are currently open with vimVim configuration fileThe configuration file for Vim is/ETC/VIMRC, but it is generally not recommended to modify this file directly, but to create
Command HistoryCommands with: and/begin with a history, you can first type: or/Then press the up and down arrows to select a history command.start VimEnter the following command in the Command line windowVim starts vim directlyVim filename opens vim and creates a file named filenamefile CommandsOpen a single fileVim fileOpen multiple files at the same timeVim file1 file2 file3 ...Open a new file in the
Use vim (1): Basic commands1. vim has three modes: Normal Mode, edit mode, and command line mode. 2. In normal mode, use vim to open a file and enter normal mode. In this mode, you can delete characters and lines and copy and paste file data. 2.1 move cursor h: cursor to the left one character j: cursor to the next character k: cursor up one character l: → to the
Vim basic commands
Leave ViZZ: WQ: X Archive before leaving: W archive name into his archive: Q quit (will prompt if the archive is changed): Q! Quit editing and leave: WQ! Force archiving and exit
Leave Vi temporarily:! Temporarily execute the Unix Command: Sh to generate a new shell, CTRL + d go back to the original editing location Ctrl + Z ?? Back to the previous shell and use the FG command to return t
command, you can also start VI with the-r option.: Recover Recover filesOption settingsTo control different editing functions, VI offers many internal options. Use the: Set command to set options. The basic syntax is:: Set option Settings optionsCommon feature options include the following:Autoindent Set this option, the body is automatically indentedignorecase Set this option, the difference between uppercase and lowercase letters in the rule expression is ignoredNumber sets this option to dis
cursorDdDelete the line where the cursor is located#ddRemove the # line from the number of lines that the cursor containsywCopy a word where the cursor is located#ywCopy the # Word where the cursor is locatedYyCopy a row where the cursor is located#yyCopy the # line from the number of lines where the cursor is locatedPPasteUCancel operationcwChange a word in the position of your cursor#cwChange the # Word where the cursor is located2, the following table lists some instructions in the line comm
Vim is a powerful text editor under the Linux system. Trust the program that is familiar with the Linux development environment apes and OPS are playing well.Here is a brief introduction of the commonly used command, I hope to help youMACROS macro
QA: Start looking for a registered macro record
Q Start at the end of the record
@aMultiple file multiple files editing
: E edits a file from the cache
: Bn enters next cache
: BD Delete File c
entering the above search command) search and replace the instruction :getxt1/s//text2/options to replace the Text1 of each line with text2option=g to indicate that all Text1 in the file are superseded, and if no option is entered, Then only the first occurrence of the Text1 in each row is substituted option=go on the screen display each substituted line NBSP;OPTION=GC ask for confirmation before each string supersedes start,endgtext1/s//Text2 /options, only to find and replace line start~end.
The most common command in the vim editor in linux should be the find/replace Command 1. search: \ Input:/query the string and press Enter. 2. replace: \ Input: % s/replace the previous string/replace the string/g and press Enter. note: The above replacement command can only replace case-insensitive, if you want to ignore case-insensitive matching after g
Under vim
Search command
Replacement Command
The mo
Under Linux to do development, or even only to do management and maintenance work, but also the use of vim. As a novice, I am also just in touch, this section of my daily use or collection of vim common commands recorded.Of course, you can learn all the commands of vim by ty
Common vim commands in linux★Command mode: www.2cto.com move the cursor h or move the cursor to the left direction key (Direction) → move the cursor to the left a character j or backward (direction) → move the cursor down to a character k or forward (forward) → move the cursor up to a character l or forward to the right (→) → move the cursor to the right with a character [Ctrl] + [f] → move one page down th
the previous command by pressing the period (.) In command mode.
Of course, in command mode, make sure that you press the "ESC" key twice in a row.
Other common Vim commands:
Gg = g format the entire file. If the format is not successful, you will lack the relevant configuration file =.DG deletes the row to the end of the fileD. Delete the cursor to the end of the row.Indent command: V enters the virtual s
Learn how to delete the word remaining after deleting the dw character under the current cursor. D $ delete the remaining parts of the row after the cursor. Dd deletes the current row. Ndd deletes the current n rows. For example, 5dd is used to delete the delete commands under five lines of c vim. learn x: delete the character dw under the current cursor. delete the remaining part of the word after the curs
Cat commandImplement merging of several files, and add one or several files to another file.Tar commandPackage a file or directory into a file-C Create a new tar file-t lists the directory names in the tar file-V displays detailed file or directory information for packaged files-X extracting a file from a tar file-F archive file or device, usually write-Z uses the GZIP algorithm to compress packaged files-j using the bZIP algorithm to compress packaged files-C back to the location of the extract
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.