mirror of
https://github.com/iggredible/Learn-Vim
synced 2024-11-27 04:50:18 +00:00
Merge pull request #16 from ashfinal/patch-1
Update ch13_the_global_command.md
This commit is contained in:
commit
d7a4f89ab8
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