We sort with lines starting with # first. We sort with lines starting with * second. We sort with lines that do not start with [#!*] third. We sort with lines starting with ! fourth. Example usage in vim with a keyboard macro <escape>f: ```vim :map ^[f 1G!G../../bin/sgi^M ``` or via .vimrc: ```vimrc " sort the entire .gitignore file using ../../bin/sgi :map ^[f 1G!G../../bin/sgi^M ``` NOTE: The ^[ above is ((Escape)) and ^M is ((Control-M)). Example usage in shell: ```sh rm -f t && ../../bin/sgi < .gitignore > t && mv -f t .gitignore ``` Suggested usage: ```sh bin/all-run.sh bin/sort.gitignore -v 1 ``` Sorted all winner .gitignore according to this method. Sorted all year level .gitignore according to this method. Sorted top level .gitignore according to this method.
36 lines
701 B
Plaintext
36 lines
701 B
Plaintext
#
|
|
# sort with: bin/sgi
|
|
.DS_Store
|
|
/NOTES
|
|
/archive/historic/1984
|
|
/archive/historic/1985
|
|
/archive/historic/1986
|
|
/archive/historic/1987
|
|
/archive/historic/1988
|
|
/archive/historic/1989
|
|
/archive/historic/1990
|
|
/archive/historic/1991
|
|
/archive/historic/1992
|
|
/archive/historic/1993
|
|
/archive/historic/1994
|
|
/archive/historic/1995
|
|
/archive/historic/1996
|
|
/archive/historic/1998
|
|
/archive/historic/2000
|
|
/archive/historic/2001
|
|
/archive/historic/2004
|
|
/archive/historic/2005
|
|
/archive/historic/2006
|
|
/archive/historic/2011
|
|
/archive/historic/2012
|
|
/archive/historic/2013
|
|
/archive/historic/2014
|
|
/archive/historic/2015
|
|
/archive/historic/2018
|
|
/archive/historic/2019
|
|
/archive/historic/2020
|
|
.su[a-z]
|
|
.*.sv[a-z]
|
|
.*.sw[a-z]
|
|
.sw[a-z]
|