Configure ERC and ZNC.el with znc on spacemacs

Posted on Fri 25 March 2016 in spacemacs

Introduction and goal of today

Spacemacs is my default editor since 7 days and I am really satisfied, so far. I use it for python and elixir currently. I am also taking notes and I discovered the deft layer which fits my needs in note taking. Lately I am also hanging around on the gitter (it has an IRC bridge on https://irc.gitter.im) and the freenode (irc.freenode.net) network

spacemacs is emacs for newbies like me ;) And I know you can do everything in emacs, so I thought:

Why to not set-up an irc client on emacs/spacemacs that connects to a znc bouncer to not lose conversations in irc or gitter? (whew, such an original idea!)

NOTE: I am not covering how to configure znc. Basically you have just to execute znc --makeconf and follow the znc flow ;)

That is where ERC kicks in

ERC is a *comfortable* IRC client in emacs. To have it activate is really simple as:

  • Adding an erc layer to your dotspacemacs-configuration-layers

  • Execute it with SPC a i E (for encrypted mode).

  • Follow the prompts from ERC and be sure to choose port 6697 (the encrypted one)

You can connect to irc.gitter.im grab your token if you want to connect to gitter. (It's the token that you use as a password)

ZNC kicks in too

The way I was able to connect was to add in dotspacemacs-additional-packages znc as a package. I am still not comfortable in creating spacemacs layers, so I am keeping all the additional packages here Reload your spacemacs configuration as usual with SPC f e R and you should have it.

Then you should be able to do M-x customize-group and then type znc to configure znc. The part that has to be customized is ZNC Servers. It should be pretty self-explanatory the interface of this buffer. Just click on the arrow to expand the following menu and operate! ;)

Connecting to znc from ERC finally!

After the set-up of ZNC.el with M-x customize-group you can just type everytime you want to connect just M-x znc-erc or M-x znc-all if you want to connect yo all the networks.

You might get a request to re-enter the password, however I still do not know how to automate fully the connection

That's it! (as usual)

Bonus: emojis

  • Add to your dotspacemacs-configuration-layers emoji

  • Add to your dotspacemacs-additional-packages company-emoji

  • Add to your dotspacemacs/user-config (setq emoji-cheat-sheet-plus-display-mode t)

  • SPC f e R and you should be good!

Emoji support in ERC with autocompletion and display of the emoji!

HINT: do not forget the awesome SPC a i i combo, it cycles through all the chat buffers and returns to the source code or document that you were working on!