From 55bff4f14933b1f77d527b20d50c1a1272ff3333 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 10 Oct 2023 02:50:48 -0700 Subject: [PATCH] Add a bunch of spelling stuff --- init.el | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/init.el b/init.el index e1ba194..6f91657 100644 --- a/init.el +++ b/init.el @@ -41,7 +41,9 @@ ;; basic stuff (use-package emacs :hook ((emacs-lisp-mode . my/-emacs-lisp-mode-setup-evil-lookup) - (prog-mode . electric-pair-local-mode)) + (prog-mode . electric-pair-local-mode) + ((text-mode message-mode tex-mode) . flyspell-mode) + (prog-mode . flyspell-prog-mode)) :init (defun my/-emacs-lisp-mode-setup-evil-lookup () (setq-local evil-lookup-func @@ -57,6 +59,12 @@ ;; Terminal mouse support (xterm-mouse-mode 1) + ;; Spell stuff + (setq ispell-program-name "hunspell" + flyspell-issue-message-flag nil + flyspell-issue-welcome-flag nil) + + ;; Better scrolling (setq mouse-scroll-delay 0 scroll-conservatively 10 @@ -343,8 +351,8 @@ visual states." ;; cape (a bunch of capfs!) (use-package cape - :bind (("M-p" . cape-dabbrev) - ("M-P" . cape-line)) + :bind (("C-c p" . cape-dabbrev) + ("C-c P" . cape-line)) :hook (text-mode . my/-cape-setup-text-mode) :init (defun my/-cape-setup-text-mode () @@ -445,18 +453,25 @@ visual states." my/project-vterm-hash-table)))) (defvar my/project-run-command nil "Command to run with `my/project-run'.") + (defvar my/project-run-dir nil + "Directory to run project in with `my/project-run'.") (defvar my/-project-run-history '() "Commands previously run with `my/project-run'") + (defun my/project-get-root-dir () + "Get the root dir for the current project" + (let ((proj (project-current nil))) + (or my/project-run-dir + (if proj (project-root proj) default-directory)))) (defun my/project-run (command comint) "Like `project-compile', but for running a project. COMMAND and COMINT are like `compile'." (interactive (list (or my/project-run-command - (read-shell-command "Run Command: " - (car my/-project-run-history) - '(my/-project-run-history . 1))) + (let ((default-directory (my/project-get-root-dir))) + (read-shell-command "Run Command: " + (car my/-project-run-history) + '(my/-project-run-history . 1)))) (consp current-prefix-arg))) - (let* ((proj (project-current nil)) - (default-directory (if proj (project-root proj) default-directory)) + (let* ((default-directory (my/project-get-root-dir)) (compilation-buffer-name-function (lambda (_) (progn "*run project*"))) (compilation-directory default-directory)