2016-02-07 20:01:25 +00:00
|
|
|
#+TITLE: Slack layer
|
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
[[file:img/slack.png]]
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2016-06-10 04:09:42 +00:00
|
|
|
* Table of Contents :TOC_4_gh:noexport:
|
|
|
|
- [[#description][Description]]
|
|
|
|
- [[#install][Install]]
|
|
|
|
- [[#configuration][Configuration]]
|
|
|
|
- [[#key-bindings][Key bindings]]
|
2016-02-07 20:01:25 +00:00
|
|
|
|
|
|
|
* Description
|
2016-06-04 02:15:29 +00:00
|
|
|
This layer provides an interface to the Slack chat service via the emacs-slack
|
|
|
|
package. Where possible, this layer aims to reuse keybindings from the IRC
|
|
|
|
packages in Spacemacs.
|
2016-02-07 20:01:25 +00:00
|
|
|
|
|
|
|
* Install
|
2016-06-04 02:15:29 +00:00
|
|
|
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
|
|
|
add =slack= to the existing =dotspacemacs-configuration-layers= list in this
|
|
|
|
file.
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
* Configuration
|
|
|
|
|
|
|
|
Follow the instructions in the [[https://github.com/yuya373/emacs-slack/blob/master/README.md][emacs-slack]] package for obtaining your client ID,
|
|
|
|
client secret, and token.
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2016-11-14 11:31:25 +00:00
|
|
|
To test that everything is alright put the following snippet in your
|
2016-06-04 02:15:29 +00:00
|
|
|
=dotspacemacs/user-config()= replacing =client-id=, =client-secret= and =token=
|
|
|
|
with your info.
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
*Important* Do not keep private data in your dotfile. You can put your private
|
|
|
|
stuff elsewhere (like Dropbox for instance) and load the file in your dotfile.
|
2016-02-07 20:01:25 +00:00
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(slack-register-team
|
|
|
|
:name "emacs-slack"
|
|
|
|
:default t
|
2016-06-04 02:15:29 +00:00
|
|
|
:client-id "my@email.address"
|
|
|
|
:client-secret "mypassword"
|
2016-02-07 20:01:25 +00:00
|
|
|
:token "token"
|
2016-06-04 02:15:29 +00:00
|
|
|
:subscribed-channels '(general slackbot))
|
2016-02-07 20:01:25 +00:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
* Key bindings
|
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
| Key Binding | Description |
|
|
|
|
|-------------+--------------------------|
|
|
|
|
| ~SPC a C s~ | (Re)connects to Slack |
|
|
|
|
| ~SPC a C j~ | Join a channel |
|
|
|
|
| ~SPC a C d~ | Direct message someone |
|
|
|
|
| ~SPC a C q~ | Close connection |
|
|
|
|
| ~SPC m j~ | Join a channel |
|
|
|
|
| ~SPC m d~ | Direct message someone |
|
|
|
|
| ~SPC m p~ | Load previous messages |
|
|
|
|
| ~SPC m e~ | Edit message at point |
|
|
|
|
| ~SPC m q~ | Quit Slack |
|
|
|
|
| ~SPC m m~ | Embed mention of user |
|
|
|
|
| ~SPC m c~ | Embed mention of channel |
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
The following bindings are provided to mimic bindings in the official Slack
|
|
|
|
client.
|
2016-02-07 20:01:25 +00:00
|
|
|
|
|
|
|
| Key Binding | Description |
|
|
|
|
|-------------+--------------------------|
|
|
|
|
| ~<SPC> m k~ | Join a channel |
|
|
|
|
| ~<SPC> m @~ | Embed mention of user |
|
|
|
|
| ~<SPC> m #~ | Embed mention of channel |
|
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
In insert state, one can also use ~@~ and ~#~ directly without the leader key
|
|
|
|
prefix.
|