(setf custom-safe-themes t))
#+end_src
+** Secrets file
+
+#+begin_src emacs-lisp
+(load (no-littering-expand-etc-file-name "secrets"))
+#+end_src
+
** Better =$PATH= handling
Let's use [[https://github.com/purcell/exec-path-from-shell][exec-path-from-shell]] to make Emacs use the =$PATH= as set up
#+begin_src emacs-lisp
(bind-keys
("C-c b k" . kill-this-buffer)
- ("C-c s s" . save-buffer)
("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 F m" . make-frame-command)
("C-c F d" . delete-frame)
- ("C-c F D" . delete-other-frames))
+ ("C-c F D" . delete-other-frames)
+ ("s-c e b" . eval-buffer)
+ ("s-c e r" . eval-region)
+ ("s-p" . beginning-of-buffer)
+ ("s-n" . end-of-buffer))
#+end_src
** Packages
(use-package ox-latex
:config
- (setq org-latex-listings 'listings)
+ (setq org-latex-listings 'listings
+ ;; org-latex-prefer-user-labels t
+ )
(add-to-list 'org-latex-packages-alist '("" "listings"))
(add-to-list 'org-latex-packages-alist '("" "color"))
(add-to-list 'org-latex-classes
(use-package org-notmuch
:after (:any org notmuch))
-(use-package orgalist)
+(use-package orgalist
+ :hook (message-mode . orgalist-mode))
#+end_src
**** asynchronous tangle
(use-package magit
:defer t
:bind
- (("s-g" . magit-dispatch-popup)
- ("C-x g" . magit-status)
+ (("s-g" . magit-status)
:prefix-map amin--magit-prefix-map
:prefix "C-c g"
("SPC" . magit-status)
("emacs"
(or
(name . "^\\*scratch\\*$")
- (name . "^\\*Messages\\*$"))))))
+ (name . "^\\*Messages\\*$")))
+ ("slack"
+ (or
+ (name . "^\\*Slack*"))))))
(ibuffer-formats
'((mark modified read-only locked " "
(name 18 18 :left :elide)
(:map
outline-minor-mode-map
("<s-tab>" . outline-toggle-children)
- ("s-p" . outline-previous-visible-heading)
- ("s-n" . outline-next-visible-heading)
+ ("M-p" . outline-previous-visible-heading)
+ ("M-n" . outline-next-visible-heading)
:prefix-map amin--outline-prefix-map
:prefix "s-o"
("TAB" . outline-toggle-children)
#+begin_src emacs-lisp
(use-package flycheck
:hook (prog-mode . flycheck-mode)
+ :bind
+ (:map flycheck-mode-map
+ ("M-P" . flycheck-previous-error)
+ ("M-N" . flycheck-next-error))
:config
;; Use the load-path from running Emacs when checking elisp files
(setq flycheck-emacs-lisp-load-path 'inherit)
: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]]
#+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
:hook (text-mode . typo-mode))
#+end_src
+** slack
+
+Hopefully temporary.
+
+#+begin_src emacs-lisp
+(use-package slack
+ :commands (slack-start)
+ :init
+ (eval-when-compile ; silence the byte-compiler
+ (defvar url-http-data nil)
+ (defvar url-http-extra-headers nil)
+ (defvar url-http-method nil)
+ (defvar url-callback-function nil)
+ (defvar url-callback-arguments nil)
+ (defvar oauth--token-data nil))
+ (setq slack-buffer-emojify t
+ slack-prefer-current-team t)
+ :config
+ (slack-register-team
+ :name "uw-apv"
+ :default t
+ :client-id uw-apv-client-id
+ :client-secret uw-apv-client-secret
+ :token uw-apv-token
+ :subscribed-channels '(general)
+ :full-and-display-names t)
+ (slack-register-team
+ :name "watform"
+ :default nil
+ :client-id watform-client-id
+ :client-secret watform-client-secret
+ :token watform-token
+ :subscribed-channels '(general)
+ :full-and-display-names t)
+ (add-to-list 'swiper-font-lock-exclude 'slack-message-buffer-mode t)
+ :bind
+ (("C-c s s" . slack-start)
+ ("C-c s u" . slack-select-unread-rooms)
+ ("C-c s b" . slack-select-rooms)
+ ("C-c s t" . slack-change-current-team)
+ ("C-c s c" . slack-ws-close)
+ :map slack-mode-map
+ ("M-p" . slack-buffer-goto-prev-message)
+ ("M-n" . slack-buffer-goto-next-message)
+ ("C-c e" . slack-message-edit)
+ ("C-c k" . slack-message-delete)
+ ("C-c C-k" . slack-channel-leave)
+ ("C-c r a" . slack-message-add-reaction)
+ ("C-c r r" . slack-message-remove-reaction)
+ ("C-c r s" . slack-message-show-reaction-users)
+ ("C-c p l" . slack-room-pins-list)
+ ("C-c p a" . slack-message-pins-add)
+ ("C-c p r" . slack-message-pins-remove)
+ ("@" . slack-message-embed-mention)
+ ("#" . slack-message-embed-channel)))
+
+(use-package alert
+ :commands (alert)
+ :init
+ (setq alert-default-style 'notifier))
+#+end_src
+
* Email
#+begin_src emacs-lisp
#+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