X-Git-Url: https://git.shemshak.org/~bandali/configs/blobdiff_plain/97cf0fc47708722e8454dd87b72a587f3dd6864d..0c158cafca2f97bc07de692ff4b81f300f292e8f:/init.org?ds=inline diff --git a/init.org b/init.org index 5ead731..9a0e1dd 100644 --- a/init.org +++ b/init.org @@ -718,7 +718,11 @@ 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)) + +;; (use-package org-outline-numbering) +;; TODO: auto-updating by calling org-outline-numbering-display #+end_src **** asynchronous tangle @@ -1065,7 +1069,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 +1382,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]] @@ -1545,13 +1614,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 @@ -1622,8 +1695,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