diff options
| author | tslil clingman <> | 2019-12-09 09:21:21 -0500 |
|---|---|---|
| committer | tslil clingman <> | 2019-12-09 09:21:21 -0500 |
| commit | 29744f4ade9e94f55d6deb4de72498ee537f87b1 (patch) | |
| tree | 80dfc6369fbdbf7e64f87f570a7acb4c7f1ac9ed /emacs/inits/20-programming.el | |
| parent | 0de26bf98f8ce2360c5e0614909ab349c8393eb8 (diff) | |
nodemcu tweaks
Diffstat (limited to 'emacs/inits/20-programming.el')
| -rw-r--r-- | emacs/inits/20-programming.el | 21 |
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? |
