From 6f8c12d0df1ff83e2d6cf12e58b2894dff497d82 Mon Sep 17 00:00:00 2001 From: ashfinal Date: Sat, 29 Aug 2020 05:36:51 +0800 Subject: [PATCH] Update ch13_the_global_command.md --- ch13_the_global_command.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ch13_the_global_command.md b/ch13_the_global_command.md index 0f92839..5d074a8 100644 --- a/ch13_the_global_command.md +++ b/ch13_the_global_command.md @@ -447,6 +447,12 @@ By the way, if you want to reduce multiple empty lines into no lines, instead of :g/^$/,/./j ``` +Or simpler: + +``` +:g/^$/-j +``` + Your text is now reduced to: ``` @@ -501,7 +507,7 @@ const arrayA = [ If you need to sort the elements inside the arrays, but not the arrays themselves, you can run this: ``` -:g/\[/+1,/\v\]/-1sort +:g/\[/+1,/\]/-1sort ``` Result: