software/vim.md
... ...
@@ -187,6 +187,12 @@ https://stackoverflow.com/a/19996145
187 187
:%v/^Pattern/s/^/\t/
188 188
```
189 189
190
+## write regex match lines to new file
191
+```
192
+:g/^Pattern/ .w >> <filename>
193
+```
194
+* use `.w!` if file doesn't exist
195
+
190 196
## sort visual block
191 197
https://vim.fandom.com/wiki/How_to_sort_using_visual_blocks
192 198
```