summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/inits/20-programming.el21
1 files changed, 18 insertions, 3 deletions
diff --git a/emacs/inits/20-programming.el b/emacs/inits/20-programming.el
index c75d2c3..5bf5cb5 100644
--- a/emacs/inits/20-programming.el
+++ b/emacs/inits/20-programming.el
@@ -1,4 +1,4 @@
-;; Time-stamp: <2019-11-09 11:36:50 (tslil@basingstoke)>
+;; Time-stamp: <2019-12-08 23:27:56 (tslil@bison)>
;; -----------------------------------------------------------------------------
;; General setup
@@ -79,7 +79,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
@@ -89,12 +102,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?