From 800b2b1a51c77a328042f47d24e2517266029544 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Sun, 12 Jan 2020 11:46:40 -0500 Subject: Changes from using bison --- emacs/inits/20-programming.el | 26 +++++++++++++++++++++----- emacs/inits/25-theorems.el | 14 +++++++++----- emacs/inits/70-global-keybinds.el | 10 ++++++++-- 3 files changed, 38 insertions(+), 12 deletions(-) (limited to 'emacs/inits') 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? diff --git a/emacs/inits/25-theorems.el b/emacs/inits/25-theorems.el index b72dabc..f5ab26b 100644 --- a/emacs/inits/25-theorems.el +++ b/emacs/inits/25-theorems.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2020-01-06 20:36:12 (tslil@bison)> +;; Time-stamp: <2020-01-08 18:37:56 (tslil@bison)> ;; ----------------------------------------------------------------------------- ;; Coq @@ -50,8 +50,8 @@ (defun mike-implicify (ntimes) (interactive "p") (save-excursion + (re-search-backward "(\\|{") (dotimes (i ntimes) - (re-search-backward "(\\|{") (if (looking-at "(") (progn (delete-char 1) (insert "{") @@ -64,7 +64,9 @@ (backward-char 1) (forward-sexp 1) (delete-char -1) - (insert ")")))))) + (insert ")"))) + (re-search-forward "(\\|{") + (backward-char 1)))) (use-package proof-general :ensure t @@ -81,7 +83,8 @@ (enlarge-window-horizontally (- (+ 7 fill-column) ww))))) (defun coq-local-environment () (require 'corral) - (bind-keys ("M-i" . mike-implicify) + (bind-keys :map coq-mode-map + ("M-i" . mike-implicify) ("M-a" . forward-sexp) ("M-e" . backward-sexp) ("M-/" . lh-matching-delim) @@ -93,7 +96,7 @@ ("M-]" . corral-brackets-backward) ("C-(" . lh-slurp-forward) ("C-)" . lh-slurp-backward) - ("C-s" . isearch-forward-proof-mode-map)) + ("C-s" . isearch-forward)) (let* ((data (alist-get use-coq-env coq-env nil nil #'string-equal)) (topdir (expand-file-name (plist-get data :topdir))) (binary (plist-get data :binary)) @@ -102,6 +105,7 @@ (visit-tags-table (concat topdir "TAGS")) ;; Formatting (setq fill-column 70) + (visual-line-mode 1) (set-fringe-mode 0) (make-local-variable 'before-save-hook) (add-hook 'before-save-hook 'delete-trailing-whitespace) diff --git a/emacs/inits/70-global-keybinds.el b/emacs/inits/70-global-keybinds.el index 92ae2fe..d19ff0d 100644 --- a/emacs/inits/70-global-keybinds.el +++ b/emacs/inits/70-global-keybinds.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2019-08-25 21:44:55 (tslil@basingstoke)> +;; Time-stamp: <2020-01-12 11:40:27 (tslil@bison)> (setq time-stamp-active t time-stamp-line-limit 3 @@ -24,7 +24,13 @@ (global-set-key (kbd "") 'notmuch) (global-set-key (kbd "C-x m") 'eshell) -(global-set-key (kbd "C-c c") 'shell) + +(use-package eterm-256color + :ensure t + :config + (add-hook 'term-mode-hook #'eterm-256color-mode) + (global-set-key (kbd "C-c c") 'ansi-term)) + (global-set-key (kbd "C-x e") 'eval-expression) (global-set-key (kbd "M-i") 'indent-region) -- cgit v1.2.3