WeeChat for Slack's IRC Gateway

WeeChat is a text based chat client that runs on many
different platforms like Linux, Mac OS X, various BSD variants and Windows
(through cygwin). WeeChat is mainly used for
IRC, aims to be fast, light
and extensible and is a more modern alternative to
IRSSI.

After switching from Campfire to Slack for the thoughtbot
company chat, more of us started using WeeChat together with the Slack IRC
gateway.

Installing WeeChat on a server lets you always be online, even when you are not
at your computer. This means that you will never miss a message in the channels
you are connected to or any direct message or mention.

Binary packages for the latest version of WeeChat are available for a bunch of
different distributions like Debian
(Backports) and Arch
Linux. Installation
is as simple as using your favorite package manager.

WeeChat is also available through Homebrew as weechat. When
installing using Homebrew be sure to pass these options to enable script support
for Lua, Perl, Python and Ruby scripts:

This command turns on the autoconnect feature, SSL encryption and sets the
Diffie-Hellman
key size to 512. This is required since the WeeChat default
value (2048) will cause errors during the SSL handshake with the Slack IRC
gateway.

When you connect, the Slack IRC gateway will automatically join all channels
that you already belong to.

In WeeChat, channels, private messages and connections to servers are displayed
in what’s called buffers. By default WeeChat only displays one buffer at a
time.

You can cycle between all open buffers by pressing
Alt+Up/Down.

You can also switch between buffers using the /buffer command:

/buffer #general

Partial buffer names can be tab-completed.

Buffers are also numbered. You can jump between buffers using these numbers by
pressing Alt+NUMBER or Esc and then
NUMBER. To get a better overview of open buffers and their numbers,
check out the buffers.pl plugin.

Buffers that have unseen activity are listed in the
hotlist.
To jump to the next buffer on the hotlist, press
Alt+A. The hotlist is ordered by importance.

The first buffer (buffer number 1) is the WeeChat core buffer. This buffer is
used to interact with WeeChat and all servers you are connected to. When you
issue commands like /help or /whois the output shows up in this buffer.

When you issue commands in the core buffer they get sent to its current target.
The current target is either WeeChat itself or one of the servers you are
connected to. You can see the current target on the line just above the buffer
input field. To cycle between targets press
Ctrl+X.

When issuing commands to WeeChat itself you don’t have to switch to the
weechat target.

WeeChat is configured by issuing commands like /set, /unset, /server or
/window. To get information about a command use the /help command like this:

/help COMMAND

Where COMMAND is the command you want information about.

If you issue the /help command without passing a command it will show you a
list of all available commands.

WeeChat’s configuration is stored in files inside the ~/.weechat/ directory.
To save the current configuration to disk use the /save command. To write
the current layout configuration to disk use the /layout save command.

The current configuration is automatically saved to disk by WeeChat when you
quit or certain other WeeChat commands. This prevents you from loosing your
configuration but can also be a pain if you try to edit the files manually while
WeeChat is running.

By default all messages containing your nickname will be highlighted. You might
want other messages to be highlighted as well. For example, if you would like
all messages that mention the word “fika” to be highlighted you can configure
that by typing:

/set weechat.look.highlight fika

Tell WeeChat to highlight messages containing other words by separating them
with commas:

The Slack IRC gateway uses the IRC voice feature to indicate user activity. A
user is automatically voiced when active and devoiced when inactive. Users that
are using the Slack web interface are constantly voiced and devoiced and this
creates a lot of noise in WeeChat buffers. To filter out these messages you can
add this filter:

If you are running WeeChat in GNU Screen
it is important that the TERM environment variable is set to screen-256color
in order for WeeChat to be able to display all the above colors. You can force
this by adding this line to your .screenrc:

Buffers provides a sidebar
where all open buffers are listed with their number. This gives me a much better
overview of my buffers. The sidebar also shows which buffers has unread messages
and highlights.

Install Buffers using the /script command:

/script install buffers.pl

By default Buffers will color the buffer names depending on activity in
them. If you also want to know how many messages and highlights the buffers have
you can tell Buffers to display a hotlist counter:

Highmon is a highlight
monitor. It creates a buffer containing all highlighted messages in other
buffers. This script is great for quickly reviewing all my mentions to see if
something important has come up.

Install Highmon using the /script command:

/script install highmon.pl

I keep a small Highmon buffer at the top of my WeeChat window at all times. This
way, I just have to glance at the WeeChat window to see I have any new important
highlights.

To do this, split your window into two horizontal splits; One small at the top
for Highmon, and one large below for your chat buffers: