Skip to content

Commit cde24ef

Browse files
committed
trim trailing whitespace
1 parent f7781b6 commit cde24ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1838
-1838
lines changed

Diff for: README.md

+139-139
Large diffs are not rendered by default.

Diff for: tip1.md

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# Tip1: Meet the Dot Command
2-
3-
## Dot:
4-
>repeat the last change.
5-
6-
## x:
7-
>delete the character under the cursor.
8-
9-
## u:
10-
>undo the changes.
11-
12-
## dd:
13-
>delete current line as a whole.
14-
15-
## >G:
16-
>increase the indentation from the current line until the end of the file.
17-
18-
## h,j,k,l:
19-
>h:left
20-
>j:up
21-
>k:down
22-
>l:right
23-
24-
## i:
25-
>enter Insert mode
26-
27-
## Esc:
28-
>enter Normal mode
29-
30-
# Example:
1+
# Tip1: Meet the Dot Command
2+
3+
## Dot:
4+
>repeat the last change.
5+
6+
## x:
7+
>delete the character under the cursor.
8+
9+
## u:
10+
>undo the changes.
11+
12+
## dd:
13+
>delete current line as a whole.
14+
15+
## >G:
16+
>increase the indentation from the current line until the end of the file.
17+
18+
## h,j,k,l:
19+
>h:left
20+
>j:up
21+
>k:down
22+
>l:right
23+
24+
## i:
25+
>enter Insert mode
26+
27+
## Esc:
28+
>enter Normal mode
29+
30+
# Example:
3131
![tip1](images/tip1.png)
32-
32+
3333
# [Contents](README.md) [Tip2](tip2.md)

Diff for: tip10.md

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
# Tip10: Use Counts to Do Simple Arithmetic
2-
3-
4-
`<C-a>`
5-
>perform addition on numbers.
6-
7-
`<C-x>`
8-
>perform subtraction on numbers.
9-
10-
11-
**comment**: When run without a count they increment by one, but if we prefix a number, we can change by that number. For example, if we positioned our cursor on a `5` character, running `10<C-a>` would modify it to read `15`.
12-
13-
14-
But what happens if the cursor is not positioned on a numeric digit? The documentation says that the `<C-a>` command will **“add [count] to the number at or after the cursor”** (see :h ctrl-a ). So if the cursor is not already positioned on a number, then the `<C-a>` command will look ahead for a digit on the current line. If it finds one, it jumps straight to it. We can use this to our advantage.
15-
16-
## yyp
17-
>duplicate current line once
18-
19-
## cw
20-
>delete character under the cursor and change to Insert mode.
21-
22-
## cW
23-
>delete to the end of the word under the cursor and change to Insert mode.
24-
25-
# Example:
26-
![tip10](images/tip10.png)
27-
# Take care:
28-
>If you answered 008, then you might be in for a surprise when you try using Vim’s `<C-a>` command on any number with a ****leading zero****. As is the convention in some programming languages, Vim interprets numerals with a leading zero to be in octal notation rather than in decimal. In the octal numeric system, `007` + `001` = `010`, which looks like the decimal ten but is actually an octal eight. Confused? If you work with octal numbers frequently, Vim’s default behavior might suit you. If you don’t, you probably want to add the following line to your **vimrc**:
29-
`set nrformats=`
30-
This will cause Vim to treat all numerals as decimal, regardless of whether they are padded with zeros.
31-
1+
# Tip10: Use Counts to Do Simple Arithmetic
2+
3+
4+
`<C-a>`
5+
>perform addition on numbers.
6+
7+
`<C-x>`
8+
>perform subtraction on numbers.
9+
10+
11+
**comment**: When run without a count they increment by one, but if we prefix a number, we can change by that number. For example, if we positioned our cursor on a `5` character, running `10<C-a>` would modify it to read `15`.
12+
13+
14+
But what happens if the cursor is not positioned on a numeric digit? The documentation says that the `<C-a>` command will **“add [count] to the number at or after the cursor”** (see :h ctrl-a ). So if the cursor is not already positioned on a number, then the `<C-a>` command will look ahead for a digit on the current line. If it finds one, it jumps straight to it. We can use this to our advantage.
15+
16+
## yyp
17+
>duplicate current line once
18+
19+
## cw
20+
>delete character under the cursor and change to Insert mode.
21+
22+
## cW
23+
>delete to the end of the word under the cursor and change to Insert mode.
24+
25+
# Example:
26+
![tip10](images/tip10.png)
27+
# Take care:
28+
>If you answered 008, then you might be in for a surprise when you try using Vim’s `<C-a>` command on any number with a ****leading zero****. As is the convention in some programming languages, Vim interprets numerals with a leading zero to be in octal notation rather than in decimal. In the octal numeric system, `007` + `001` = `010`, which looks like the decimal ten but is actually an octal eight. Confused? If you work with octal numbers frequently, Vim’s default behavior might suit you. If you don’t, you probably want to add the following line to your **vimrc**:
29+
`set nrformats=`
30+
This will cause Vim to treat all numerals as decimal, regardless of whether they are padded with zeros.
31+
3232
# [Tip9](tip9.md) [Tip11](tip11.md)

