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\\'")
#+end_src
** Org Mode Templates
#+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
** Indents and Autopairs
#+begin_src emacs-lisp
(electric-indent-mode -1)
(electric-pair-mode 1)
#+end_src
** Evil Mode
#+begin_src emacs-lisp
(setq-default evil-auto-indent t
indent-line-function 'evil-indent-line
indent-tabs-mode nil
@ -186,6 +173,9 @@
(evil-mode 1)
(setq-default evil-shift-width 2)
(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 "gp") 'diff-hl-show-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-next-error)
(evil-leader/set-key "a" #'eglot-code-actions))
#+end_src
** Catppuccin Theme
#+begin_src emacs-lisp
(use-package catppuccin-theme
:ensure t
:demand t
:config
(load-theme 'catppuccin t))
#+end_src
** Disable Autosave and Backup Files
#+begin_src emacs-lisp
(setq auto-save-default nil
make-backup-files nil)
#+end_src
@ -369,19 +367,26 @@
:ensure t)
#+end_src
*** Corfu
*** GitHub Copilot
#+begin_src emacs-lisp
(use-package copilot
:ensure (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))
:hook (prog-mode . copilot-mode)
:bind (("C-TAB" . 'copilot-complete)
:bind (("C-<tab>" . 'copilot-complete)
:map copilot-completion-map
("<tab>" . 'copilot-accept-completion)
("C-<tab>" . 'copilot-accept-completion-by-word)
("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
:ensure t
:custom
@ -450,23 +455,41 @@
scroll-conservatively 9999)
#+end_src
** Sticky Headers
#+begin_src emacs-lisp
(use-package breadcrumb
:ensure t
:hook
(prog-mode . breadcrumb-mode))
#+end_src
** System-Specific Settings
#+begin_src emacs-lisp
(defun apply-my-fonts (frame)
(with-selected-frame frame
(cond
((eq system-type 'darwin)
(set-face-attribute 'default nil :font "Iosevka Comfy-14")
(set-face-attribute 'fixed-pitch nil :font "Iosevka Comfy-14")
(set-face-attribute 'variable-pitch nil :font "Iosevka Comfy Motion Duo-16")
(setq default-frame-alist '((font . "Iosevka Comfy-14"))))
(set-face-attribute 'default frame :font "Iosevka Comfy-14")
(set-face-attribute 'fixed-pitch frame :font "Iosevka Comfy-14")
(set-face-attribute 'variable-pitch frame :font "Iosevka Comfy Motion Duo-16")
(modify-frame-parameters frame
'((font . "Iosevka Comfy-14")
(vertical-scroll-bars . nil))))
((eq system-type 'gnu/linux)
(set-face-attribute 'default nil :font "Iosevka Comfy Medium-12")
(set-face-attribute 'fixed-pitch nil :font "Iosevka Comfy Medium-12")
(set-face-attribute 'variable-pitch nil :font "Iosevka Comfy Motion Duo Md-14")
(setq default-frame-alist
(set-face-attribute 'default frame :font "Iosevka Comfy Medium-12")
(set-face-attribute 'fixed-pitch frame :font "Iosevka Comfy Medium-12")
(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)))))
(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
** Use Short Answers
@ -475,12 +498,6 @@
(setq use-short-answers t)
#+end_src
** Enable ctrl+c/ctrl+v
#+begin_src emacs-lisp
(cua-mode 1)
#+end_src
** Undo Tree
#+begin_src emacs-lisp
@ -590,5 +607,15 @@
:config
(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)
#+end_src