some fixes

This commit is contained in:
Mars 2024-10-11 21:45:08 -04:00
parent bb2540a2c9
commit 2dc4ad62b1
Signed by: pupbrained
GPG key ID: 874E22DF2F9DFCB5

View file

@ -132,29 +132,16 @@
:mode "\\.nix\\'") :mode "\\.nix\\'")
#+end_src #+end_src
** Org Mode Templates ** Indents and Autopairs
#+begin_src emacs-lisp
;; Inhibits autopairs from running for <> in org mode
(add-hook 'org-mode-hook
(lambda ()
(setq-local electric-pair-inhibit-predicate
`(lambda (c) (if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
(require 'org-tempo)
(add-to-list 'org-modules 'org-tempo t)
(defun org-babel-edit-prep:emacs-lisp (babel-info)
(setq-local buffer-file-name (->> babel-info caddr (alist-get :tangle)))
(lsp))
#+end_src
** Fix Indents + Enable Autopairs
#+begin_src emacs-lisp #+begin_src emacs-lisp
(electric-indent-mode -1) (electric-indent-mode -1)
(electric-pair-mode 1) (electric-pair-mode 1)
#+end_src
** Evil Mode
#+begin_src emacs-lisp
(setq-default evil-auto-indent t (setq-default evil-auto-indent t
indent-line-function 'evil-indent-line indent-line-function 'evil-indent-line
indent-tabs-mode nil indent-tabs-mode nil
@ -186,6 +173,9 @@
(evil-mode 1) (evil-mode 1)
(setq-default evil-shift-width 2) (setq-default evil-shift-width 2)
(evil-define-key 'insert 'global (kbd "TAB") 'tab-to-tab-stop) (evil-define-key 'insert 'global (kbd "TAB") 'tab-to-tab-stop)
(evil-define-key 'insert 'global (kbd "C-c") 'cua-copy-region)
(evil-define-key 'insert 'global (kbd "C-v") 'cua-paste)
(evil-define-key 'insert 'global (kbd "C-x") 'cua-cut-region)
(evil-define-key 'normal 'global (kbd "gm") 'magit-status) (evil-define-key 'normal 'global (kbd "gm") 'magit-status)
(evil-define-key 'normal 'global (kbd "gp") 'diff-hl-show-hunk) (evil-define-key 'normal 'global (kbd "gp") 'diff-hl-show-hunk)
(evil-define-key 'normal 'global (kbd "gr") 'diff-hl-revert-hunk) (evil-define-key 'normal 'global (kbd "gr") 'diff-hl-revert-hunk)
@ -222,13 +212,21 @@
(evil-leader/set-key "N" #'flymake-goto-prev-error) (evil-leader/set-key "N" #'flymake-goto-prev-error)
(evil-leader/set-key "n" #'flymake-goto-next-error) (evil-leader/set-key "n" #'flymake-goto-next-error)
(evil-leader/set-key "a" #'eglot-code-actions)) (evil-leader/set-key "a" #'eglot-code-actions))
#+end_src
** Catppuccin Theme
#+begin_src emacs-lisp
(use-package catppuccin-theme (use-package catppuccin-theme
:ensure t :ensure t
:demand t :demand t
:config :config
(load-theme 'catppuccin t)) (load-theme 'catppuccin t))
#+end_src
** Disable Autosave and Backup Files
#+begin_src emacs-lisp
(setq auto-save-default nil (setq auto-save-default nil
make-backup-files nil) make-backup-files nil)
#+end_src #+end_src
@ -369,19 +367,26 @@
:ensure t) :ensure t)
#+end_src #+end_src
*** Corfu *** GitHub Copilot
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package copilot (use-package copilot
:ensure (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")) :ensure (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))
:hook (prog-mode . copilot-mode) :hook (prog-mode . copilot-mode)
:bind (("C-TAB" . 'copilot-complete) :bind (("C-<tab>" . 'copilot-complete)
:map copilot-completion-map :map copilot-completion-map
("<tab>" . 'copilot-accept-completion) ("<tab>" . 'copilot-accept-completion)
("C-<tab>" . 'copilot-accept-completion-by-word) ("C-<tab>" . 'copilot-accept-completion-by-word)
("C-<return>" . 'copilot-accept-completion-by-line))) ("C-<return>" . 'copilot-accept-completion-by-line)))
(use-package copilot-chat
:ensure (:host github :repo "chep/copilot-chat.el" :files ("*.el"))
:after (request))
#+end_src
*** Corfu
#+begin_src emacs-lisp
(use-package corfu (use-package corfu
:ensure t :ensure t
:custom :custom
@ -450,23 +455,41 @@
scroll-conservatively 9999) scroll-conservatively 9999)
#+end_src #+end_src
** Sticky Headers
#+begin_src emacs-lisp
(use-package breadcrumb
:ensure t
:hook
(prog-mode . breadcrumb-mode))
#+end_src
** System-Specific Settings ** System-Specific Settings
#+begin_src emacs-lisp #+begin_src emacs-lisp
(cond (defun apply-my-fonts (frame)
((eq system-type 'darwin) (with-selected-frame frame
(set-face-attribute 'default nil :font "Iosevka Comfy-14") (cond
(set-face-attribute 'fixed-pitch nil :font "Iosevka Comfy-14") ((eq system-type 'darwin)
(set-face-attribute 'variable-pitch nil :font "Iosevka Comfy Motion Duo-16") (set-face-attribute 'default frame :font "Iosevka Comfy-14")
(setq default-frame-alist '((font . "Iosevka Comfy-14")))) (set-face-attribute 'fixed-pitch frame :font "Iosevka Comfy-14")
((eq system-type 'gnu/linux) (set-face-attribute 'variable-pitch frame :font "Iosevka Comfy Motion Duo-16")
(set-face-attribute 'default nil :font "Iosevka Comfy Medium-12") (modify-frame-parameters frame
(set-face-attribute 'fixed-pitch nil :font "Iosevka Comfy Medium-12") '((font . "Iosevka Comfy-14")
(set-face-attribute 'variable-pitch nil :font "Iosevka Comfy Motion Duo Md-14") (vertical-scroll-bars . nil))))
(setq default-frame-alist ((eq system-type 'gnu/linux)
'((font . "Iosevka Comfy Medium-12") (set-face-attribute 'default frame :font "Iosevka Comfy Medium-12")
(undecorated . t) (set-face-attribute 'fixed-pitch frame :font "Iosevka Comfy Medium-12")
(vertical-scroll-bars . nil))))) (set-face-attribute 'variable-pitch frame :font "Iosevka Comfy Motion Duo Md-14")
(modify-frame-parameters frame
'((font . "Iosevka Comfy Medium-12")
(undecorated . t)
(vertical-scroll-bars . nil)))))))
;; Apply the settings for both regular Emacs and emacsclient frames
(if (daemonp)
(add-hook 'after-make-frame-functions 'apply-my-fonts)
(apply-my-fonts (selected-frame)))
#+end_src #+end_src
** Use Short Answers ** Use Short Answers
@ -475,12 +498,6 @@
(setq use-short-answers t) (setq use-short-answers t)
#+end_src #+end_src
** Enable ctrl+c/ctrl+v
#+begin_src emacs-lisp
(cua-mode 1)
#+end_src
** Undo Tree ** Undo Tree
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -590,5 +607,15 @@
:config :config
(add-hook 'org-mode-hook #'org-modern-indent-mode 90)) (add-hook 'org-mode-hook #'org-modern-indent-mode 90))
;; Inhibits autopairs from running for <> in org mode
(add-hook 'org-mode-hook
(lambda ()
(setq-local electric-pair-inhibit-predicate
`(lambda (c) (if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
(defun org-babel-edit-prep:emacs-lisp (babel-info)
(setq-local buffer-file-name (->> babel-info caddr (alist-get :tangle)))
(lsp))
(add-hook 'eglot-managed-mode-hook #'flymake-mode) (add-hook 'eglot-managed-mode-hook #'flymake-mode)
#+end_src #+end_src