Diff for: tip11.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Tip11: Do Not Count If You Can Repeat
2-
3-
## Goal: delete two words
4-
![tip11_1](images/tip11_1.png)
5-
6-
## d2w/W
7-
>delete two words
8-
9-
## 2dw/W
10-
>delete a word two times
11-
12-
## dw.
13-
>delete a word and then repeat
14-
15-
# Take care:
16-
![tip11_2](images/tip11_2.png)
17-
>`d2w/W` and `2dw/W` are identical.`u`: the two words that were deleted will appear again. `.`: delete the next two words.
18-
19-
>`dw.`: `u`: `uu` or `2u` to restore the two words that were deleted. `.`: delete the next one word.
20-
21-
So, `d7w` == `dw......`
22-
23-
# Take the part you feel GOOD!
24-
1+
# Tip11: Do Not Count If You Can Repeat
2+
3+
## Goal: delete two words
4+
![tip11_1](images/tip11_1.png)
5+
6+
## d2w/W
7+
>delete two words
8+
9+
## 2dw/W
10+
>delete a word two times
11+
12+
## dw.
13+
>delete a word and then repeat
14+
15+
# Take care:
16+
![tip11_2](images/tip11_2.png)
17+
>`d2w/W` and `2dw/W` are identical.`u`: the two words that were deleted will appear again. `.`: delete the next two words.
18+
19+
>`dw.`: `u`: `uu` or `2u` to restore the two words that were deleted. `.`: delete the next one word.
20+
21+
So, `d7w` == `dw......`
22+
23+
# Take the part you feel GOOD!
24+
2525
# [Tip10](tip10.md) [Tip12](tip12.md)

Diff for: tip12.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Tip12: Combine and Conquer
2-
3-
# Action = Operator + Motion
4-
5-
# Rules:
6-
>an action is composed from an operator followed by a motion.
7-
8-
>when an operator command is invoked in duplicate, it acts upon the current line.
9-
10-
![tip12](images/tip12.png)
11-
1+
# Tip12: Combine and Conquer
2+
3+
# Action = Operator + Motion
4+
5+
# Rules:
6+
>an action is composed from an operator followed by a motion.
7+
8+
>when an operator command is invoked in duplicate, it acts upon the current line.
9+
10+
![tip12](images/tip12.png)
11+
1212
# [Tip11](tip11.md) [Tip13](tip13.md)

Diff for: tip13.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Tip13: Make Corrections Instantly from Insert Mode
2-
3-
## Left Ctrl
4-
![tip13](images/tip13.png)
5-
6-
## Note:
7-
>These commands works well with VIM and bash shell.
8-
9-
10-
# [Tip12](tip12.md) [Tip14](tip14.md)
1+
# Tip13: Make Corrections Instantly from Insert Mode
2+
3+
## Left Ctrl
4+
![tip13](images/tip13.png)
5+
6+
## Note:
7+
>These commands works well with VIM and bash shell.
8+
9+
10+
# [Tip12](tip12.md) [Tip14](tip14.md)

Diff for: tip14.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Tip14: Get Back to Normal Mode
2-
3-
![tip14](images/tip14.png)
4-
5-
## Insert Normal Mode
6-
>INM is a special version of Normal mode, which gives us one bullet. We can fire off a single command, after which we'll be returned to Insert mode immediately.
7-
8-
## Example
9-
>`<C-o>zz`: When the current line is right at the top or button of the window, you sometimes want to scroll the screen to see a bit more context. The `zz` command **redraws the screen with the current line in the middle of the window**, which allows us to read **half a screen above and below** the line we're working on.
10-
1+
# Tip14: Get Back to Normal Mode
2+
3+
![tip14](images/tip14.png)
4+
5+
## Insert Normal Mode
6+
>INM is a special version of Normal mode, which gives us one bullet. We can fire off a single command, after which we'll be returned to Insert mode immediately.
7+
8+
## Example
9+
>`<C-o>zz`: When the current line is right at the top or button of the window, you sometimes want to scroll the screen to see a bit more context. The `zz` command **redraws the screen with the current line in the middle of the window**, which allows us to read **half a screen above and below** the line we're working on.
10+
1111
# [Tip13](tip13.md) [Tip15](tip15.md)

Diff for: tip15.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Tip15: Paste from a Register Without Leaving Insert Mode
2-
3-
![tip15](images/tip15.png)
4-
5-
## yt,
6-
>yank the words **Practical Vim** into the yank register
7-
8-
## &lt;C-r&gt;0
9-
>`<C-r>{register}`: paste the text that we just yanked at the current cursor position; `<C-r><C-p>{register}`: insert text literally and fix any unintended indentation.
10-
11-
# [Tip14](tip14.md) [Tip16](tip16.md)
1+
# Tip15: Paste from a Register Without Leaving Insert Mode
2+
3+
![tip15](images/tip15.png)
4+
5+
## yt,
6+
>yank the words **Practical Vim** into the yank register
7+
8+
## &lt;C-r&gt;0
9+
>`<C-r>{register}`: paste the text that we just yanked at the current cursor position; `<C-r><C-p>{register}`: insert text literally and fix any unintended indentation.
10+
11+
# [Tip14](tip14.md) [Tip16](tip16.md)
1212

