From 16fabb75ce5bfe8ef29a752f52a671ac9063968f Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 1 Sep 2024 15:54:34 +0200 Subject: [PATCH] removed extra closing ) --- emacs/custom.el | 3 +- emacs/init.el | 185 +++++++++++++++++++++++++++--------------------- 2 files changed, 106 insertions(+), 82 deletions(-) diff --git a/emacs/custom.el b/emacs/custom.el index 6deb348..7fda52d 100644 --- a/emacs/custom.el +++ b/emacs/custom.el @@ -7,8 +7,9 @@ ;; If there is more than one, they won't work right. '(custom-safe-themes '("9fb561389e5ac5b9ead13a24fb4c2a3544910f67f12cfcfe77b75f36248017d0" "88f7ee5594021c60a4a6a1c275614103de8c1435d6d08cc58882f920e0cec65e" "aec7b55f2a13307a55517fdf08438863d694550565dee23181d2ebd973ebd6b8" "014cb63097fc7dbda3edf53eb09802237961cbb4c9e9abd705f23b86511b0a69" "81f53ee9ddd3f8559f94c127c9327d578e264c574cda7c6d9daddaec226f87bb" "3770d0ae70172461ee0a02edcff71b7d480dc54066e8960d8de9367d12171efb" "f64189544da6f16bab285747d04a92bd57c7e7813d8c24c30f382f087d460a33" "f079ef5189f9738cf5a2b4507bcaf83138ad22d9c9e32a537d61c9aae25502ef" "835d934a930142d408a50b27ed371ba3a9c5a30286297743b0d488e94b225c5f" default)) + '(elfeed-feeds '("https://hnrss.org/newest")) '(package-selected-packages - '(vertico orderless plz ace-mc ace-jump-mode flycheck fic-mode kotlin-mode rego-mode protobuf-mode multi-web-mode mmm-mode python-mode php-mode json-mode yaml-mode go-mode plantuml-mode graphviz-dot-mode magit denote unicode-fonts nerd-icons-ibuffer nerd-icons-completion nerd-icons-dired doom-modeline which-key multiple-cursors dash async-status async consult-projectile))) + '(cape kind-icon corfu eat eshell-toggle eshell-git-prompt eshell-bookmark eshell-autojump eshell-atuin elfeed vertico orderless plz ace-mc ace-jump-mode flycheck fic-mode kotlin-mode rego-mode protobuf-mode multi-web-mode mmm-mode python-mode php-mode json-mode yaml-mode go-mode plantuml-mode graphviz-dot-mode magit denote unicode-fonts nerd-icons-ibuffer nerd-icons-completion nerd-icons-dired doom-modeline which-key multiple-cursors dash async-status async consult-projectile))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs/init.el b/emacs/init.el index 59e945c..f7c8c98 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -1,6 +1,7 @@ (require 'package) (add-to-list 'package-archives - '("melpa" . "https://melpa.org/packages/") t) + '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) (require 'use-package) ;; helper functions @@ -40,10 +41,10 @@ (get-text-property 0 'org-hd-marker item))) (line (when marker (org-with-point-at marker - (buffer-substring (line-beginning-position) (line-end-position))))) + (buffer-substring (line-beginning-position) (line-end-position))))) (todo-keyword (when marker (org-with-point-at marker - (org-get-todo-state)))) + (org-get-todo-state)))) (truncated-line (when line (replace-regexp-in-string "^\\[#[A-Z]\\] " "" line)))) (if truncated-line @@ -115,26 +116,26 @@ (require 'server) (unless (server-running-p) (server-start)) (setq backup-by-copying t - completion-cycle-threshold 3 - create-lockfiles nil - custom-file (concat user-emacs-directory "custom.el") - delete-old-versions t - enable-recursive-minibuffers t - focus-follows-mouse t + completion-cycle-threshold 3 + create-lockfiles nil + custom-file (concat user-emacs-directory "custom.el") + delete-old-versions t + enable-recursive-minibuffers t + focus-follows-mouse t indent-tabs-mode nil - inhibit-startup-screen t - kept-new-versions 20 - kept-old-versions 2 - minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt) - mouse-autoselect-window t - read-extended-command-predicate #'command-completion-default-include-p - read-process-output-max (* 1024 1024) - tab-always-indent 'complete + inhibit-startup-screen t + kept-new-versions 20 + kept-old-versions 2 + minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt) + mouse-autoselect-window t + read-extended-command-predicate #'command-completion-default-include-p + read-process-output-max (* 1024 1024) + tab-always-indent 'complete tab-width 4 - text-mode-ispell-word-completion nil + text-mode-ispell-word-completion nil use-short-answers t - version-control t - warning-minimum-level :emergency + version-control t + warning-minimum-level :emergency backup-directory-alist `((".*" . ,(concat user-emacs-directory "backup"))) read-extended-command-predicate #'command-completion-default-include-p text-mode-ispell-word-completion nil @@ -156,7 +157,6 @@ (load-theme 'misterioso) - (put 'upcase-region 'disabled nil) (put 'erase-buffer 'disabled nil) (put 'narrow-to-region 'disabled nil) (put 'narrow-to-defun 'disabled nil) @@ -191,9 +191,9 @@ (use-package multiple-cursors :ensure t :defer t :init (multiple-cursors-mode 1) :bind (("C-x C-<" . 'mc/edit-lines) - ("C->" . 'mc/mark-next-like-this) - ("C-<" . 'mc/mark-previous-like-this) - ("C-x C->" . 'mc/mark-all-like-this))) + ("C->" . 'mc/mark-next-like-this) + ("C-<" . 'mc/mark-previous-like-this) + ("C-x C->" . 'mc/mark-all-like-this))) ;; minibuffer ;; === @@ -286,7 +286,7 @@ :bind ("C-c C-g" . magit-status) :commands (magit-status-here magit-get-current-branch) :custom (magit-display-buffer-function - #'magit-display-buffer-same-window-except-diff-v1)) + #'magit-display-buffer-same-window-except-diff-v1)) ;; diagramming ;; === @@ -299,8 +299,8 @@ (use-package plantuml-mode :ensure t :config (setq plantuml-default-exec-mode 'jar - plantuml-jar-path "/usr/share/plantuml/plantuml.jar" - org-plantuml-jar-path (expand-file-name "/usr/share/plantuml/plantuml.jar")) + plantuml-jar-path "/usr/share/plantuml/plantuml.jar" + org-plantuml-jar-path (expand-file-name "/usr/share/plantuml/plantuml.jar")) (with-eval-after-load 'org (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))))) @@ -333,7 +333,12 @@ (c-mode . eglot-ensure) (c++-mode . eglot-ensure) (js-mode . eglot-ensure) - (typescript-mode . eglot-ensure)) + (typescript-mode . eglot-ensure) + (eglot-managed-mode . (lambda () + (setq-local completion-at-point-functions + (list (cape-super-capf + #'eglot-completion-at-point + #'cape-file)))))) :config (setq eglot-autoshutdown t) (setq eglot-sync-connect 1) @@ -359,7 +364,7 @@ ;; === (use-package ace-jump-mode :ensure t :defer t :bind (("C-c SPC" . ace-jump-mode) - ("C-c DEL" . 'ace-jump-mode-pop-mark))) + ("C-c DEL" . 'ace-jump-mode-pop-mark))) (use-package ace-mc :ensure t :defer t :bind (("C-c >" . 'ace-mc-add-multiple-cursors))) @@ -420,60 +425,60 @@ ;; inline completion (use-package corfu :ensure t - :bind - (us - (:map global-map - ("C-." . completion-at-point)) - :custom - (corfu-auto nil) ;; Enable auto completion - (corfu-separator ?\s) ;; Orderless field separator - (corfu-quit-at-boundary nil) ;; Never quit at completion boundary - (corfu-quit-no-match nil) ;; Never quit, even if there is no match - (corfu-preview-current nil) ;; Disable current candidate preview - (corfu-on-exact-match nil) ;; Configure handling of exact matches - (corfu-echo-documentation nil) ;; Disable documentation in the echo area - (corfu-scroll-margin 5) ;; Use scroll margin + :demand t + :bind ("C-." . completion-at-point) + :custom + (corfu-auto t) ;; Enable auto completion + (corfu-separator ?\s) ;; Orderless field separator + (corfu-quit-at-boundary nil) ;; Never quit at completion boundary + (corfu-quit-no-match nil) ;; Never quit, even if there is no match + (corfu-preview-current nil) ;; Disable current candidate preview + (corfu-on-exact-match nil) ;; Configure handling of exact matches + (corfu-echo-documentation nil) ;; Disable documentation in the echo area + (corfu-scroll-margin 5) ;; Use scroll margin - :init - (global-corfu-mode) + :init + (global-corfu-mode) - :config - ;; Enable Orderless for Corfu - (setq completion-styles '(orderless basic) - completion-category-defaults nil - completion-at-point-functions nil - completion-category-overrides '((file (styles . (partial-completion))))) - - ;; Set up dabbrev as the primary completion source - (setq-local completion-at-point-functions '(dabbrev-completion)) + :hook (eglot-managed-mode . corfu-mode) + + :config + ;; Enable Orderless for Corfu + (setq completion-styles '(orderless basic) + completion-category-defaults nil + completion-at-point-functions nil + completion-category-overrides '((file (styles . (partial-completion))))) + + ;; Set up dabbrev as the primary completion source + (setq-local completion-at-point-functions '(dabbrev-completion)) - ;; Enable kind-icon - (use-package kind-icon - :ensure t - :after corfu - :custom - (kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly - :config - (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter)) + ;; Enable kind-icon + (use-package kind-icon + :ensure t + :after corfu + :custom + (kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly + :config + (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter)) - ;; Add Cape for additional completion sources - (use-package cape - :ensure t - :init - ;; Add `completion-at-point-functions', used by `completion-at-point'. - (add-to-list 'completion-at-point-functions #'cape-file) - (add-to-list 'completion-at-point-functions #'cape-elisp-block) - (add-to-list 'completion-at-point-functions #'cape-dabbrev) - ;;(add-to-list 'completion-at-point-functions #'cape-history) - ;;(add-to-list 'completion-at-point-functions #'cape-keyword) - ;;(add-to-list 'completion-at-point-functions #'cape-tex) - ;;(add-to-list 'completion-at-point-functions #'cape-sgml) - ;;(add-to-list 'completion-at-point-functions #'cape-rfc1345) - ;;(add-to-list 'completion-at-point-functions #'cape-abbrev) - ;;(add-to-list 'completion-at-point-functions #'cape-dict) - ;;(add-to-list 'completion-at-point-functions #'cape-symbol) - ;;(add-to-list 'completion-at-point-functions #'cape-line) - ))) + ;; Add Cape for additional completion sources + (use-package cape + :ensure t + :init + ;; Add `completion-at-point-functions', used by `completion-at-point'. + (add-to-list 'completion-at-point-functions #'cape-file) + (add-to-list 'completion-at-point-functions #'cape-elisp-block) + (add-to-list 'completion-at-point-functions #'cape-dabbrev) + ;;(add-to-list 'completion-at-point-functions #'cape-history) + ;;(add-to-list 'completion-at-point-functions #'cape-keyword) + ;;(add-to-list 'completion-at-point-functions #'cape-tex) + ;;(add-to-list 'completion-at-point-functions #'cape-sgml) + ;;(add-to-list 'completion-at-point-functions #'cape-rfc1345) + ;;(add-to-list 'completion-at-point-functions #'cape-abbrev) + ;;(add-to-list 'completion-at-point-functions #'cape-dict) + ;;(add-to-list 'completion-at-point-functions #'cape-symbol) + ;;(add-to-list 'completion-at-point-functions #'cape-line) + )) ;; better search (use-package consult @@ -536,7 +541,7 @@ ("b" . consult-projectile-switch-to-buffer) ("s" . consult-projectile-switch-project) ("p" . consult-projectile) - ("g" . consult-ripgrep))) + ("/" . consult-ripgrep))) (use-package consult-projectile :ensure t @@ -547,7 +552,7 @@ (advice-add 'projectile-find-dir :override #'consult-projectile-find-dir) (advice-add 'projectile-switch-to-buffer :override #'consult-projectile-switch-to-buffer) (advice-add 'projectile-switch-project :override #'consult-projectile-switch-project) - + ;; Custom function to always use consult-projectile-find-file (defun my-consult-projectile-find-file () "Use consult-projectile-find-file, falling back to consult-projectile if not in a project." @@ -558,3 +563,21 @@ ;; Replace the keybinding in projectile-command-map (define-key projectile-command-map (kbd "f") #'my-consult-projectile-find-file)) + + +;; util +;; ===== + +(use-package elfeed :ensure t :defer t) + +(use-package eshell :ensure t :defer t + :config + (use-package eshell-autojump :ensure t :defer t) + (use-package eshell-bookmark :ensure t :defer t) + (use-package eshell-git-prompt :ensure t :defer t) + (use-package eshell-toggle :ensure t :defer t)) + +(use-package eat :ensure t :defer t) + + +