Thin integration layer over Irc it (ii) to do irc in vim.
Prerequisites:
- GNU/Linux -- I doubt it would work on Windows, haven't tested OSX.
ii
suckless irc clienttail
commandvim9
compiled ashuge
$ git clone https://git.suckless.org/ii
Edit Makefile
if you want to have a different PREFIX
(I have PREFIX=$(HOME)/.local
).
$ cd ii
$ make
$ make install
ii
should be installed into PREFIX
dir. Make sure it is in PATH
.
$ ii -s irc.libera.chat -p 6667 -n mynickname & $ cd ~/irc/irc.libera.chat $ echo "/j nickserv identify mynickname password" > in
Change mynickname
and password
to your own.
The ~/irc/irc.libera.chat
directories will be created by ii
automatically.
Now when ii is up and running, connected to libera.chat, in vim do:
:IIJoin irc.libera.chat #vim
to join #vim
channel.
Now you are able to send and recieve messages.
Treat the windows as you normally do in Vim.
For example C-w H
to make the current window split, a vertical split.
See :h windows
for more information.
#!/usr/bin/env sh
# https://github.com/c00kiemon5ter/iii/blob/master/connect.sh
: "${ircdir:=$HOME/irc}"
: "${nick:=$USER}"
# server info functions
libera() {
server='irc.libera.chat'
channels="#vim #emacs #perl #python"
}
# these match the functions above
networks="libera"
for network in $networks; do
unset server channels port
"$network" # set the appropriate vars
while true; do
# cleanup
rm -f "$ircdir/$server/in"
# connect to network -- password is set through the env var synonym to the network name
ii -i "$ircdir" -n "$nick" -k "$network" -s "$server" -p "${port:-6667}" &
pid="$!"
# wait for the connection
while ! test -p "$ircdir/$server/in"; do sleep .3; done
# auth to services either using plain password stored in ident file
# or using pass
if [ -e "$ircdir/$server/ident" ]
then printf "/j nickserv identify %s\n" "$(cat "$ircdir/$server/ident")" > "$ircdir/$server/in"
else
printf "/j nickserv identify %s\n" "$(pass libera)" > "$ircdir/$server/in"
fi && rm -f "$ircdir/$server/nickserv/out" # clean that up - ident passwd is in there
# join channels
printf "/j %s\n" $channels > "$ircdir/$server/in"
# if connection is lost reconnect
wait "$pid"
done &
done
vim9script
def Irc()
exe "IIJoin irc.libera.chat #vim"
wincmd o
exe "IIJoin irc.libera.chat #python"
wincmd L
exe "IIJoin irc.libera.chat #perl"
wincmd h
exe "IIJoin irc.libera.chat #emacs"
enddef
command! Irc Irc()