Compare commits
7 Commits
ada3ec0593
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e57257a3a5 | |||
| bee1efe12a | |||
| d188fa1e8f | |||
| 68f12a2a61 | |||
| 24ff0c980b | |||
| 70d6266bed | |||
| 741135b1b4 |
14
custom.el
14
custom.el
@@ -6,13 +6,13 @@
|
||||
;; If there is more than one, they won't work right.
|
||||
'(package-selected-packages
|
||||
'(aider browse-kill-ring caddyfile-mode cape cider company corfu
|
||||
dockerfile-mode dumb-jump dumber-jump emacs-lldb
|
||||
exec-path-from-shell flycheck fsharp-mode haskell-mode
|
||||
haskell-ts-mode helm htmlize idris-mode marginalia
|
||||
markdown-ts-mode multiple-cursors odin-mode orderless
|
||||
org-mode parinfer-rust-mode realgud-lldb rg sly
|
||||
terraform-mode tree-sitter-langs vertico visual-fill-column
|
||||
yasnippet-snippets zig-mode))
|
||||
dockerfile-mode dumb-jump dumber-jump emacs-lldb emmet
|
||||
emmet-mode exec-path-from-shell flycheck fsharp-mode
|
||||
haskell-mode haskell-ts-mode helm htmlize idris-mode
|
||||
marginalia markdown-ts-mode move-text multiple-cursors
|
||||
odin-mode orderless org-mode parinfer-rust-mode
|
||||
realgud-lldb rg sly terraform-mode tree-sitter-langs
|
||||
vertico visual-fill-column yasnippet-snippets zig-mode))
|
||||
'(safe-local-variable-directories '("/Users/grant/programming/project/edit/"))
|
||||
'(safe-local-variable-values
|
||||
'((Package . CL-USER) (Syntax . ANSI-Common-Lisp) (Base . 10)
|
||||
|
||||
162
init.el
162
init.el
@@ -1,4 +1,4 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
;;; -*- lexical-binding: t; -*-
|
||||
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives
|
||||
@@ -8,12 +8,12 @@
|
||||
(require 'use-package-ensure)
|
||||
(require 'bind-key)
|
||||
|
||||
; If startup times are slow
|
||||
; (setq use-package-verbose t)
|
||||
;; If startup times are slow
|
||||
;; (setq use-package-verbose t)
|
||||
;; (setq use-package-compute-statistics t)
|
||||
|
||||
(add-to-list 'load-path (concat (file-name-parent-directory user-init-file) "local-lisp/"))
|
||||
(add-to-list 'load-path (concat user-emacs-directory "local-lisp/"))
|
||||
|
||||
(use-package emacs)
|
||||
(setq tab-bar-show nil)
|
||||
(setq inhibit-startup-message t)
|
||||
(setq initial-scratch-message nil)
|
||||
@@ -36,6 +36,8 @@
|
||||
(setq-default tab-width 4)
|
||||
(set-face-attribute 'default nil :height 160 :family "Berkeley Mono")
|
||||
(global-hl-line-mode 1)
|
||||
(pixel-scroll-precision-mode 1)
|
||||
(kill-ring-deindent-mode 1)
|
||||
|
||||
(setq use-package-always-ensure t)
|
||||
(setq mac-command-modifier 'control)
|
||||
@@ -43,14 +45,14 @@
|
||||
|
||||
(setq-default cursor-type 'bar)
|
||||
|
||||
(defun hgh/disable-bar-cursor ()
|
||||
(defun hgh/disable-cursor-blink ()
|
||||
(blink-cursor-mode -1))
|
||||
|
||||
(defun hgh/enable-bar-cursor ()
|
||||
(defun hgh/enable-cursor-blink ()
|
||||
(blink-cursor-mode 1))
|
||||
|
||||
(add-hook 'activate-mark-hook 'hgh/disable-bar-cursor)
|
||||
(add-hook 'deactivate-mark-hook 'hgh/enable-bar-cursor)
|
||||
(add-hook 'activate-mark-hook 'hgh/disable-cursor-blink)
|
||||
(add-hook 'deactivate-mark-hook 'hgh/enable-cursor-blink)
|
||||
|
||||
(when is-mac
|
||||
(setq dired-use-ls-dired t
|
||||
@@ -59,7 +61,6 @@
|
||||
|
||||
;; Add .asdf to exec-path
|
||||
(when (file-exists-p (file-truename "~/.asdf"))
|
||||
(setq env-changed t)
|
||||
(push (file-truename "~/.asdf/shims") exec-path)
|
||||
(push (file-truename "~/.asdf/bin") exec-path))
|
||||
|
||||
@@ -67,8 +68,7 @@
|
||||
(setq exec-path
|
||||
(cl-remove-if (lambda (s)
|
||||
(and (< 5 (length s))
|
||||
(string= (substring s 0 6) "/mnt/c")
|
||||
(setq env-changed t)))
|
||||
(string= (substring s 0 6) "/mnt/c")))
|
||||
exec-path))
|
||||
|
||||
(when exec-path
|
||||
@@ -110,6 +110,12 @@
|
||||
(keymap-global-set "M-1" #'delete-other-windows)
|
||||
(keymap-global-set "M-2" #'split-window-below)
|
||||
(keymap-global-set "M-3" #'split-window-right)
|
||||
(keymap-global-set "C-," #'duplicate-dwim)
|
||||
|
||||
(keymap-set completion-list-mode-map "M-n" #'minibuffer-next-completion)
|
||||
(keymap-set completion-list-mode-map "M-p" #'minibuffer-previous-completion)
|
||||
(keymap-set completion-in-region-mode-map "M-n" #'minibuffer-next-completion)
|
||||
(keymap-set completion-in-region-mode-map "M-p" #'minibuffer-previous-completion)
|
||||
|
||||
(require 'dired)
|
||||
(setq dired-dwim-target t)
|
||||
@@ -117,6 +123,24 @@
|
||||
|
||||
(load-theme 'modus-vivendi t)
|
||||
|
||||
;; Let's prefer completion-preview for now if it's available
|
||||
(if (version<= "30.1" emacs-version)
|
||||
(use-package completion-preview
|
||||
:ensure nil
|
||||
:demand t
|
||||
:bind
|
||||
(:map completion-preview-active-mode-map
|
||||
("M-n" . completion-preview-next-candidate)
|
||||
("M-p" . completion-preview-preview-candidate))
|
||||
:config
|
||||
(global-completion-preview-mode t))
|
||||
(use-package corfu
|
||||
:custom
|
||||
(corfu-auto t)
|
||||
(corfu-cycle t)
|
||||
:config
|
||||
(global-corfu-mode 1)))
|
||||
|
||||
(use-package exec-path-from-shell
|
||||
:when is-mac
|
||||
:config
|
||||
@@ -131,14 +155,14 @@
|
||||
:defer t)
|
||||
|
||||
(use-package tree-sitter
|
||||
:mode ((" \\.tsx\\'" . tsx-ts-mode)
|
||||
(" \\.js\\'" . typescript-ts-mode)
|
||||
(" \\.mjs\\'" . typescript-ts-mode)
|
||||
(" \\.mts\\'" . typescript-ts-mode)
|
||||
(" \\.cjs\\'" . typescript-ts-mode)
|
||||
(" \\.ts\\'" . typescript-ts-mode)
|
||||
(" \\.jsx\\'" . tsx-ts-mode)
|
||||
(" \\.json\\'" . json-ts-mode))
|
||||
:mode (("\\.tsx\\'" . tsx-ts-mode)
|
||||
("\\.js\\'" . typescript-ts-mode)
|
||||
("\\.mjs\\'" . typescript-ts-mode)
|
||||
("\\.mts\\'" . typescript-ts-mode)
|
||||
("\\.cjs\\'" . typescript-ts-mode)
|
||||
("\\.ts\\'" . typescript-ts-mode)
|
||||
("\\.jsx\\'" . tsx-ts-mode)
|
||||
("\\.json\\'" . json-ts-mode))
|
||||
:custom
|
||||
(treesit-extra-load-path '("~/repos/tree-sitter-module/dist")))
|
||||
|
||||
@@ -155,14 +179,16 @@
|
||||
(when (and
|
||||
(not (s-contains? "sbcl" buf))
|
||||
(not (s-contains? "ocicl" buf))
|
||||
(not (s-contains? "elpa" buf))
|
||||
(not (s-contains? "emacs-plus" buf))
|
||||
(not (string-prefix-p "*sly" buf)))
|
||||
(parinfer-rust-mode 1))))
|
||||
|
||||
(use-package parinfer-rust-mode
|
||||
:defer t
|
||||
:hook ((lisp-mode emacs-lisp-mode) . enable-parinfer)
|
||||
:config
|
||||
(setq parinfer-rust-disable-troublesome-modes t))
|
||||
:custom
|
||||
(parinfer-rust-disable-troublesome-modes t))
|
||||
|
||||
(use-package sly
|
||||
:mode "\\.lisp\\'"
|
||||
@@ -192,13 +218,6 @@
|
||||
(setq completion-styles '(orderless basic)
|
||||
completion-category-overrides '((file (styles basic partial-completion)))))
|
||||
|
||||
(use-package corfu
|
||||
:custom
|
||||
(corfu-auto t)
|
||||
(corfu-cycle t)
|
||||
:config
|
||||
(global-corfu-mode 1))
|
||||
|
||||
(use-package cape
|
||||
:init
|
||||
(add-to-list 'completion-at-point-functions #'cape-dabbrev))
|
||||
@@ -283,21 +302,21 @@
|
||||
(file-name-nondirectory (directory-file-name default-directory))
|
||||
" rg*"))))
|
||||
|
||||
(defun hgh/set-cursor-type-box (&rest _args)
|
||||
(setq-local cursor-type 'box))
|
||||
|
||||
(defun hgh/set-cursor-type-bar (&rest _args)
|
||||
(setq-local cursor-type 'bar))
|
||||
|
||||
(use-package multiple-cursors
|
||||
:hook ((multiple-cursors-mode-disabled . hgh/set-cursor-type-bar))
|
||||
:bind (("C->" . mc/mark-next-like-this)
|
||||
("C-<" . mc/mark-previous-like-this))
|
||||
:init
|
||||
(add-hook 'multiple-cursors-mode-enabled-hook
|
||||
(lambda ()
|
||||
(remove-hook 'activate-mark-hook 'hgh/disable-bar-cursor)
|
||||
(remove-hook 'deactivate-mark-hook 'hgh/disable-bar-cursor)
|
||||
(blink-cursor-mode 1)))
|
||||
(add-hook 'multiple-cursors-mode-disabled-hook
|
||||
(lambda ()
|
||||
(add-hook 'activate-mark-hook 'hgh/disable-bar-cursor)
|
||||
(add-hook 'deactivate-mark-hook 'hgh/disable-bar-cursor)
|
||||
(blink-cursor-mode 1)))
|
||||
:config
|
||||
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
||||
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this))
|
||||
;; NOTE(grant): I have no idea if the package is deferred or autoloaded anymore
|
||||
(advice-add 'mc/mark-next-like-this :before #'hgh/set-cursor-type-box)
|
||||
(advice-add 'mc/mark-previous-like-this :before #'hgh/set-cursor-type-box))
|
||||
|
||||
|
||||
(use-package yasnippet
|
||||
:diminish
|
||||
@@ -335,36 +354,44 @@
|
||||
:defer t)
|
||||
|
||||
(use-package org
|
||||
:mode "\\.org\\'"
|
||||
:ensure nil
|
||||
:mode ("\\.org\\'" . org-mode)
|
||||
:hook (org-mode . org-indent-mode)
|
||||
:custom
|
||||
(org-todo-keywords '((sequence "TODO" "INPROGRESS" "DONE")))
|
||||
(org-support-shift-select t)
|
||||
(org-default-notes-file (concat org-directory "/captures.org"))
|
||||
(org-html-validation-link nil)
|
||||
(org-html-head-include-default-style nil)
|
||||
(org-html-head-include-scripts nil)
|
||||
(org-html-head "<link rel=\"stylesheet\" href=\"https://cdn.simplecss.org/simple.min.css\" />")
|
||||
(org-capture-templates
|
||||
'(("t" "Task" entry (file+headline "~/org/inbox.org" "Tasks")
|
||||
"* TODO %?\n%U\n%i\n%a")
|
||||
("n" "Note" entry (file+headline "~/org/inbox.org" "Notes")
|
||||
"* %?\n%U\n%i\n%a")
|
||||
("i" "Idea" entry (file+headline "~/org/inbox.org" "Ideas")
|
||||
"* %?\n%U\n%i\n%a")))
|
||||
|
||||
(org-publish-use-timestamps-flag nil)
|
||||
(org-publish-project-alist
|
||||
(list
|
||||
(list "writings"
|
||||
:base-directory "~/Documents/writings/content"
|
||||
:publishing-directory "~/Documents/writings/public"
|
||||
:exclude "~/Documents/writings/notes"
|
||||
:recursive t
|
||||
:time-stamp-file nil
|
||||
:section-numbers nil
|
||||
:with-creator t
|
||||
:with-author nil)))
|
||||
|
||||
:config
|
||||
(org-indent-mode)
|
||||
(require 'ox-publish)
|
||||
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((shell . t)))
|
||||
|
||||
(setq org-publish-use-timestamps-flag nil)
|
||||
|
||||
(setq org-publish-project-alist
|
||||
(list
|
||||
(list "writings"
|
||||
:base-directory "~/Documents/writings/content"
|
||||
:publishing-directory "~/Documents/writings/public"
|
||||
:exclude "~/Documents/writings/notes"
|
||||
:recursive t
|
||||
:time-stamp-file nil
|
||||
:section-numbers nil
|
||||
:with-creator t
|
||||
:with-author nil))))
|
||||
'((shell . t))))
|
||||
|
||||
(use-package dumber-jump
|
||||
:init
|
||||
@@ -400,3 +427,20 @@
|
||||
(codex-provider nil)
|
||||
(codex-model nil)
|
||||
:ensure nil)
|
||||
|
||||
(use-package move-text
|
||||
:bind (("M-<up>" . move-text-up)
|
||||
("M-<down>" . move-text-down)))
|
||||
|
||||
(use-package emmet-mode
|
||||
:hook (sgml-mode tsx-ts-mode)
|
||||
:custom
|
||||
(emmet-jsx-major-modes
|
||||
'(rjsx-mode
|
||||
typescript-tsx-mode
|
||||
js-jsx-mode
|
||||
js2-jsx-mode
|
||||
jsx-mode
|
||||
js-mode
|
||||
;; Need to add this
|
||||
tsx-ts-mode)))
|
||||
|
||||
@@ -82,13 +82,13 @@ http_headers = {
|
||||
:type 'boolean
|
||||
:group 'codex)
|
||||
|
||||
(defcustom codex-sessions-file (concat (file-name-parent-directory user-init-file) "codex-sessions")
|
||||
(defcustom codex-sessions-file (concat user-emacs-directory "codex-sessions")
|
||||
"What the default name should be fore the codex chat buffer."
|
||||
:type 'string
|
||||
:group 'codex)
|
||||
|
||||
(defcustom codex-sessions-history-dir
|
||||
(concat (file-name-parent-directory user-init-file) "codex-sessions-history/")
|
||||
(concat user-emacs-directory "codex-sessions-history/")
|
||||
"Directory where Codex session histories are stored."
|
||||
:type 'directory
|
||||
:group 'codex)
|
||||
@@ -221,7 +221,7 @@ http_headers = {
|
||||
|
||||
(defun codex--send (prompt)
|
||||
"Sends a prompt to codex."
|
||||
(let* ((buf (generate-new-buffer "*codex--send*"))
|
||||
(let* ((buf (generate-new-buffer " *codex--send*"))
|
||||
(proc (make-process
|
||||
:name "codex"
|
||||
:buffer buf
|
||||
|
||||
Reference in New Issue
Block a user