2015-12-02 14:23:39 +00:00
#+TITLE : RCIRC layer
2015-06-10 16:44:30 +00:00
2019-05-02 21:49:30 +00:00
#+TAGS : chat|layer
2015-06-10 16:44:30 +00:00
[[file:img/irc.png ]]
2019-05-07 20:05:06 +00:00
* Table of Contents :TOC_5_gh:noexport:
2017-05-22 14:16:12 +00:00
- [[#description ][Description ]]
2017-08-06 02:14:10 +00:00
- [[#features ][Features: ]]
2017-05-22 14:16:12 +00:00
- [[#install ][Install ]]
- [[#layer ][Layer ]]
2018-04-21 04:55:02 +00:00
- [[#configuring-authentication ][Configuring authentication ]]
2017-05-22 14:16:12 +00:00
- [[#storing-the-credentials-in-your-dotfile ][Storing the credentials in your dotfile ]]
- [[#example ][Example: ]]
- [[#storing-the-credentials-in-your-dropbox ][Storing the credentials in your Dropbox ]]
- [[#example-1 ][Example: ]]
- [[#storing-the-credentials-in-authinfo ][Storing the credentials in authinfo ]]
- [[#connecting-behind-a-znc-bouncer-and-storing-the-credentials-in-authinfo ][Connecting behind a ZNC bouncer and storing the credentials in authinfo ]]
- [[#disclaimer ][Disclaimer ]]
- [[#note ][Note ]]
2018-04-21 04:55:02 +00:00
- [[#enabling-sfoobar ][Enabling =s/foo/bar/= ]]
2018-11-25 23:06:11 +00:00
- [[#enabling-emojify-mode ][Enabling emojify-mode ]]
2018-11-25 23:34:30 +00:00
- [[#enabling-erc-image ][Enabling erc-image ]]
2018-11-25 23:37:32 +00:00
- [[#enabling-erc-tweet ][Enabling erc-tweet ]]
2018-11-25 23:39:47 +00:00
- [[#enabling-erc-yt ][Enabling erc-yt ]]
2018-11-25 23:22:14 +00:00
- [[#enabling-rcirc-styles ][Enabling rcirc-styles ]]
2018-12-05 03:03:03 +00:00
- [[#key-bindings ][Key bindings ]]
2017-05-22 14:16:12 +00:00
- [[#rcirc-documentation ][Rcirc documentation ]]
- [[#spacemacs-layout-support ][Spacemacs Layout Support ]]
2015-06-10 16:44:30 +00:00
* Description
This layer provide support for [[http://www.gnu.org/software/emacs/manual/html_mono/rcirc.html ][rcirc ]] with optional support for authinfo
and ZNC.
2017-08-06 02:14:10 +00:00
** Features:
2015-06-10 16:44:30 +00:00
- Store channel logs into =~/.emacs.d/.cache/rcirc-logs/<channel>=
2016-04-13 03:31:38 +00:00
- Support for credentials stored in =~/.authinfo.gpg= (need to have gnutls)
2015-06-10 16:44:30 +00:00
- Support ZNC support (with optional =~/.authinfo.gpg= )
- Colored nicknames
2018-04-21 04:55:02 +00:00
- Real-time change when people use =s/foo/bar/= in chat
2015-08-18 22:27:49 +00:00
- Completion of Emojis using [[https://github.com/dunn/company-emoji ][company-emoji ]] (still needs a way of showing, either
using the =emoji= layer or having a proper font) :clap:
2016-04-13 03:31:38 +00:00
2015-06-10 16:44:30 +00:00
* Install
** Layer
2016-01-06 05:21:55 +00:00
To use this configuration layer, add it to your =~/.spacemacs= . You will need to
add =rcirc= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-06-10 16:44:30 +00:00
2018-04-21 04:55:02 +00:00
** Configuring authentication
2015-06-10 16:44:30 +00:00
There are several ways to configure rcirc supported by the layer:
2015-06-10 21:16:01 +00:00
- By storing your credentials in =rcirc-server-alist= in your dotfile (not
secured)
- By storing your credentials in =rcirc-server-alist= in your Dropbox (better
but still not secured)
2015-06-10 16:44:30 +00:00
- By storing your credentials in authinfo (secured)
- By using a ZNC bouncer _and_ storing your credentials (secured)
2016-04-13 03:31:38 +00:00
2015-06-10 16:44:30 +00:00
*** Storing the credentials in your dotfile
You can store your servers configuration along with your credentials in the
2015-09-28 06:05:18 +00:00
=dotspacemacs/user-config= of your dotfile.
2015-06-10 16:44:30 +00:00
2015-06-10 21:16:01 +00:00
*Important:* This method is the less secured and it is not recommended since
2015-06-10 16:44:30 +00:00
your dotfile is often stored in a public repository and is not crypted. This
is convenient but not recommended.
2015-06-10 21:16:01 +00:00
**** Example:
2015-06-10 16:44:30 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(setq rcirc-server-alist
'(("irc.freenode.net"
:user-name "spacemacs_user"
:port "1337"
:password "le_passwd"
:channels ("#emacs"))))
2015-06-10 16:44:30 +00:00
#+END_SRC
*** Storing the credentials in your Dropbox
You can store your servers configuration along with your credentials in
your dropbox in the file =~/Dropbox/emacs/pinit-rcirc.el= .
2015-06-10 21:16:01 +00:00
*Important:* This method is more secured since your file is stored in
2015-06-10 16:44:30 +00:00
a private location but it is still not crypted on your drive. Moreover
since Dropbox automatically sync your files you may have a lot of copies
of the file containing your credentials. This is convenient but not
recommended.
2015-06-10 21:16:01 +00:00
**** Example:
2015-06-10 16:44:30 +00:00
#+BEGIN_SRC emacs-lisp
2018-09-19 03:54:47 +00:00
(setq rcirc-server-alist
'(("irc.freenode.net"
:user-name "spacemacs_user"
:port "1337"
:password "le_passwd"
:channels ("#emacs"))))
2015-06-10 16:44:30 +00:00
#+END_SRC
*** Storing the credentials in authinfo
This method is considered secured and is the recommended way to configure
rcirc.
2015-06-10 21:16:01 +00:00
1) If you want to use =authinfo.gpg= you have to enable the support for it by
2018-10-17 04:03:28 +00:00
setting =rcirc-enable-authinfo-support= to =t= in your dotfile:
2016-04-13 03:31:38 +00:00
2018-10-17 04:03:28 +00:00
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-authinfo-support t)))
#+END_SRC
2015-06-10 16:44:30 +00:00
2) In your =~/.authinfo.gpg= file store your credentials like this:
2015-10-30 11:20:58 +00:00
2018-10-17 04:03:28 +00:00
#+BEGIN_EXAMPLE
machine irc.freenode.net port nickserv user <user > password <passwd >
#+END_EXAMPLE
2015-06-10 16:44:30 +00:00
3) At last you need to provide your servers configuration in the
2018-10-17 04:03:28 +00:00
=dotspacemacs/user-config= function of your dotfile:
2015-06-10 16:44:30 +00:00
2018-10-17 04:03:28 +00:00
#+BEGIN_SRC emacs-lisp
(setq rcirc-server-alist
'(("irc.freenode.net"
:user-name "spacemacs_user"
:port "1337"
:channels ("#emacs"))))
#+END_SRC
2015-06-10 16:44:30 +00:00
*** Connecting behind a ZNC bouncer and storing the credentials in authinfo
This methods is also secured since it uses authinfo _but_ you must secure your
ZNC server configuration as well!
ZNC is a popular bouncer which is easy to setup. A bouncer is a proxy that
connects to your IRC channels on your behalf, instead of connecting to the IRC
server you connect to your ZNC server. The ZNC server can store the discussions
in a buffer while you are not connected.
2015-06-10 21:16:01 +00:00
**** Disclaimer
2015-06-10 16:44:30 +00:00
This assumes that you are familiar with ZNC and you have a ZNC server properly
setup. If it is not the case then it is recommended to read about ZNC
[[http://wiki.znc.in/ZNC ][here ]]. There is also an installation guide for Ubuntu [[https://www.digitalocean.com/community/tutorials/how-to-install-znc-an-irc-bouncer-on-an-ubuntu-vps ][here ]].
2015-06-10 21:16:01 +00:00
**** Note
2015-06-10 16:44:30 +00:00
For now authinfo is mandatory to use the ZNC configuration.
1) To enable ZNC support set the variable =rcirc-enable-znc-support= to =t= in
2018-10-17 04:03:28 +00:00
your dotfile:
2015-06-10 16:44:30 +00:00
2018-10-17 04:03:28 +00:00
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-znc-support t)))
#+END_SRC
2015-06-10 16:44:30 +00:00
2) In your =~/.authinfo.gpg= file store your credentials like this:
2015-10-30 11:20:58 +00:00
2018-10-17 04:03:28 +00:00
#+BEGIN_EXAMPLE
machine freenode.spacemacsserver.me port irc user spacemacs_user/freenode password ZNC_PASSWORD
machine geekshed.spacemacsserver.me port irc user spacemacs_user/geekshed password ZNC_PASSWORD
#+END_EXAMPLE
2015-06-10 16:44:30 +00:00
2018-10-17 04:03:28 +00:00
*Important* =port= must be set to =irc= . This is a convention of the layer to
retrieve the credentials for the ZNC configuration.
2015-06-10 16:44:30 +00:00
3) Then setup your servers configuration using subdomains in the
2018-10-17 04:03:28 +00:00
=dotspacemacs/user-config= function of your dotfile. The =:auth= keyword arguments
will be replaced by the credentials stored in your =~/.authinfo.gpg= .
#+BEGIN_SRC emacs-lisp
(setq rcirc-server-alist
;; This will replace :auth with the correct thing, see the doc for that function
'(("freenode"
:host "freenode.spacemacsserver.me"
:port "1337"
:auth "spacemacs_user/freenode"
:channels ("#emacs"))
("geekshed"
:host "geekshed.spacemacsserver.me"
:port "1337"
:auth "spacemacs_user/geekshed"
:channels ("#jupiterbroadcasting"))))
#+END_SRC
2015-06-10 16:44:30 +00:00
2018-04-21 04:55:02 +00:00
** Enabling =s/foo/bar/=
To configure rcirc to update buffers when people use =s/foo/bar/= , set the
variable =rcirc-enable-late-fix= to =t= in your dotfile:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-late-fix t)))
#+END_SRC
2018-11-25 23:06:11 +00:00
** Enabling emojify-mode
To enable emojify-mode in rcirc buffers, set the variable =rcirc-enable-emojify=
to =t= in your dotfile:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-emojify t)))
#+END_SRC
2018-11-25 23:34:30 +00:00
** Enabling erc-image
To enable erc-image for fetching and showing images when they are linked to in
chat, set the variable =rcirc-enable-erc-image= to =t= in your dotfile:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-erc-image t)))
#+END_SRC
2018-11-25 23:37:32 +00:00
** Enabling erc-tweet
To enable erc-tweet for fetching and displaying tweets when they are linked in
chat, set the variable =rcirc-enable-erc-tweet= to =t= in your dotfile:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-erc-tweet t)))
#+END_SRC
2018-11-25 23:39:47 +00:00
** Enabling erc-yt
To enable erc-yt for fetching and displaying previews for YouTube links in chat,
set the variable =rcirc-enable-erc-yt= to =t= in your dotfile:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-erc-yt t)))
#+END_SRC
2018-11-25 23:22:14 +00:00
** Enabling rcirc-styles
To enable rcirc-styles for displaying and inserting color and text attribute
codes, set the variable =rcirc-enable-styles= to =t= in your dotfile:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-styles t)))
#+END_SRC
2018-12-05 03:03:03 +00:00
* Key bindings
2015-06-10 16:44:30 +00:00
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2015-06-10 16:44:30 +00:00
|-------------+-------------------------------------------------------------------------------|
| ~SPC a i r~ | Open rcirc |
2019-05-26 20:58:52 +00:00
| ~SPC l o i~ | Open rcirc in a custom perspective "@RICRC" (need perspectives layer enabled) |
2018-11-25 23:22:14 +00:00
| ~SPC m i a~ | Interactively insert a color code (if rcirc-styles is enabled) |
| ~SPC m i c~ | Interactively insert a text attribute code (if rcirc-styles is enabled) |
| ~SPC m i p~ | Toggle preview in input line (if rcirc-styles is enabled) |
2015-06-10 16:44:30 +00:00
In normal state:
2018-12-05 03:03:03 +00:00
| Key binding | Description |
2015-06-10 16:44:30 +00:00
|-------------+--------------------------|
| ~C-j~ | next item in history |
| ~C-k~ | previous item in history |
* Rcirc documentation
2016-04-13 03:31:38 +00:00
The rcirc documentation can be found [[http://www.gnu.org/software/emacs/manual/html_mono/rcirc.html ][here ]].
2016-01-25 04:28:10 +00:00
* Spacemacs Layout Support
RCIRC buffers are added automatically to the default layout for RCIRC controlled by
2019-05-26 20:58:52 +00:00
the variable =rcirc-spacemacs-layout-name= (defaults to "@RCIRC") and the default
binding ("i") is controlled by =rcirc-spacemacs-layout-binding=