X-Git-Url: https://git.shemshak.org/gitweb.cgi/~bandali/configs/blobdiff_plain/2e7aa30f7e46eabf984adc1018d7ccbdfefecca8..a4aa1167bdf5b1fe79be5c6e6bce5d2b3be8c708:/init.org diff --git a/init.org b/init.org index 3448670..4bd4458 100644 --- a/init.org +++ b/init.org @@ -718,7 +718,8 @@ In short, my favourite way of life. (use-package org-notmuch :after (:any org notmuch)) -(use-package orgalist) +(use-package orgalist + :hook (message-mode . orgalist-mode)) #+end_src **** asynchronous tangle @@ -1065,7 +1066,8 @@ TODO: break this giant source block down into individual org sections. :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) @@ -1377,6 +1379,70 @@ instead. :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]] @@ -1529,7 +1595,8 @@ Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]]. (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) @@ -1544,13 +1611,17 @@ Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]]. #+begin_src emacs-lisp (use-package pdf-tools :magic ("%PDF" . pdf-view-mode) - :config (pdf-tools-install) + :config + (setq pdf-view-resize-factor 1.05) + (pdf-tools-install) :bind (:map pdf-view-mode-map ("C-s" . isearch-forward) ("C-r" . isearch-backward) ("j" . pdf-view-next-line-or-next-page) - ("k" . pdf-view-previous-line-or-previous-page))) + ("k" . pdf-view-previous-line-or-previous-page) + ("h" . image-backward-hscroll) + ("l" . image-forward-hscroll))) #+end_src ** anzu @@ -1621,8 +1692,9 @@ See [[notmuch:id:87muuqsvci.fsf@fencepost.gnu.org][bug follow-up]]. #+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