A Simple, Solarized, Weechat Setup

I nicked this from here, but the site has since disappeared, which is why I’m posting it on my site. I had to dig it out of the Wayback Machine to be able to find it, but I’m glad I did. I simply couldn’t find a post like it. It’s my perfect weechat setup, all in one. Thanks, whoever you are.

By inhies

22.MAR.2013

Weechat, My New Favorite IRC Client

I recently switched from Irssi to Weechat for my IRC client, and I must say, I’m kind of sad I didn’t do so sooner. Irssi was always good to me, but Weechat is flexible and extensible in ways Irssi never was. Within 30 minutes of having Weechat installed I had it setup to match my Irssi installation that took me a few weeks to create. Since then I’ve convinced a number of other people to give Weechat a try and as far as I know no one has gone back to their old clients.

What follows is a short guide on getting Weechat setup and getting it adjusted so things look nice with Solarized colors.

First, you will want to download Weechat, though if you are using Ubuntu I recommend you install the Weechat PPA. Once we have it installed, we want to get some basic scripts to improve functionality. We are also going to bind alt-g to the /go command. This lets you call up the go.py script and start typing a channel name which you can select from a list. The following commands should all be run inside weechat:

/script install buffers.pl buffer_autoclose.py iset.pl go.py colorize_nicks.py
/key bind meta-g /go

Then we want to adjust the layout and coloring. This will tweak the colors Weechat uses to make it easier to see with solarized, as well as place a list of all buffers at the top of the screen:

/set weechat.bar.status.color_bg 0
/set weechat.bar.title.color_bg 0
/set weechat.color.chat_nick_colors 1,2,3,4,5,6
/set buffers.color.hotlist_message_fg 7
/set weechat.bar.buffers.position top

NOTE FROM BEN (2016-02-21): Reader WubTheCaptain wrote in and provided details as to what the following line does. It re-creates the ‘buffers’ bar that buffers.pl makes when you install it. New users will not need to do this but it’s worth doing just in case.

If you have installed buffers.pl before and have reset your weechat config, you need to run this. So for instance if you ‘cleared’ your config to start again with this guide, you need to run this. You should run it anyway, because it does not do any harm and does not make any changes if the bar already exists.

/set weechat.bar.buffers.items buffers

Now we are going to tweak the buffer and buffer list. We want to merge the server buffers in to one to take up less of our precious screen space (you can switch between them with ctrl-x). Then we want to hide any channels from the buffer list that haven’t had activity in 10 minutes or less to keep the clutter down.

/set buffers.look.hide_merged_buffers server
/set buffers.look.detach 600

Now some filter tweaks to make IRC less annoying. I only care about a channel if someone is talking, not if someone is coming or going, so the first two commands make it so that joins and parts don’t count as ‘activity’ on a channel. The next two commands hide joins/parts from users that haven’t spoken recently (default is 5 minutes). You can toggle this with ctrl-=. This makes busy channels MUCH more bearable.

/set weechat.look.buffer_notify_default message
/set irc.look.smart_filter on
/filter add irc_smart * irc_smart_filter *

When we join a channel, a lot of information is spit out, most of which is redundant. I like to hide all this with the following command:

/filter add irc_join_names * irc_366,irc_332,irc_333,irc_329,irc_324 *

Lastly, here are some visual bits to make Weechat a bit nicer. The most significant is the first one which will replace the nickname for a message with a little arrow if the previous message in your buffer was from the same user. It makes following the conversation much easier. If you are unsure, I urge you to try it out; you can always set it back to the default value easily using /iset:

/set weechat.look.prefix_same_nick "⤷"
/set weechat.look.prefix_error "⚠"
/set weechat.look.prefix_network "ℹ "
/set weechat.look.prefix_action "⚡"
/set weechat.look.bar_more_down "▼▼"
/set weechat.look.bar_more_left "◀◀"
/set weechat.look.bar_more_right "▶▶"
/set weechat.look.bar_more_up "▲▲"
/set weechat.look.prefix_suffix "╡"

Oh, and if you happen to idle in large/busy channels and you don’t want to be alerted every time someone talks in there, you can use this command, after adjusting it for the correct server and channel names. This will only show the channel #go-nuts on the freenode IRC network as having activity if someone says your nickname:

/set weechat.notify.irc.freenode.#go-nuts highlight

That’s about all I have for now. There are of course many other tricks and tweaks you can make, but what I outlined above should be enough to get anyone well on their way. If you want more information, I urge you to check out the quick start or even the full documentation. You can also get more scripts to play with if your heart so desires.

EDIT by Ben Oliver: To restrict the length of nicks in the sidebar to 15 characters, the following applies:

/set weechat.look.prefix_align_max 15

Another edit by Ben Oliver: To save space I like to have the time set to a minimal format, so 16:08:32 becomes 1608.

/set weechat.look.buffer_time_format "${253}%H${245}%M"

I also like to bind alt-n to toggle the nicklist.

/key bind meta-n /bar toggle nicklist