Skip to content

Commit

Permalink
Add my.cnf and colorize mysql results using grcat
Browse files Browse the repository at this point in the history
  • Loading branch information
yuku committed May 28, 2016
1 parent 93f9840 commit ff767a2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/dotfiles-sync
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ except=(
README.md
bin
fonts
grc
keyremap4macbook.xml
modules
script
Expand Down
54 changes: 54 additions & 0 deletions grc/conf.mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#default word color
#regexp=[\w.,\:\-_/]+
regexp=.+
colours=green
-

#table borders
regexp=[+\-]+[+\-]|[|]
colours=red
-

#data in ( ) and ' '
regexp=\([\w\d,']+\)
colours=white
-
#numeric
regexp=\s[\d\.]+\s*($|(?=\|))
colours=yellow
-
#date
regexp=\d{4}-\d{2}-\d{2}
colours=cyan
-
#time
regexp=\d{2}:\d{2}:\d{2}
colours=cyan
-
#IP
regexp=(\d{1,3}\.){3}\d{1,3}(:\d{1,5})?
colours=cyan
-
#schema
regexp=`\w+`
colours=yellow
-
#email
regexp=[\w\.\-_]+@[\w\.\-_]+
colours=magenta
-
#row delimeter when using \G key
regexp=[*]+.+[*]+
count=stop
colours=white
-
#column names when using \G key
regexp=^\s*\w+:
colours=white
2 changes: 2 additions & 0 deletions my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mysql]
pager = grcat $DOTFILES_ROOT/grc/conf.mysql | less -iMSx4 -FX -R

0 comments on commit ff767a2

Please sign in to comment.