# Section 1: TYPE TESTS.
#   name =RX case-sensitive regular expression to EOL
#   name =rx case-insensitive regular expression to EOL
#   name =Sx case-sensitive whitespace delimited list of suffices
#   name =sx case-insensitive whitespace delimited list of suffices
#XXX name =MG pattern (match pattern against /etc/magic file type answer)
#XXX Generality suggests name =BOOL expression over built-in+user-defined types
#Built-in types are:
#   dot, directory, brokenlink, symlink, blockdev, chardev, socket, executable

#dot      =RX ^\.
script   =sx .pl .awk .sed .sh .csh akefile .d .log
document =sx .txt .doc .html .ps .eps .pdf prn .htm .mif .fm .1 .3 .5 .8
capsdoc  =cx ABCDEFGHIJKLMNOPQRSTUVWXYZ_-.
#capsdoc  =RX ^[A-Z_-]+$
archive  =sx .z .gz .bz .bz2 .tar .tgz .tbz .tbz2 .zip .rar .deb .rpm
backup   =sx .swp .vim .bak .orig ~
header   =sx .h .hh
source   =sx .s .c .cc .i .java .f .m .py .vim .el .tex .fig
object   =sx .o .a .pyc .pyo .dvi .elc .obj core
media    =sx .au .mp3 .wav .img .bmp .jpg .gif .jpeg .png .mpg .mpeg .avi .wmv .mov .swf .asf .rm
pointer  =sx .torrent .url .urls

# Section 2: TYPE STYLES
# TYPE_TEST  SORT_KEY COLOR
directory      20     WHITE  on_blue
brokenlink     40     blink  inverse RED   # broken ln are ln=>test must be 1st
symlink        30     RED
blockdev      140     PURPLE on_blue
chardev       150     CYAN   on_blue
socket        160     YELLOW on_red
archive        60     PURPLE
#script         70     bold  fg:55 bg:123
#executable     80     bold  fg:gray-12 bg:gray-4
#header         90     bold  fg:0x160455
executable     80     YELLOW
script         70     bold   yellow
pointer        85     bold   purple
header         90     CYAN
source        100     GREEN
object        110     BLACK
media         120     BLUE
backup        130     yellow
capsdoc        49     bold  WHITE         # color by prior tests, but sort early
document       50     WHITE	          # color by prior tests, but sort early
dot            10     green      	  # color by prior tests, but sort early
other         170

# embellishment for symlinks with -L

color symlink italic

# Section 3: FIELD STYLES

color sizeB  WHITE
color sizeKB YELLOW
color sizeMB RED
color sizeGB PURPLE

color perm0  RED
color perm1  yellow
color perm2  BLUE
color perm3  green
color perm4  GREEN
color perm5  YELLOW
color perm6  CYAN
color perm7  WHITE

# Section 4: LISTING STYLES; I like increasing 'l's to give increasing detail.
# 'styles' are just option packages which can be referenced by the -s option.
# NOTE: -f option must be the last argument on the line due to lame parsing.
# NOTE: use %r if you worry about automounters/NFS hanging on link targets.
style la  -L          -f%P %s %m %f%R
style l   -s la -xdot
style ls  -s l  -os
style lT  -s l  -oM   -f%P %s %M %f%R
style lc  -s l  -oc   -f%P %s %c %f%R
style lt  -s l  -om   -f%P %s %m %f%R
style lu  -s l  -oa   -f%P %s %a %f%R
# Same as above+ showing first 2 characters of the owner, show link tgt
style lla -L          -f%P %U %s %m %f%R
style ll  -s lla -xdot
style lls -s ll  -os
style llT -s ll  -oM   -f%P %U %s %M %f%R
style llc -s ll  -oc   -f%P %U %s %c %f%R
style llt -s ll  -om   -f%P %U %s %m %f%R
style llu -s ll  -oa   -f%P %U %s %a %f%R
# Show almost everything:
style La             -f%i %b %P %n %U %G %S %m %f%R
style L   -s La -xdot
style Ls  -s L  -os
style LT  -s L  -oM   -f%i %b %P %n %U %G %S %M %f%R
style Lc  -s L  -oc   -f%i %b %P %n %U %G %S %c %f%R
style Lt  -s L  -om   -f%i %b %P %n %U %G %S %m %f%R
style Lu  -s L  -oa   -f%i %b %P %n %U %G %S %a %f%R
# Extra options when stdout is not a terminal
#style notty -1p
