74fdbb6795
Enabling a company backend for a specific mode was a tedious tasks with code scattered at different locations, one for local variable definitions, one for company hook function definitions and another where the backends were pushed to the local variables (which was problematic, since we ended up pushing the same backends over and over again with `SPC f e R`, pushes have been replaced by add-to-list calls in the new macro). All these steps are now put together at one place with the new macro spacemacs|add-company-backends, check its docstring for more info on its arguments. This macro also allows to define arbitrary buffer local variables to tune company for specific modes (similar to layer variables via a keyword :variables) The code related to company backends management has been moved to the auto-completion layer in the funcs.el file. A nice side effect of this move is that it enforces correct encapsulation of company backends related code. We can now easily detect if there is some configuration leakage when the auto-completion layer is not used. But we loose macro expansion at file loading time (not sue it is a big concern though). The function spacemacs|enable-auto-complete was never used so it has been deleted which led to the deletion of the now empty file core-auto-completion.el. The example in LAYERS.org regarding auto-completion is now out of date and has been deleted. An example to setup auto-completion is provided in the README.org file of the auto-completion layer. |
||
---|---|---|
.. | ||
local | ||
config.el | ||
funcs.el | ||
packages.el | ||
README.org |
ERC layer
Description
Layer for ERC IRC chat.
Features
- Highlight nicks (using erc-hl-nicks)
- Image inline support (using erc-image)
- Logging to
~/.emacs.d/.cache/erc-logs
andViewLogMode
for viewing logs (using erc-view-log) - YouTube videos Thumbnails inline (using erc-yt)
- Social Graph for ERC messages (using erc-social-graph)
- Optional SASL authentication via the variable
erc-enable-sasl-auth
(using erc-sasl) - Completion of Emojis using company-emoji (still needs a way of showing, either
using the
emoji
layer or having a proper font) 👏
Install
Layer
To use this configuration layer, add it to your ~/.spacemacs
. You will need to
add erc
to the existing dotspacemacs-configuration-layers
list in this
file.
OS X
It's recommended to install the terminal-notifier gem so that you get notifications via the OS X Notification Center.
Social graph
erc-social-graph needs graphviz to be installed on your system.
Default servers
You can define the default servers in the ERC custom layout by setting the
variable erc-server-list
. Setting :ssl
non nil will connect with erc-tls
.
You can also use <leader>aiD
to connect to your default servers outside the
custom layout.
(setq-default dotspacemacs-configuration-layers
'((erc :variables
erc-server-list
'(("irc.freenode.net"
:port "6697"
:ssl t
:nick "some-user"
:password "secret")
("irc.myworkirc.net"
:port "1234"
:nick "some-suit"
:password "hunter2")))))
Security Note
You should not store your passwords in the clear in your .spacemacs
, and that
goes double if you version your config file. ERC allows for a number of ways of
protecting this information.
First, ERC will check your ~/.authinfo.gpg
, looking for lines like
machine <irc.server.url> login <yournick> password <yourpassword> port <portnumber>
You can omit :password
in this case.
You could also set an environment variable (or otherwise secret variable) and
read that in :password
.
Key bindings
Key Binding | Description |
---|---|
SPC a i e |
Starts ERC |
SPC a i E |
Starts ERC via TLS/SSL |
SPC a i i |
Switch to next active ERC buffer |
SPC a i D |
Start ERC with default servers |
SPC m b |
Switch between ERC buffers |
SPC m d |
Interactively input a user action and send it to IRC. |
SPC m D |
Draw Social Graph using erc-social-graph |
SPC m j |
Join a channel, executes the /join command |
SPC m n |
Run "/names #channel" in the current channel. |
SPC m l |
Run the /list command |
SPC m p |
Part from the channel |
SPC m q |
Quit server |
Note: If you want to connect securely to an IRC server, you must run erc-tls
command on SPC a i E
instead of the erc
command.
Spacemacs Layout Support
ERC buffers are added automatically to the default layout for ERC controlled by
the variable erc-spacemacs-layout-name
(defaults to "@ERC") and the default
binding ("E") is controlled by erc-spacemacs-layout-binding