("C-c b s" . save-buffer)
("C-c S" . save-buffer)
("C-c o" . other-window)
- ("C-c q q" . save-buffers-kill-terminal))
+ ("C-c q q" . save-buffers-kill-terminal)
+ ("C-c F m" . make-frame-command)
+ ("C-c F d" . delete-frame)
+ ("C-c F D" . delete-other-frames))
#+end_src
** Packages
org-src-preserve-indentation nil
org-edit-src-content-indentation 0
org-log-done 'time)
- :hook (org-mode . org-indent-mode)
+ :hook ((org-mode . org-indent-mode)
+ (org-mode . auto-fill-mode)
+ (org-mode . flyspell-mode))
:custom
(org-latex-packages-alist '(("" "listings") ("" "color"))))
:defer 5
:bind
(:map company-active-map
- ([tab] . company-complete-common-or-cycle))
+ ([tab] . company-complete-common-or-cycle)
+ ([escape] . company-abort))
:custom
(company-idle-delay 0.3)
(company-minimum-prefix-length 1)
;; Only flycheck when I actually save the buffer
(setq flycheck-check-syntax-automatically '(mode-enabled save)))
+
+;; http://endlessparentheses.com/ispell-and-apostrophes.html
+(use-package ispell
+ :config
+ ;; ’ can be part of a word
+ (setq ispell-local-dictionary-alist
+ `((nil "[[:alpha:]]" "[^[:alpha:]]"
+ "['\x2019]" nil ("-B") nil utf-8)))
+ ;; don't send ’ to the subprocess
+ (defun endless/replace-apostrophe (args)
+ (cons (replace-regexp-in-string
+ "’" "'" (car args))
+ (cdr args)))
+ (advice-add #'ispell-send-string :filter-args
+ #'endless/replace-apostrophe)
+
+ ;; convert ' back to ’ from the subprocess
+ (defun endless/replace-quote (args)
+ (if (not (derived-mode-p 'org-mode))
+ args
+ (cons (replace-regexp-in-string
+ "'" "’" (car args))
+ (cdr args))))
+ (advice-add #'ispell-parse-output :filter-args
+ #'endless/replace-quote))
#+end_src
* Programming modes
#+begin_src emacs-lisp
(eval-when-compile (defvar lean-mode-map))
(use-package lean-mode
+ :defer 2
:bind (:map lean-mode-map
- ("S-SPC" . company-complete)))
-#+end_src
+ ("S-SPC" . company-complete))
+ :config
+ (require 'lean-input)
+ (setq default-input-method "Lean"))
+ #+end_src
** Haskell
:mode "\\.nix\\'")
#+end_src
+** Java
+
+*** meghanada
+
+#+begin_src emacs-lisp :tangle yes
+(use-package meghanada
+ :bind
+ (:map meghanada-mode-map
+ (("C-M-o" . meghanada-optimize-import)
+ ("C-M-t" . meghanada-import-all)))
+ :hook (java-mode . meghanada-mode))
+#+end_src
+
+*** lsp-java
+
+#+begin_src emacs-lisp :tangle no
+(use-package treemacs)
+
+(use-package yasnippet
+ :config
+ ;; (yas-global-mode)
+ )
+
+(use-package lsp-mode
+ :init (setq lsp-eldoc-render-all nil
+ lsp-highlight-symbol-at-point nil)
+ )
+
+(use-package hydra)
+
+(use-package company-lsp
+ :after company
+ :config
+ (setq company-lsp-cache-candidates t
+ company-lsp-async t))
+
+(use-package lsp-ui
+ :config
+ (setq lsp-ui-sideline-update-mode 'point))
+
+(use-package lsp-java
+ :config
+ (add-hook 'java-mode-hook
+ (lambda ()
+ (setq-local company-backends (list 'company-lsp))))
+
+ (add-hook 'java-mode-hook 'lsp-java-enable)
+ (add-hook 'java-mode-hook 'flycheck-mode)
+ (add-hook 'java-mode-hook 'company-mode)
+ (add-hook 'java-mode-hook 'lsp-ui-mode))
+
+(use-package dap-mode
+ :after lsp-mode
+ :config
+ (dap-mode t)
+ (dap-ui-mode t))
+
+(use-package dap-java
+ :after (lsp-java))
+
+(use-package lsp-java-treemacs
+ :after (treemacs))
+#+end_src
+
* Emacs Enhancements
** [[https://github.com/justbur/emacs-which-key][which-key]]
(use-package highlight-indent-guides
:demand t
:hook ((prog-mode . highlight-indent-guides-mode)
- (org-mode . highlight-indent-guides-mode))
+ ;; (org-mode . highlight-indent-guides-mode)
+ )
:config
(setq highlight-indent-guides-character ?\|)
(setq highlight-indent-guides-auto-enabled nil)
("C-s" . isearch-forward)
("C-r" . isearch-backward)
("j" . pdf-view-next-line-or-next-page)
- ("j" . pdf-view-previous-line-or-previous-page)))
+ ("k" . pdf-view-previous-line-or-previous-page)))
#+end_src
** anzu
(use-package anzu)
#+end_src
+** typo.el
+
+#+begin_src emacs-lisp
+(use-package typo
+ :config
+ (typo-global-mode 1)
+ :hook (text-mode . typo-mode))
+#+end_src
+
* Email
#+begin_src emacs-lisp
message-sendmail-envelope-from 'header
;; message-directory "drafts"
message-user-fqdn "aminb.org")
+ ;; (add-hook 'message-mode-hook 'electric-quote-local-mode)
(add-hook 'message-mode-hook
(lambda () (setq fill-column 65
message-fill-column 65)))
#+begin_src emacs-lisp
(defun amin/notmuch ()
"Delete other windows, then launch `notmuch'."
- (interactive)
- (delete-other-windows)
+ (interactive
+ (when (equal current-prefix-arg nil)
+ (delete-other-windows)))
(notmuch))
(use-package notmuch