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
1 repeating last commandIn normal mode . (decimal point) means the last command operation is repeatedNormal mode input x , delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands of the same number of timesEnter Normal mode input N , n indicates the number of repetitions, and the following is the practice:Do the following exercises:
Input 10
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
One, vim repeat command 1. Repeat the last commandIn normal mode . (decimal point) means the last command operation is repeatedCopy test files to a local directory$ cp /etc/protocols .Open a file for editing$ vim protocolsNormal mode input x , delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands of the same number of timesEnter Normal mode input N , n indicates the number of repetitio
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
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
? Kaima means looking up Kaima this string
: n1,n2s/word1/word2/g
Find word1 between N1 and N2 rows and replace with Word2
10,20s/kaima/good/g find Kaima in the 10th to 20th row and replace it with good
: 1, $s/word1/word2/g
Find word1 from the first line to the last row and replace with Word2
: 1, $s/kaima/good/g
num + x
Continuous deletion of num characters
10x means delet
, it throws a Nameerror exception because it is not visible
Scope
Global scope
Visible throughout the program's running environment
Local scope
Visible inside functions, classes, and so on
Local variables cannot be used beyond the local scope in which they reside
Outer variable scope visible within scope of the inner layer
In the inner scope inner, if o=97 is defined, it is equivalent to redefining a new variable o in the
, delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands of the same number of timesEnter Normal mode input N , n indicates the number of repetitions, and the following is the practice:Open file file for editing$ vim protocolsBelow you can do the following exercises in turn:
Input 10x , delete 10 consecutive characters
Input 3dd
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
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
'%s ' 1 2 3 4 5 6 # put 1 2 3 4 5 6 as a string output with a blank output formatprintf '%s\n ' 1 2 3 4 5 6 # Output format is 1 rowsprintf '%s%s '%s ' 1 2 3 4 5 6 # Content As String three for a set of outputs, 1 2 34 5 6printf '%s%s%s\n ' 1 2 3 4 5 6 # Output format is 3 rowsprintf '%s ' $ (cat user.txt) # Output text content is a stringprintf '%s\t%s\t%s\t%s\n ' $ (cat user.txt) # Format output of text content"Awk"The standard output command for awk is printf, and the default delimiter is a
) (commonly used), NX N is a number that continuously deletes n characters backwards. Bowl example, I want to delete 10 characters, "10x" continuously. d$ Delete the cursor at the end of the line, all the characters d0 the row, and all the characters at the beginning of the row are deleted.For row operations: DD deletes the entire column (common) ndd n is the number of the cursor. Delete the row where the cursor is located n rows down, for example 20D
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
Char is the underlying type of Java (the original type) and is a character type. Characters in Java are Unicode-encoded, so a Java character occupies 2 bytes, and the content of the character is stored in Unicode code values (binary numbers). The question is, how does the program convert Unicode code values to the program data we want? For example: Chinese characters ' Han ' corresponds to the Unicode code value: 0x6c49. We want the program data to be ' Han ', while the computer stores the code
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
One, vim repeat command 1. Repeat the last commandIn normal mode . (decimal point) means the last command operation is repeatedCopy test files to a local directory$ cp /etc/protocols .Open a file for editing$ vim protocolsNormal mode input x , delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands of the same number of timesEnter Normal mode input N , n indicates the number of repetitio
One, bitwise operatorsThe previously learned operators are either variable-based or constant.Example 1:Class test1{public static void Main (String [] args) { | ^ ~All four of the above operators are bit-based.: Each one compares, there are 0 0, no 0 1.// | : Each person compares, there are 1 1, No 1 0.^:, same is 0, different 1.~: Each one is reversed.System.out.println (63);System.out.println (6|3);System.out.println (6^3);System.out.println ();}}/*============================110 011----------
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.