10x, after the current position after inserting 3! , 3a! W moves forward one word (the cursor stops at the beginning of the word), and if it is at the end of the line, go to the start of the next line. This command is fast and can replace the L command.b Move backward one word 2b move backwards 2 wordsE, with W, except that the cursor stops at the tail of the word.GE, with B, the cursor stops at the end of the word.^ Moves to the first non-whitespace
with Word2! For example, search for vbird between 100 and 200 rows and replace it with Vbird:": 100,200s/vbird/vbird/g". ( common )
: 1, $s/word1/word2/g
Look for the word1 string from the first line to the last line and replace the string with Word2! ( common )
: 1, $s/word1/word2/gc
Look for the word1 string from the first line to the last line and replace the string with Word2! and display the prompt character before the substitution to the user to confi
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
to replace! Common
Delete, copy and paste on
X, X
In one line of words, X is the backward deletion of a character (equivalent to the [Del] key), and X is to delete a character (equivalent to [backspace], which is the backspace) (common)
Nx
N is a number that continuously deletes n characters backwards. For example, I want to delete the 10 characters consecutively, "10x".
Dd
Delete
, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new with old, replacing all occurrences of the entire file: 10,20 s/^//g adds four spaces before each line in line 10th to indent.DDP swaps the line that the cursor is in and immediately below it.
/word1/word2/g
N1 and N2 are numbers. Look for the string word1 between N1 and N2, and replace the string with Word2! For example, search for vbird between 100 and 200 rows and replace it with Vbird:": 100,200s/vbird/vbird/g". Common
: 1, $s/word1/word2/g
Look for the word1 string from the first line to the last line and replace the string with Word2! Common
: 1, $s/word1/word2/gc
Look for the word1 string from the first line to the last line and replac
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
) whether need to replace! Common
Delete, copy and paste on
X, X
In one line of words, X is the backward deletion of a character (equivalent to the [Del] key), and X is to delete a character (equivalent to [backspace], which is the backspace) (common)
Nx
N is a number that continuously deletes n characters backwards. For example, I want to delete the 10 characters consecutively, "10x".
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
!
: n1,n2s/word1/word2/g
N1 and N2 are numbers. Look for the string word1 between N1 and N2, and replace the string with Word2! For example, search for vbird between 100 and 200 rows and replace it with Vbird:": 100,200s/vbird/vbird/g". ( common )
: 1, $s/word1/word2/g
Look for the word1 string from the first line to the last line and replace the string with Word2! ( common )
: 1, $s/word1/word2/gc
Look for the word1 string from the first
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
specified by the file name Filename.txt.: W, then enter (enter: W, then enter, save the file without exiting): Wq, then enter (enter: Wq, then enter, save and exit): q!, and then enter (enter: q!, and then enter, do not save the mandatory exit VI): e!, discard all changes, and open the original fileMoveHJKL, control the cursor to the left, bottom, top, and right one grid, or you can use four arrowsThe above four commands can be used with the number, such as 20J is to move down 20 lines, 5h is t
10x, after the current position after inserting 3! , 3a! W moves forward one word (the cursor stops at the beginning of the word), and if it is at the end of the line, go to the start of the next line. This command is fast and can replace the L command.b Move backward one word 2b move backwards 2 wordsE, with W, except that the cursor stops at the tail of the word.GE, with B, the cursor stops at the end of the word.^ Moves to the first non-whitespace
delete 10 characters 10x, after the current position after inserting 3! , 3a! W moves forward one word (the cursor stops at the beginning of the word), and if it is at the end of the line, go to the start of the next line. This command is fast and can replace the L command.b Move backward one word 2b move backwards 2 wordsE, with W, except that the cursor stops at the tail of the word.GE, with B, the cursor stops at the end of the word.^ Moves to the
last line and replace the string with Word2! ( Common)
: 1, $s/word1/word2/gc
Look for the word1 string from the first line to the last line and replace the string with Word2! and display the prompt character before the substitution to the user to confirm (confirm) whether need to replace! ( Common)
8. Deleting strings and rows
X, X
In one line of words, X is the backward deletion of a character (equivalent to the [Del] key), and X is to delet
Transferred from: http://blog.csdn.net/lhf_tiger/article/details/8203013It's disgusting, the 10X process generated by the CSV file row bit actually has ^m characters, harm I have been looking for the cause of the error, really pit, fortunately, I finally found out. have been using Python,perl is becoming more and more unskilled. Commissioning took a long time.Replace ^m charactersUse VI under Linux to see some text files created under Windows, and som
characters consecutively, "10x".
Dd
Delete the entire column where the cursor is located ( Common)
Ndd
N is a number. Delete the down n column where the cursor is located, for example, 20DD to delete 20 columns ( common)
d1g
Remove all data from the first row of the cursor
Dg
Delete all data from the last row of the cursor
d$
Delete the last character of th
In this section, we will learn about Python's control flow statements, mainly including if, for, while, break, continue, and pass statements
1. If statement
The IF statement is perhaps the most familiar statement we have. Here's how to use it:
X=input ("Please input an integer:")If xprint ' xElif x==0:print ' x=0 'Elif x>0:print ' x>0 'Elseprint ' x is not a number 'Operation Result:>>>Please input an integer:10X>0
2.f
, many commands can be used with the number, such as delete 10 characters 10x, after the current position after inserting 3! , 3a! W moves forward one word (the cursor stops at the beginning of the word), and if it is at the end of the line, go to the start of the next line. This command is fast and can replace the L command.b Move backward one word 2b move backwards 2 wordsE, with W, except that the cursor stops at the tail of the word.GE, with B, th
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.