Skip to content

Commit 0d73473

Browse files
committed
modified vim.md
1 parent 4b3eedb commit 0d73473

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

vim.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ The `%` means to "search the whole document. The `g` means **global** so it will
1414
:%s/foo/bar/g
1515
```
1616

17+
### Adding Newline from Search and Replace
18+
19+
> This step might not need to be done. I didn't have to do it...
20+
21+
First, set your Vi(m) session to allow pattern matching with special characters (i.e.: newline). It's probably worth putting this line in your `.vimrc` file:
22+
23+
```vim
24+
:set magic
25+
```
26+
27+
Next, do:
28+
29+
```vim
30+
:s/,/,^M/g
31+
```
32+
33+
To get the `^M` character, type <kbd>Ctrl</kbd> + <kbd>V</kbd> and hit <kbd>Enter</kbd>. Under Windows, do <kbd>Ctrl</kbd> + <kbd>Q</kbd>, <kbd>Enter</kbd>.
34+
1735
## repeat characters to a specific column
1836

1937
In the following example, `x` is whatever characters you want to repeat.

0 commit comments

Comments
 (0)