Created
September 25, 2015 11:15
-
-
Save dsueiro/34617686b6e4391940a2 to your computer and use it in GitHub Desktop.
Sorting subsections in vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:g/^a/+1,/^\s*$/-1 sort n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sort n => sort as numbers, not strings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a | |
1 | |
2 | |
5 | |
3 | |
4 | |
11 | |
a | |
88 | |
8 | |
7 | |
a | |
25 | |
32 | |
11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a | |
1 | |
2 | |
3 | |
4 | |
5 | |
11 | |
a | |
7 | |
8 | |
88 | |
a | |
11 | |
25 | |
32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment