diff options
-rw-r--r-- | init.el | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/init.el b/init.el index a46c475..bee4ca9 100644 --- a/init.el +++ b/init.el | |||
@@ -173,7 +173,10 @@ | |||
173 | disabled-command-function nil | 173 | disabled-command-function nil |
174 | load-prefer-newer t | 174 | load-prefer-newer t |
175 | comp-async-report-warnings-errors nil | 175 | comp-async-report-warnings-errors nil |
176 | frame-title-format '("%b %+%* GNU Emacs" | 176 | frame-title-format '((:eval (if-let ((bn buffer-file-name)) |
177 | (abbreviate-file-name bn) | ||
178 | "%b")) | ||
179 | " %+%* GNU Emacs" | ||
177 | (:eval (when (frame-parameter | 180 | (:eval (when (frame-parameter |
178 | nil 'client) | 181 | nil 'client) |
179 | " Client"))) | 182 | " Client"))) |
@@ -321,17 +324,23 @@ | |||
321 | eldoc-echo-area-use-multiline-p nil)) | 324 | eldoc-echo-area-use-multiline-p nil)) |
322 | 325 | ||
323 | (setup flyspell | 326 | (setup flyspell |
324 | (:option ispell-program-name "hunspell" | 327 | (setq-default ispell-program-name "hunspell" |
325 | ispell-dictionary "en_US" | 328 | ispell-dictionary "en_US" |
326 | ispell-personal-dictionary "~/.hunspell_personal") | 329 | ispell-personal-dictionary "~/.hunspell_personal") |
327 | (:needs ispell-program-name) ; don't proceed if not installed | 330 | (:needs ispell-program-name) ; don't proceed if not installed |
328 | 331 | ||
329 | (ispell-set-spellchecker-params) | ||
330 | (unless (file-exists-p ispell-personal-dictionary) | 332 | (unless (file-exists-p ispell-personal-dictionary) |
331 | (write-region "" nil ispell-personal-dictionary nil 0)) | 333 | (write-region "" nil ispell-personal-dictionary nil 0)) |
332 | 334 | ||
333 | (add-hook 'text-mode-hook #'flyspell-mode) | 335 | (defun flyspell-start () |
334 | (add-hook 'prog-mode-hook #'flyspell-prog-mode)) | 336 | "Start `flyspell-mode' or `flyspell-prog-mode', depending on current mode." |
337 | (interactive) | ||
338 | (cond ((derived-mode-p 'text-mode) | ||
339 | (flyspell-mode)) | ||
340 | ((derived-mode-p 'prog-mode) | ||
341 | (flyspell-prog-mode)) | ||
342 | (t (message "Non-text or -prog mode. Run `flyspell-mode'.")))) | ||
343 | (:leader "s" flyspell-start)) | ||
335 | 344 | ||
336 | (setup scratch | 345 | (setup scratch |
337 | (hook-defun immortal-scratch kill-buffer-query-functions | 346 | (hook-defun immortal-scratch kill-buffer-query-functions |
@@ -394,13 +403,13 @@ | |||
394 | ediff-split-window-function 'split-window-horizontally)) | 403 | ediff-split-window-function 'split-window-horizontally)) |
395 | 404 | ||
396 | (setup browse-url | 405 | (setup browse-url |
397 | (:option browse-url-browser-function 'eww-browse-url | 406 | (setq-default browse-url-browser-function 'eww-browse-url |
398 | browse-url-secondary-browser-function | 407 | browse-url-secondary-browser-function |
399 | (if (executable-find "firefox") | 408 | (if (executable-find "firefox") |
400 | 'browse-url-firefox | 409 | 'browse-url-firefox |
401 | 'browse-url-default-browser) | 410 | 'browse-url-default-browser) |
402 | browse-url-new-window-flag t | 411 | browse-url-new-window-flag t |
403 | browse-url-firefox-new-window-is-tab t) | 412 | browse-url-firefox-new-window-is-tab t) |
404 | (when (eq acdw/system :work) | 413 | (when (eq acdw/system :work) |
405 | (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox"))) | 414 | (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox"))) |
406 | 415 | ||
@@ -439,17 +448,17 @@ | |||
439 | (:mode "\\.\\(gemini\\|gmi\\)\\'")) | 448 | (:mode "\\.\\(gemini\\|gmi\\)\\'")) |
440 | 449 | ||
441 | (setup dired | 450 | (setup dired |
442 | (:option dired-recursive-copies 'always | 451 | (setq-default dired-recursive-copies 'always |
443 | dired-recursive-deletes 'always | 452 | dired-recursive-deletes 'always |
444 | delete-by-moving-to-trash t | 453 | delete-by-moving-to-trash t |
445 | dired-listing-switches "-Al" | 454 | dired-listing-switches "-Al" |
446 | ls-lisp-dirs-first t | 455 | ls-lisp-dirs-first t |
447 | dired-ls-F-marks-symlinks t | 456 | dired-ls-F-marks-symlinks t |
448 | dired-no-confirm '(byte-compile | 457 | dired-no-confirm '(byte-compile |
449 | chgrp chmod chown copy | 458 | chgrp chmod chown copy |
450 | hardlink load move | 459 | hardlink load move |
451 | shell touch symlink) | 460 | shell touch symlink) |
452 | dired-dwim-target t) | 461 | dired-dwim-target t) |
453 | (:also-load dired-x) | 462 | (:also-load dired-x) |
454 | (:hook dired-hide-details-mode | 463 | (:hook dired-hide-details-mode |
455 | hl-line-mode) | 464 | hl-line-mode) |
@@ -466,7 +475,7 @@ | |||
466 | (:hook-into dired-mode)) | 475 | (:hook-into dired-mode)) |
467 | 476 | ||
468 | (setup (:straight trashed) | 477 | (setup (:straight trashed) |
469 | (:option trashed-action-confirmer 'y-or-n-p)))) | 478 | (setq-default trashed-action-confirmer 'y-or-n-p)))) |
470 | 479 | ||
471 | (setup (:straight magit) | 480 | (setup (:straight magit) |
472 | (:leader "g" magit-status) | 481 | (:leader "g" magit-status) |
@@ -733,9 +742,7 @@ if ripgrep is installed, otherwise `consult-grep'." | |||
733 | 742 | ||
734 | (:global "M-/" company-complete) | 743 | (:global "M-/" company-complete) |
735 | (:with-map company-active-map | 744 | (:with-map company-active-map |
736 | (:bind "C-n" company-select-next | 745 | (:bind "C-d" company-show-doc-buffer |
737 | "C-p" company-select-previous | ||
738 | "C-d" company-show-doc-buffer | ||
739 | "M-." company-show-location))) | 746 | "M-." company-show-location))) |
740 | 747 | ||
741 | ;;; Lisps | 748 | ;;; Lisps |