In iTerm, we can color regex matches to make things less gross.
To do so, you should create a new profile explicitly for rails server. Open iTerm prefs and create a new one.
You can map a shortcut to it, and even add an initial command at startup
Then click "Advanced" then "Edit" triggers
You can add regular expressions and then do shit when they occur.
Obviously I already have a few, but heres the few you might want for copy and pasting:
- json requests:
method\=.+ path\=.+
- the
/*STUFF*/
rails info after every line\/\*application:.+\*\/
you can add more, like I have the "HERE" one for everytime i ap "HERE"
,
because i do that all the time to see where or if something is firing.
I also have a red one that I always am changing when im trying to find specific things.
The way this shit works is it takes the last x
lines and does the regex on that.
That means if you are trying to match a huge message that starts with whatever
,
x
needs to be high enough to grab the whole message.
That x
value is a setting.
I have it set to 15. the default is three which means anything over three lines at the time of rendering wont match.
Have fun.