A lot of Unix philosophy with the ii
16 Feb 2014Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.
It seems like there is no good IRC plugin for vim - I found none of them at least. But there is a brilliant geeky alternative - ii. Here is a quote from its site:
ii is a minimalist FIFO and filesystem-based IRC client. It creates an irc directory tree with server, channel and nick name directories. In every directory a FIFO in file and a normal out file is created.
The in file is used to communicate with the servers and the out files contain the server messages. For every channel and every nick name there are related in and out files created. This allows IRC communication from command line and adheres to the Unix philosophy.
To configure the IRC workflow (join, identify, read/write) you can use these posts. Here I want to help you avoid several caveats.
First of all, there is the final result you’ll get:
I’ll use tmux + multitail + vim.
First we need to connect to an IRC server (freenode.net
in my case):
Next step is to create handy console-based environment to use it. A small bash script can be used for this purpose (I’ve split the implementation):
We should use -2
option for tmux
to force 256 colors, and -cS ii
option for multitail
to ii syntax highlighting. After all this we can execute ./tmux_open.sh channel
command to open a two pane, that will contain IRC channel log and vim ifself.
To type in IRC session we will use vim
with the following mappings:
Also, we can hide tmux status line globally (I prefer a vim status line) to achieve an ideal:
or hide it only with the vim