diff --git a/.emacs.d/include/priime-completion.el b/.emacs.d/include/priime-completion.el index ac9c1a3..bf4b277 100644 --- a/.emacs.d/include/priime-completion.el +++ b/.emacs.d/include/priime-completion.el @@ -36,38 +36,13 @@ (use-package orderless :straight t :custom (orderless-matching-styles '(orderless-literal-prefix orderless-literal orderless-regexp))) +(use-package consult :straight t + :bind (("C-c r r" . consult-ripgrep) + ("C-c r g" . consult-grep))) (use-package yasnippet :straight t :hook ((prog-mode . yas-minor-mode))) (use-package yasnippet-snippets :straight t) -(use-package consult :straight t - :bind (("C-c r r" . consult-ripgrep) - ("C-c r g" . consult-grep) - ("C-c r f" . consult-ripgrep-file))) - -(defun consult-ripgrep-file (&optional initial) - "Search with `rg' in the current file with INITIAL input." - (interactive) - (cond - ((buffer-file-name) - (let* ((file (buffer-file-name)) - (builder (consult--ripgrep-make-builder (list file)))) - (consult--read - (consult--process-collection builder - :transform (consult--grep-format builder) - :file-handler t) - :prompt "Ripgrep (current file): " - :lookup #'consult--lookup-member - :state (consult--grep-state) - :initial initial - :add-history (thing-at-point 'symbol) - :require-match t - :category 'consult-grep - :group #'consult--prefix-group - :history '(:input consult--grep-history) - :sort nil))) - (t (user-error "Buffer not visiting a file")))) - (provide 'priime-completion) ;;; priime-completion.el ends here diff --git a/.emacs.d/include/priime-general.el b/.emacs.d/include/priime-general.el index 41052f3..8da2d74 100644 --- a/.emacs.d/include/priime-general.el +++ b/.emacs.d/include/priime-general.el @@ -8,8 +8,9 @@ ;;; Font (defvar priime--font-config - (cond ((eq system-type 'gnu/linux) '("JetBrains Mono Medium" "Roboto" 12 0.8)) - ((eq system-type 'darwin) '("JetBrains Mono Medium" "Verdana" 12 1)) + (cond ((string= (system-name) "minji") '("JetBrains Mono Medium" "Roboto" 10 0.9)) + ((eq system-type 'gnu/linux) '("Roboto Mono Medium" "Roboto" 12 0.8)) + ((eq system-type 'darwin) '("Menlo" "Verdana" 12 1)) (t '("Roboto Mono" "Roboto" 10 0.8)))) (defvar priime-fixed-font (-first-item priime--font-config)) diff --git a/.emacs.d/include/priime-languages.el b/.emacs.d/include/priime-languages.el index 800c68e..fd6c818 100644 --- a/.emacs.d/include/priime-languages.el +++ b/.emacs.d/include/priime-languages.el @@ -120,10 +120,6 @@ (use-package auctex :straight t) (use-package cdlatex :straight t) (use-package yaml-mode :straight t) -(use-package swift-mode :straight t - :custom-face (swift-mode:keyword-face ((t (:inherit nano-strong)))) - :hook ((swift-mode . electric-pair-local-mode) - (swift-mode . electric-indent-local-mode))) ;; From https://www.ovistoica.com/blog/2024-7-05-modern-emacs-typescript-web-tsx-config (use-package treesit diff --git a/.emacs.d/include/priime-lsp.el b/.emacs.d/include/priime-lsp.el index 76018e7..8f6d87d 100644 --- a/.emacs.d/include/priime-lsp.el +++ b/.emacs.d/include/priime-lsp.el @@ -7,7 +7,7 @@ :custom (eglot-events-buffer-config '(:size 0 :format full)) :custom-face (eglot-inlay-hint-face ((t (:height 1.0)))) - :hook ((racket-mode rust-mode irony-mode tuareg-mode python-mode tsx-ts-mode nix-mode swift-mode) . eglot-ensure) + :hook ((racket-mode rust-mode irony-mode tuareg-mode python-mode tsx-ts-mode nix-mode) . eglot-ensure) :bind (:map eglot-mode-map ("C-c l r" . eglot-rename) ("C-c l a" . eglot-code-actions) @@ -16,8 +16,7 @@ (fset #'jsonrpc--log-event #'ignore) :config (add-to-list 'eglot-server-programs '(nix-mode "nil")) - (add-to-list 'eglot-server-programs '(python-mode . ("basedpyright-langserver" "--stdio"))) - (add-to-list 'eglot-server-programs '(swift-mode "sourcekit-lsp"))) + (add-to-list 'eglot-server-programs '(python-mode . ("basedpyright-langserver" "--stdio")))) (use-package eglot-booster :straight (eglot-booster :type git :host github :repo "jdtsmith/eglot-booster") :after (eglot) diff --git a/.emacs.d/include/priime-org.el b/.emacs.d/include/priime-org.el index 858d5df..2fd93d3 100644 --- a/.emacs.d/include/priime-org.el +++ b/.emacs.d/include/priime-org.el @@ -11,8 +11,7 @@ "i" #'org-roam-node-insert "t" #'org-roam-tag-add "s" #'org-save-all-org-buffers - "w" #'org-switch-workspace - "l" #'org-log) + "w" #'org-switch-workspace) (defun org-switch-workspace (&optional workspace-name) "Switch the current org-roam-directory to WORKSPACE-NAME." @@ -30,17 +29,6 @@ (setq org-roam-db-location (cddr (assoc workspace-name org-workspaces-alist))) (org-roam-db-sync nil))) -(defun org-log () - "Add a new entry to the log." - (interactive) - (let* ((log-file-id "77f70d99-0674-43fb-8d64-f04cfa6cb495") - (log-file (org-roam-node-from-id log-file-id))) - (org-roam-node-visit log-file) - (beginning-of-buffer) - (org-next-visible-heading 1) - (org-insert-heading) - (org-timestamp '(16)))) - (defun org-roam-migrate () "Migrate a regular org file into an org-roam file in my format." (interactive) diff --git a/.emacs.d/include/priime-vc.el b/.emacs.d/include/priime-vc.el index 373858b..ff39702 100644 --- a/.emacs.d/include/priime-vc.el +++ b/.emacs.d/include/priime-vc.el @@ -48,37 +48,18 @@ (kill-new target-link) target-link)) -(defun git-link--format-line-prefix (filepath) - "Format the prefix for line spec using FILEPATH." - (concat - (when (git-link--should-render-plain filepath) - "?plain=1") - "#")) - -(defun git-link--format-line-range (start end) - "Format the line from START to END." - (format "L%s-L%s" start end)) - -(defun git-link--format-line-start (start) - "Format the line START." - (format "L%s" start)) - -(defun git-link--format-line-suffix (filepath start end) - "Common helper function for formatting the line suffix at the end of a URL." - (when start - (concat (git-link--format-line-prefix filepath) - (if end - (git-link--format-line-range start end) - (git-link--format-line-start start))))) - -(defun git-link-priime-dev (hostname projname filepath branch commit start end) +(defun git-link-priime-dev (hostname dirname filename branch commit start end) "git-link configuration for my own forge." (format "%s/%s/src/commit/%s/%s" hostname - projname + dirname (or branch commit) - (concat filepath - (git-link--format-line-suffix filepath start end)))) + (concat filename + (when start + (concat (if (git-link--should-render-plain filename) "?plain=1#" "#") + (if end + (format "L%s-L%s" start end) + (format "L%s" start))))))) (add-to-list 'git-link-remote-alist '("git.priime.dev" git-link-priime-dev))