Advanced Irssi Usage

Updated by Linode Written by Linode

Contribute on GitHub

Report an Issue | View File | Edit File

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:

  • /script displays a list of all loaded scripts and full paths to their source files
  • /script load [script] loads the specified script. Irssi expects all scripts to be located in the ~/.irssi/scripts/ directory. If you have stored a script in a subdirectory of ~/.irssi/scripts/, you need to specify that in the load command. Scripts placed in the ~/.irssi/scripts/autorun/ directory are loaded when Irssi starts.
  • /script unload [script] unloads the specified script
  • /script exec [script] runs the specified script once
  • /script reset unloads all scripts and resets the Perl interpreter.

The following plugins are popular among the Linode community:

  • generates a horizontal rule in a channel to mark the last time you viewed this channel’s window. This is useful if you are monitoring a number of channels and would like to be reminded of the last time you viewed this window.
  • provides advanced completion for accessing windows with a /go command that offers tab completion for all windows, and is even able to complete based on character combinations from the middle of the channel or private message names.
  • colorizes the nicknames of all members of a channel, based on activity and join time, in an effort to make the flow of conversation a bit easier to read.
  • automatically detects if your Irssi session resides within an attached or detached screen session. If your screen session is detached, this plugin will set your status to away. When you reattach to the session, the plugin unsets the away status.
  • collects in one window all channel events like joins, parts, and quits.
  • provides a more useful and configurable window list if you have trouble with the default window list implementation.

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.

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.

See Also

comments powered by Disqus

This guide is published under a CC BY-ND 4.0 license.