Skip to content

Latest commit

 

History

History
95 lines (78 loc) · 3.67 KB

README.org

File metadata and controls

95 lines (78 loc) · 3.67 KB

Slack layer

img/slack.png

Table of Contents

Description

This layer provides an interface to the Slack chat service via the emacs-slack package. Where possible, this layer aims to reuse key bindings from the IRC packages in Spacemacs.

Features:

Install

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.

Configuration

Follow the instructions in the emacs-slack package for obtaining your client ID, client secret, and token.

To test that everything is alright put the following snippet in your dotspacemacs/user-config() replacing client-id, client-secret and token with your info.

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.

(slack-register-team
  :name "emacs-slack"
  :default t
  :client-id "[email protected]"
  :client-secret "mypassword"
  :token "token"
  :subscribed-channels '(general slackbot))

Spacemacs layout integration

A Spacemacs custom layout is defined by the layer. The name and the key binding for it can be customized with the following layer variables:

  • slack-spacemacs-layout-name for the layout name,
  • slack-spacemacs-layout-binding for the key binding.

By default the values are:

(setq-default dotspacemacs-configuration-layers '(
  (slack :variables slack-spacemacs-layout-name "@Slack"
                    slack-spacemacs-layout-binding "s")))

Key bindings

Key bindingDescription
SPC a C dDirect message someone
SPC a C gJoin a group (private channel)
SPC a C jJoin a channel
SPC a C qClose connection
SPC a C rJoin a channel, group, or direct messge
SPC a C s(Re)connects to Slack
SPC m cEmbed mention of channel
SPC m eEdit message at point
SPC m jJoin a channel
SPC m dDirect message someone
SPC m mEmbed mention of user
SPC m pLoad previous messages
SPC m )Add reaction (emoji) to a message
SPC m (Remove reaction (emoji) to a message
SPC m tShow or create thread
SPC m qQuit Slack

The following bindings are provided to mimic bindings in the official Slack client.

Key bindingDescription
SPC m @Embed mention of user
SPC m #Embed mention of channel
SPC m )Add a rection
SPC m kJoin a channel

In insert state, one can also use @ and # directly without the leader key prefix.