Irssi tricks: ignores and hilights

I like the IRC client irssi a lot. I’ve been using it for many years now, and have learned many tricks about it. In these irssi blog entries, I’ll be sharing some tricks with you.

The /ignore command is quite powerful and can be used to remove lots of unwanted lines. If there is someone you don’t want to see in your channel, you can use it like this:

/ignore *!username@host.example.com ALL

to ignore all messages from this person, on channels and in private, as well as things like joins and topic changes.

But it gets better. If other people are talking to this person in the channel, using the standard “Nickname: text here” structure, you can ignore this as well:

/ignore -replies *!username@host.example.com ALL

Some channels have people who use expressions like “lol” and “rofl” a lot, including many variations like “lawl” and “rulf”. I don’t like it when such expressions appear as the only word on a line, and this ignore helps me avoid seeing them:

/ignore -regexp -pattern ^l[aoeui]+w?lz?|r[aoeui]+[lfk][lfk]z?$

With the -regexp flag, you indicate that this hilight is a regular expression. With regexps, you can match very specific strings. As you can see, you can just go wild with such regular expressions.

Sometimes, you’re on a channel with a lot of activity. All the joins, parts, and modes can really pollute the window. You can hide those lines with this command:

/ignore #channel JOINS PARTS QUITS TOPICS MODES
The irssi activity bar

The irssi activity bar

You might also not want that channel to show up in your activity bar. You can accomplish that with:

/set activity_hide_targets #channel #channel2 #channel3

Actually, why would you want a channel to show up in your activity bar when someone parts it? Or voices someone? I have the following setting in my irssi:

/set activity_hide_level QUITS JOINS PARTS KICKS MODES TOPIC NICKS

To get a list of all the existing message levels, type this:

/help levels

My friends are sometimes a bit creative with my nickname, Garion. To make sure that their creative versions are hilighted properly, I’ve done this:

/hilight -regexp ga+ri+o+n+
/hilight -regexp gaa+r(k|tj)e+
Gaaarioooon

This interesting version of my nickname hilights as well.

So, if someone calls me Gaaaarioon or gaaartjeeee, it will still hilight properly.

Hilighted text, by default, appears as a purple/red/pink (depending on your terminal and colour perception) number in your activity bar. I like to have different subjects trigger different hilight colours in my activity bar, for example:

/hilight -full -color %G -actcolor %Y tea

The -full flag makes sure that only the full word “tea” causes a hilight, and “steam” does not, even though it contains “tea”. The -color %G flag makes sure that the nickname of the hilighter is shown in green, instead of the default yellow. This flag also causes the activity number in your statusbar to turn green. The -actcolor %Y flag overrides this green-ness, and turns the activity number yellow instead.

I don’t think there is a way to manipulate the contents of messages themselves via built-in irssi commands. For example, you might want to remove “lol” from the end of sentences, or replace “god” by “flying spaghetti monster”.

If you want to modify messages, one option is to use Wouter Coekaerts‘s script trigger.pl, also available from the Irssi script archive.

Stay tuned for more irssi tricks!

This entry was posted in irssi and tagged , , , . Bookmark the permalink.

17 Responses to Irssi tricks: ignores and hilights

Leave a Reply

Your email address will not be published. Required fields are marked *