summaryrefslogtreecommitdiff
path: root/emacs/inits/20-programming.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/inits/20-programming.el')
-rw-r--r--emacs/inits/20-programming.el26
1 files changed, 21 insertions, 5 deletions
diff --git a/emacs/inits/20-programming.el b/emacs/inits/20-programming.el
index e4a6227..f48d419 100644
--- a/emacs/inits/20-programming.el
+++ b/emacs/inits/20-programming.el
@@ -1,4 +1,4 @@
-;; Time-stamp: <2019-12-08 13:25:35 (tslil@basingstoke)>
+;; Time-stamp: <2020-01-12 11:46:11 (tslil@bison)>
;; -----------------------------------------------------------------------------
;; General setup
@@ -17,7 +17,7 @@
(defun programming-setup ()
(subword-mode 1)
- (electric-pair-mode 1)
+ (electric-pair-local-mode)
;; Emacs25 compat
(if (fboundp 'display-line-numbers-mode)
(display-line-numbers-mode)
@@ -36,7 +36,8 @@
(use-package comment-dwim-2
:ensure t
- :bind (("M-;" . comment-dwim-2)))
+ :bind (("M-;" . comment-dwim-2))
+ :config (setq comment-multi-line t))
(use-package aggressive-indent
:ensure t
@@ -86,7 +87,20 @@
:config
(setq nodemcu-default-keybindings t
nodemcu-port "/dev/ttyUSB0"
- nodemcu-backend "nodemcu-uploader"))
+ nodemcu-backend "nodemcu-uploader")
+
+ (defun nodemcu-better-upload-current-file (&optional noreset)
+ (interactive "P")
+ (let ((proc (get-process "nodemcu-terminal")))
+ (when proc
+ (delete-process proc))
+ (shell-command
+ (nodemcu--get-command "upload" (file-name-nondirectory (buffer-file-name))))
+ (unless noreset
+ (shell-command
+ (nodemcu--get-command "node restart"))
+ (when proc
+ (nodemcu-terminal))))))
(use-package lua-mode
:after nodemcu-mode
@@ -96,12 +110,14 @@
("C-x C-e" . lua-send-current-line)
("C-c C-d" . lua-send-defun)
("C-c C-e" . lua-send-region)
+ ("C-c C-u" . nodemcu-better-upload-current-file)
+ ("C-c C-t" . nodemcu-terminal)
("M-n" . lua-forward-sexp)
("M-p" . lua-backwards-to-block-begin-or-end))
:hook (lua-mode . (lambda ()
(require 'nodemcu-mode)
(use-package company-lua :ensure t :demand)
- (nodemcu-mode)
+ (nodemcu-mode 1)
(add-to-list 'company-backends 'company-lua))))
;; What are these?