Linode Library Home
Linode Library RSS Feed
Home :: Communications :: IRC Guides
Print View View Source

Advanced Irssi Usage

Published: by

With a flexible plugin architecture and embedded Perl interpreter, you can customize Irssi a great deal beyond the off-the-shelf experience. The following sections outline a number of popular commands, modifications, and plugins.

One of the most powerful features of Irssi is its pervasive tab completion. All commands and command arguments can be completed using the tab key by first typing the first few characters of the command or argument, and then pressing the tab key to cycle through possible completions. Nicknames, channel, and window names are also tab-completable.


Key Bindings and Aliases

If you find yourself using a command frequently and want to avoid typing it repeatedly, you can bind it to a key. For example, this command binds /window last to Alt-x or Esc-x:

/bind meta-x /window last

This will create a key binding for meta-x (depending on your terminal emulation, this may be Alt-x or Esc-x) that runs the command "/window last". Henceforth, when you press "Alt-m-x", the focus of your Irssi session will toggle between your two most recent windows. If you would like to specify bindings for Control- combinations, use "^X" or "^v", where X and v are the keys to be bound (C-X or C-v in emacs-style notation). Note that key bindings are case sensitive.

Alternatively, you may want to create an "alias," which is a shortening of a specific command. Consider the following examples aliases for longer /window commands:

/alias wj join -window
/alias wm window move

Once you've created this alias, rather than typing "/window join #channel", you can instead type "/wj #channel" to join a channel in the current window. Similarly, rather than typing "/window move [number]", you can type "/wm" to move the window elsewhere.

You may also create aliases with variables. mIRC users may remember the "slap" command which allows you to slap users in the channel with a trout. While not all users may find this useful or nice, the following command will add a /slap alias to Irssi:

/alias slap /me slaps $0 around a bit with a large trout;

When you type "/slap <nickname>", you will perform an "action" (or /me command) that slaps the user around a bit with a large trout.

Perhaps a more useful example is creating aliases for services. Irssi does not pass on unknown commands to the IRC server, so you will get an unknown command error when you try to use commands like /cs or /ns. To fix this, you may wish to add the following aliases:

/alias cs quote cs $0-
/alias ns quote ns $0-

When you use "/cs" or "/ns", it will be as if you had typed "/msg chanserv" or "/msg nickserv", respectively. The $0- in the aliases above passes anything after /cs or /ns on to the service you are trying to use (ChanServ or NickServ in this case). You may add aliases such as these for any other services you use.

Saving State

Unless you explicitly save your configuration, every modification that you make to your Irssi session will be lost when you exit Irssi. Issue the following command to Irssi to save all current configuration modifications to your ~/.irssi/config file:


You may also want to run "/layout save" to save the arrangement of windows so that when you start Irssi again, you do not have to rearrange all of the channels that you have set to automatically join. Additionally, you may want to create the following ADDALLCHAN alias to save all of your current channels:

/alias ADDALLCHAN script exec foreach my \$channel (Irssi::channels()) { Irssi::command("channel add -auto \$channel->{name} \$channel->{server}->{tag} \$channel->{key}")\;}

When you issue the "/ADDALLCHAN" command, all of the channels that you are currently joined to will be auto-joined the next time you run Irssi. Consider running the above commands with some regularity to ensure that your configuration file reflects the current state of your Irssi session. Remember that you cannot safely edit the configuration file while an Irssi session is running.

Using Plugins

There are many plugins for Irssi that add a large amount of functionality. To find scripts, examine the Irssi script repository. Here are some commands for managing scripts:

The following plugins are popular among the Linode community:

You can install all of these scripts to "autorun" when you invoke Irssi the next time by issuing the following sequence of commands:

cd ~/.irssi/scripts/autorun/
wget -O

From within Irssi, issue the following commands to load these plugins for the first time:

/script load autorun/
/script load autorun/
/script load autorun/
/script load autorun/
/script load autorun/
/script load autorun/

If you would like to install but not auto-load the scripts, use "cd ~/.irssi/scripts/" before starting your wget commands. That way, they'll end up in the main scripts directory, not the autorun directory. To load these scripts in Irssi, run the following commands:

/script load
/script load
/script load
/script load
/script load
/script load

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

Creative Commons License

This guide is licensed under a Creative Commons Attribution-NoDerivs 3.0 United States License.

Last edited by Sharon Campbell on Monday, April 15th, 2013 (r3408).