2016-02-07 20:01:25 +00:00
|
|
|
;;; packages.el --- slack layer packages file for Spacemacs.
|
|
|
|
;;
|
2020-06-27 20:55:36 +00:00
|
|
|
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
|
2016-02-07 20:01:25 +00:00
|
|
|
;;
|
|
|
|
;; Author: Kosta Harlan <kosta@kostaharlan.net>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
;; TODO: Integrate company-emoji.
|
|
|
|
|
2016-02-07 20:01:25 +00:00
|
|
|
(defconst slack-packages
|
|
|
|
'(
|
|
|
|
alert
|
|
|
|
emoji-cheat-sheet-plus
|
2016-06-04 02:15:29 +00:00
|
|
|
flyspell
|
|
|
|
linum
|
2016-02-07 20:01:25 +00:00
|
|
|
persp-mode
|
2016-06-04 02:15:29 +00:00
|
|
|
slack
|
2020-06-27 20:55:36 +00:00
|
|
|
window-purpose))
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
(defun slack/init-alert ()
|
|
|
|
(use-package alert
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-06-04 02:15:29 +00:00
|
|
|
:init (setq alert-default-style 'notifier)))
|
2016-02-07 20:01:25 +00:00
|
|
|
|
|
|
|
(defun slack/post-init-emoji-cheat-sheet-plus ()
|
|
|
|
(add-hook 'slack-mode-hook 'emoji-cheat-sheet-plus-display-mode))
|
|
|
|
|
|
|
|
(defun slack/post-init-flyspell ()
|
|
|
|
(add-hook 'lui-mode-hook 'flyspell-mode))
|
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
(defun slack/post-init-linum ()
|
2016-10-09 16:57:46 +00:00
|
|
|
(add-hook 'slack-mode-hook 'spacemacs/no-linum))
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2018-01-10 04:01:34 +00:00
|
|
|
(defun slack/pre-init-persp-mode ()
|
2016-02-07 20:01:25 +00:00
|
|
|
(spacemacs|use-package-add-hook persp-mode
|
|
|
|
:post-config
|
2018-01-10 04:01:34 +00:00
|
|
|
(progn
|
|
|
|
(add-to-list 'persp-filter-save-buffers-functions
|
|
|
|
'spacemacs//slack-persp-filter-save-buffers-function)
|
|
|
|
(spacemacs|define-custom-layout slack-spacemacs-layout-name
|
|
|
|
:binding slack-spacemacs-layout-binding
|
|
|
|
:body
|
|
|
|
(progn
|
|
|
|
(add-hook 'slack-mode #'spacemacs//slack-buffer-to-persp)
|
|
|
|
;; TODO: We don't want to slack-start every time someone types `SPC l o s`
|
|
|
|
(call-interactively 'slack-start)
|
|
|
|
(call-interactively 'slack-channel-select))))))
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2016-06-04 02:15:29 +00:00
|
|
|
(defun slack/init-slack ()
|
|
|
|
"Initialize Slack"
|
|
|
|
(use-package slack
|
|
|
|
:commands (slack-start)
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-06-04 02:15:29 +00:00
|
|
|
:init
|
2020-06-28 21:25:04 +00:00
|
|
|
(spacemacs/declare-prefix "acs" "slack")
|
2020-02-25 22:30:47 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2020-06-28 21:25:04 +00:00
|
|
|
"acss" 'slack-start
|
|
|
|
"acsj" 'slack-channel-select
|
|
|
|
"acsg" 'slack-group-select
|
|
|
|
"acsr" 'slack-select-rooms
|
|
|
|
"acsd" 'slack-im-select
|
|
|
|
"acsq" 'slack-ws-close)
|
2020-02-25 22:30:47 +00:00
|
|
|
(setq slack-enable-emoji t)
|
2016-06-04 02:15:29 +00:00
|
|
|
:config
|
2020-02-25 22:30:47 +00:00
|
|
|
(dolist (mode '(slack-mode slack-message-buffer-mode))
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode mode
|
2016-06-04 02:15:29 +00:00
|
|
|
"j" 'slack-channel-select
|
2017-04-21 20:51:14 +00:00
|
|
|
"g" 'slack-group-select
|
|
|
|
"r" 'slack-select-rooms
|
2016-06-04 02:15:29 +00:00
|
|
|
"d" 'slack-im-select
|
|
|
|
"p" 'slack-room-load-prev-messages
|
|
|
|
"e" 'slack-message-edit
|
2017-06-08 19:20:26 +00:00
|
|
|
"t" 'slack-thread-show-or-create
|
2016-06-04 02:15:29 +00:00
|
|
|
"q" 'slack-ws-close
|
|
|
|
"mm" 'slack-message-embed-mention
|
|
|
|
"mc" 'slack-message-embed-channel
|
2017-04-21 20:51:14 +00:00
|
|
|
"k" 'slack-select-rooms
|
2016-06-04 02:15:29 +00:00
|
|
|
"@" 'slack-message-embed-mention
|
2017-05-26 18:41:12 +00:00
|
|
|
"#" 'slack-message-embed-channel
|
2017-06-02 21:43:00 +00:00
|
|
|
")" 'slack-message-add-reaction
|
2020-02-25 22:30:47 +00:00
|
|
|
"(" 'slack-message-remove-reaction))
|
|
|
|
(evil-define-key 'insert slack-mode-map
|
|
|
|
(kbd "@") 'slack-message-embed-mention
|
|
|
|
(kbd "#") 'slack-message-embed-channel)))
|
2016-02-07 20:01:25 +00:00
|
|
|
|
2020-06-27 20:55:36 +00:00
|
|
|
(defun slack/post-init-window-purpose ()
|
|
|
|
(purpose-set-extension-configuration
|
|
|
|
:slack-layer
|
|
|
|
(purpose-conf :mode-purposes '((slack-mode . chat)))))
|