Skip to content

Commit 1750efe

Browse files
committed
Move down git conflict example
1 parent a013451 commit 1750efe

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,6 @@ cat mylog.log | vims -e '^\s*$' 'dd' -l 'Vu'
109109
- `-l` - Turn off exe mode, turn on line exe mode
110110

111111
## Example 3
112-
Resolve all git conflicts by deleting the changes on HEAD (keep the bottom code):
113-
114-
```
115-
cat my_conflict.cpp | vims -e '^=======$' 'V?^<<<<<<< \<enter>d' -t '%g/^>>>>>>> /d'
116-
```
117-
118-
- `-e` - Turn on exe mode
119-
- `^=======$` - Match the middle bit of a git conflict
120-
- `V?^<<<<<<< \<enter>d` - Highlight the line, backward search to the top of the conflict, delete it.
121-
- `-t` - Turn off exe mode
122-
- `%g/^>>>>>>> /d` - Delete remaining conflict lines
123-
124-
## Example 4
125112

126113
Add a comment (`#`) on every line NOT containing foo:
127114

@@ -133,9 +120,9 @@ cat script.sh | vims -r 'foo' 'A # Comment'
133120
- `foo` - Match all lines with the word "foo"
134121
- `A # Comment` - At the end of the line, type " # Comment"
135122

136-
## Example 5
123+
## Example 4
137124

138-
Say you want to move all Python classes to the bottom of a file:
125+
Move all Python classes to the bottom of a file:
139126
```
140127
cat myscript.py | vims -e '^class' 'V/^\\S\<enter>kdGp'
141128
```
@@ -145,7 +132,7 @@ cat myscript.py | vims -e '^class' 'V/^\\S\<enter>kdGp'
145132
- `exe` - Execute the following, including escaped sequences (so you can call `\<c-o>` to mean Ctrl-o)
146133
- `norm V/^\S\<enter>kdGp` Enter normal mode, visual select to the next zero-indentation line, move up a line, delete, paste it at the bottom
147134

148-
## Example 6
135+
## Example 5
149136

150137
Only print the last 6 lines (just like tail)
151138

@@ -156,7 +143,7 @@ cat txt | vims -n '$-5,$p'
156143
- `$-5,$` - A range extending from 6th last line to the last line
157144
- `p` - Print
158145

159-
## Example 7
146+
## Example 6
160147

161148
Replace all multi-whitespace sequences with a single space:
162149

@@ -173,6 +160,20 @@ cat txt | vims -e '.' ':s/\\s\\+/ /g\<enter>'
173160
Note the double back-slashes needed (only in the second string of a pair in an exe command!)
174161
when you are typing a character like `\s`, but not like `\<enter>`.
175162

163+
## Example 7
164+
Resolve all git conflicts by deleting the changes on HEAD (keep the bottom code):
165+
166+
```
167+
cat my_conflict.cpp | vims -e '^=======$' 'V?^<<<<<<< \<enter>d' -t '%g/^>>>>>>> /d'
168+
```
169+
170+
- `-e` - Turn on exe mode
171+
- `^=======$` - Match the middle bit of a git conflict
172+
- `V?^<<<<<<< \<enter>d` - Highlight the line, backward search to the top of the conflict, delete it.
173+
- `-t` - Turn off exe mode
174+
- `%g/^>>>>>>> /d` - Delete remaining conflict lines
175+
176+
176177
## Example 8
177178

178179
Uncomment all commented-out lines (comment char: `#`)

0 commit comments

Comments
 (0)