mirror of
https://github.com/iggredible/Learn-Vim
synced 2024-11-26 20:40:18 +00:00
Update ch13_the_global_command.md
This commit is contained in:
parent
8f1cdf4054
commit
6f8c12d0df
1 changed files with 7 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue