Alibabacloud.com offers a wide variety of articles about difference between vi and vim, easily find your difference between vi and vim information here online.
CentOS6.4 text editor Vi/VimVim/Vi Introduction Vim/Vi is a powerful full-screen text editor, the most common text editor on Linux/UNIX. It is used to create, edit, and display text files.Vim/Vi has no menu and only commands.INSERT commandLocating commandDELETE commandCopy a
Learn vi and vim editors (3): simple text editing (2)
In the previous article, I will continue to explain some simple text editing commands in the vi editor. This article mainly involves commands such as text deletion, copying, and moving.
Delete text:
As mentioned in the previous article, the DELETE command ("d") also has the form of "(command) (TextObject, comm
Vi/vim:Edit Mode Set line number: Set Nu:set NonuLine number move: GG G ng/:nMobile: H, J, K, L 0 $ H, M, LSearch:/"Characters searched" n Next n ignored case: Set ICCopy yy/y Nyy/nyCut dd ndd Paste p/pReplace:R R + ESCFull-text replacement of the specified string:%s/old/new/g:%s/old/new/cN1 to N2 line range replace specified string: n1,n2s/old/new/g: n1,n2s/old/new/cDelete: x NX dd NDD DG d:n1,n2dUndo USave exit:: wq! Only root and file owners can ha
Reprint Source: http://blog.csdn.net/xiajun07061225/article/details/7039413First, why should we learn the VIM editor?There are a lot of text editors under the command line interface of Linux. For example, there are Emacs, Pico, Nano, Joe and VIM, etc. that are often heard. Vim can be seen as a premium version of VI. Wh
Common vi/vim commands
Vi/vim commands are complex and powerful. Here we will introduce some commonly used commands that can meet general needs.
Move the cursor:-Shift left: h-Move Down: j-Move up: k-Shift right: l-Flip: ctrl f, ctrl B
Insert:-Insert at the cursor position: I-Insert at the end of A row:-Insert a new
substitution is directly the command line mode, does not need to press the ESC key from the input mode to return to the command mode.The R command can also be substituted for characters relative to the "R" command, but the "R" key can only replace one character at a time, and when the R key is pressed, it goes into overwrite mode. That is, the characters you type will overwrite the original characters one at a-until the ESC key is pressed. However, the R command can only cover a full line at mo
In VI/vim, you can use the: s command to replace the string.
: S/Vivian/sky/Replace the first Vivian in the current row with sky
: S/Vivian/sky/g replace all Vivian in the current row with sky
: N, $ S/Vivian/sky/Replace the first Vivian from row n to row N as sky
: 2, $ S/Vivian/sky/g to replace 2nd rows. from the beginning to the last row, all Vivian values are sky.
N is a number. If n is., it i
deletes a specified range of rowsyy, Y Copy as ForwardNyy, NY Copy the current row under N rowsDD Cut when moving forwardNDD cuts n rows under the current rowP, p pasted under the current cursor row or lineReplace, Search commandCommand functionR replaces the character at which the cursor is locatedR replaces the character at the beginning of the cursor and presses ESC to endU Cancel the previous actionCommand function/string searches forward for the specified string, and the search is case-ins
1. The relationship between VI and VIM:Vim can be understood as the upgrade version of VI, support shell script programming;VI existence reason: All Unix like systems are built into the VI editor, while the individual tools will actively call VI, such as crontab.2. About the
Vim/vi features a powerful full-screen text editor. The main is to build, edit, display text. www.vim.org Building shell Scripts : Set number causes the file to appear with line numbers A after the cursor attachment file I insert text before the cursor o back to the cursor insert a new line A at the end of the bank attachment file I at the beginning of inserting text o insert a new line on the cursor Comma
Vi/vimVi/vim commands for editing textCommand: VI test.txt, when test.txt does not exist, automatically create this file, execute VI test.txtThe red arrow marks the file name, indicating that it is now in command mode, and when VI is a file, most of the start is in command m
contains the pattern between line 60th and line 124th.
Merge ex command:To enter a new ex command, you do not need to enter a colon every time, you can use the vertical bar (|) to separate the commands, and then merge multiple commands at the same ex prompt.Save and leave the file:
: W writes the contents of the buffer to the file, but does not leave. ": w" should be used frequently when editing files;
: Q Leave the editor;
: Wq writes the file while leaving the editor, w
vim often encounter the phenomenon of abnormal Chinese display, which is the legendary garbled. A search, found a solution in http://www.chinalinuxpub.com/bbs/showthread.php?t=45475. But the GBK code is normal, and the UTF8 is wrong. So a little bit changed. Create a. vimrc file in the user directory join set fileencodings=utf-8,gb2312,gbk,gb18030 set Termencoding=utf-8 set Fileformats=unix set encoding= The PRC fileencodings utf-8 to be in front. Th
/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s2.51cto.com/wyfs02/m00/86/2a/wkiol1e2p37sa_xxaaakvnn97ak675.jpg "title=" 5.jpg "alt=" wKioL1e2p37SA_ Xxaaakvnn97ak675.jpg "/>If you want to delete more than one character, you need to first select the row you want to manipulate, and then press the RIGHT ARROW key to select multiple characters650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Backgr
Recovery is simple in vim, but it's hard to recover to a specific time period.In my experience, sometimes using recovery is better than deleting the rewriteHere we talk about the use of restore, Undo, and repeat commandsu undo Last Command U redo full line ctrl+r redo. Repeat E! Full-text recoveryIf you have experience using Office, then the undo and redo should be well understoodFor example, I use DW to
Overview:In this article, we mainly study two powerful text editors to understand the characteristics of the two text editors.A, VI (VIM) text editorExercises and after-school assignments1. Delete all whitespace characters from the beginning of lines in the/etc/grub2.conf file that begin with whitespaceSed "s/^[[:space:]]\+//"/etc/grub2.cfgSed-r "s/^[[:space:]]+//"/etc/grub2.cfg2. Delete all # and white spa
as a result of the recent work on the Linux system, often used to vi/vim, the operation of Vim for a certain period of time, began to use the high-frequency vim of the various shortcuts, of course, there is no less vim inside the powerful search and replace function.In comma
Tags: targe new tar switch insert mode set for also modeVI (VIM) is a very common editor on Linux, and many Linux distributions have VI (VIM) installed by default. VI (VIM) commands are numerous but if used flexibly it will greatly improve efficiency.
From: http://www.bubuko.com/infodetail-469867.html
Vim system Clipboard"+y Copy to system Clipboard"+p paste the contents of the system Clipboard into vimWhen you use Vi/vim in Ubuntu, you find that you cannot use the system's clipboard.On the Internet a check, the original is less loaded a few things.Use the following command to install the associated packa
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.