Fix some minor mode stuff

This commit is contained in:
Alexander Rosenberg 2023-09-30 21:41:19 -07:00
parent ef970dc06e
commit 0e6184f4b9
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

21
init.el
View File

@ -41,13 +41,11 @@
;; basic stuff ;; basic stuff
(use-package emacs (use-package emacs
:hook ((emacs-lisp-mode . my/-emacs-lisp-mode-setup-evil-lookup) :hook ((emacs-lisp-mode . my/-emacs-lisp-mode-setup-evil-lookup)
(prog-mode . my/enable-electric-pair-mode)) (prog-mode . electric-pair-local-mode))
:init :init
(defun my/-emacs-lisp-mode-setup-evil-lookup () (defun my/-emacs-lisp-mode-setup-evil-lookup ()
(setq-local evil-lookup-func (setq-local evil-lookup-func
#'my/describe-symbol-at-point)) #'my/describe-symbol-at-point))
(defun my/enable-electric-pair-mode ()
(electric-pair-local-mode 1))
(defun my/describe-symbol-at-point () (defun my/describe-symbol-at-point ()
"Calls `describe-symbol' on the return value of `form-at-point'." "Calls `describe-symbol' on the return value of `form-at-point'."
(interactive) (interactive)
@ -359,9 +357,9 @@ visual states."
;; flymake ;; flymake
(use-package flymake (use-package flymake
:bind (:map flymake-mode-map :bind (:map flymake-mode-map
("C-c e" . my/flymake-show-diagnostic-at-point) ("C-c e" . my/flymake-show-diagnostic-at-point)
("C-c C-e" . consult-flymake)) ("C-c C-e" . consult-flymake))
:hook (emacs-lisp-mode . my/enable-flymake-mode) :hook (emacs-lisp-mode . flymake-mode)
:init :init
(defun my/flymake-show-diagnostic-at-point () (defun my/flymake-show-diagnostic-at-point ()
(interactive) (interactive)
@ -369,9 +367,7 @@ visual states."
(diag (and flymake-mode (diag (and flymake-mode
(get-char-property pos 'flymake-diagnostic))) (get-char-property pos 'flymake-diagnostic)))
(message (flymake--diag-text diag))) (message (flymake--diag-text diag)))
(popup-tip message))) (popup-tip message))))
(defun my/enable-flymake-mode ()
(flymake-mode 1)))
;; eldoc ;; eldoc
(use-package eldoc (use-package eldoc
@ -396,7 +392,8 @@ visual states."
;; project.el ;; project.el
(use-package project (use-package project
:bind (:map project-prefix-map :bind (:map project-prefix-map
("s" . my/project-vterm)) ("s" . my/project-vterm)
("u" . my/project-run))
:init :init
(defvar my/project-vterm-hash-table (make-hash-table :test 'equal) (defvar my/project-vterm-hash-table (make-hash-table :test 'equal)
"Hash table that maps project root dirs to vterm buffers.") "Hash table that maps project root dirs to vterm buffers.")
@ -505,10 +502,8 @@ COMMAND and COMINT are like `compile'."
org-log-reschedule 'time)) org-log-reschedule 'time))
(use-package evil-org (use-package evil-org
:after org :after org
:hook (org-mode . my/evil-org-mode-enable) :hook (org-mode . evil-org-mode)
:init :init
(defun my/evil-org-mode-enable ()
(evil-org-mode 1))
(require 'evil-org-agenda) (require 'evil-org-agenda)
(evil-org-agenda-set-keys)) (evil-org-agenda-set-keys))