Diff for: tip16.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Tip16: Do Back-of-the-Envelope Calculations in Place
2-
3-
**Expression Register**: allows us to perform calculations and then insert the result directly into our document.
4-
>`expression register` is addressed by the `=` symbol. From Insert mode we can access it by typing `<C-r>=`: opens a prompt at the bottom of the screen where we can type the expression that we want to evaluate. When done, we hit `<CR>`, and Vim inserts the result at our current position in the document.
5-
6-
![tip16](images/tip16.png)
7-
1+
# Tip16: Do Back-of-the-Envelope Calculations in Place
2+
3+
**Expression Register**: allows us to perform calculations and then insert the result directly into our document.
4+
>`expression register` is addressed by the `=` symbol. From Insert mode we can access it by typing `<C-r>=`: opens a prompt at the bottom of the screen where we can type the expression that we want to evaluate. When done, we hit `<CR>`, and Vim inserts the result at our current position in the document.
5+
6+
![tip16](images/tip16.png)
7+
88
# [Tip15](tip15.md) [Tip17](tip17.md)
99

Diff for: tip17.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Tip17: Insert Unusual Characters by Character Code
2-
3-
4-
## &lt;C-v&gt;{code}
5-
>From Insert mode, entering symbols that are not found on the keyboard. `{code}` is the address of the character that we want to insert.
6-
7-
**note**: code consist of three digits! like: `<C-v>065`-->'A' or a four-digit hexadecimal code: `<C-v>u00bf`-->'¿'
8-
9-
## ga
10-
>display the numeric code for any character in your document, just place the cursor on it
11-
12-
![tip17](images/tip17.png)
13-
1+
# Tip17: Insert Unusual Characters by Character Code
2+
3+
4+
## &lt;C-v&gt;{code}
5+
>From Insert mode, entering symbols that are not found on the keyboard. `{code}` is the address of the character that we want to insert.
6+
7+
**note**: code consist of three digits! like: `<C-v>065`-->'A' or a four-digit hexadecimal code: `<C-v>u00bf`-->'¿'
8+
9+
## ga
10+
>display the numeric code for any character in your document, just place the cursor on it
11+
12+
![tip17](images/tip17.png)
13+
1414
# [Tip16](tip16.md) [Tip18](tip18.md)

Diff for: tip18.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Tip18: Insert Unusual Characters by Digraph
2-
3-
**digraph**: pairs of characters that are easy to remember.
4-
5-
## &lt;C-k&gt;{char1}{char2}
6-
>From Insert mode, use the digraphs, like: `<C-k>?I`-->'¿'
7-
8-
**&lt;&lt;** &lt;&lt;
9-
**&gt;&gt;** &gt;&gt;
10-
**½,¼,¾** 12, 14, 34
11-
1+
# Tip18: Insert Unusual Characters by Digraph
2+
3+
**digraph**: pairs of characters that are easy to remember.
4+
5+
## &lt;C-k&gt;{char1}{char2}
6+
>From Insert mode, use the digraphs, like: `<C-k>?I`-->'¿'
7+
8+
**&lt;&lt;** &lt;&lt;
9+
**&gt;&gt;** &gt;&gt;
10+
**½,¼,¾** 12, 14, 34
11+
1212
# [Tip17](tip17.md) [Tip19](tip19.md)

Diff for: tip19.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Tip19: Overwrite Existing Text with Replace Mode
2-
3-
**Replace mode**: is identical to Insert mode, except that it overwrites existing text in the document.
4-
5-
## R
6-
>From Normal mode, we can engage Replace mode with `R`, just overwrite the character under the cursor position.
7-
8-
![tip19](images/tip19.png)
9-
10-
**Overwrite Tab Characters with Virtual Replace Mode**
11-
12-
## gR
13-
>goto Virtual Replace Mode and treat the tab character as though it consisted of **spaces**.
14-
15-
## r{char}, gr{char}
16-
>overwrite a single character in **Replace** mode and **Virtual Replace** mode.
17-
1+
# Tip19: Overwrite Existing Text with Replace Mode
2+
3+
**Replace mode**: is identical to Insert mode, except that it overwrites existing text in the document.
4+
5+
## R
6+
>From Normal mode, we can engage Replace mode with `R`, just overwrite the character under the cursor position.
7+
8+
![tip19](images/tip19.png)
9+
10+
**Overwrite Tab Characters with Virtual Replace Mode**
11+
12+
## gR
13+
>goto Virtual Replace Mode and treat the tab character as though it consisted of **spaces**.
14+
15+
## r{char}, gr{char}
16+
>overwrite a single character in **Replace** mode and **Virtual Replace** mode.
17+
1818
# [Tip18](tip18.md) [Tip20](tip20.md)

0 commit comments

Comments
 (0)