-
Notifications
You must be signed in to change notification settings - Fork 3
/
packages.el
59 lines (53 loc) · 1.62 KB
/
packages.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
;;; packages.el --- platformio layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: learts <[email protected]>
;; URL: https://github.com/LeartS/spacemacs-layer-platformio
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst platformio-packages
'(
company
irony
company-irony
irony-eldoc
platformio-mode
))
(defun platformio/init-irony ()
(use-package irony
:defer t
:commands (irony-mode irony-install-server)
:init
(add-hook 'irony-mode-hook
(lambda ()
(define-key irony-mode-map [remap completion-at-point]
'irony-completion-at-point-async)
(define-key irony-mode-map [remap complete-symbol]
'irony-completion-at-point-async)
(irony-cdb-autosetup-compile-options)))
))
(defun platformio/init-company-irony ()
(use-package company-irony
:defer t
:init
(push 'company-irony company-backends-irony-mode)))
(defun platformio/init-irony-eldoc ()
(use-package irony-eldoc
:defer t
:init
(add-hook 'irony-mode-hook 'irony-eldoc)))
(defun platformio/post-init-company ()
(spacemacs|add-company-hook irony-mode))
(defun platformio/init-platformio-mode ()
(use-package platformio-mode
:commands platformio-conditionally-enable
:defer t
:init
(progn
(add-hook 'platformio-mode-hook 'irony-mode)
(add-to-list 'auto-mode-alist '("\\.ino" . c-mode))
(add-hook 'c++-mode-hook 'platformio-conditionally-enable)
(add-hook 'c-mode-hook 'platformio-conditionally-enable))))