mirror of
https://github.com/iggredible/Learn-Vim
synced 2024-11-22 18:43:02 +00:00
mess in section in chapter 13?
This commit is contained in:
parent
66cb706c6c
commit
7252415526
1 changed files with 2 additions and 2 deletions
|
@ -533,9 +533,9 @@ const arrayA = [
|
|||
]
|
||||
```
|
||||
|
||||
:g/\[/+1,/\]/-1sort
|
||||
This is great! But the command looks complicated. Let's break it down. This command also follows the form `:g/pattern1/,/pattern2/command`.
|
||||
`:g/\[/` is the global command pattern.
|
||||
|
||||
- `:g/\[/` is the global command pattern.
|
||||
- `/\[/+1` is the first pattern. It matches a literal left square bracket "[". The `+1` refers to the line below it.
|
||||
- `/\]/-1` is the second pattern. It matches a literal right square bracket "]". The `-1` refers to the line above it.
|
||||
- `/\[/+1,/\]/-1` then refers to any lines between "[" and "]".
|
||||
|
|
Loading…
Reference in a new issue