summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--user/emacs/init.el55
-rw-r--r--user/settings/emacs.nix4
2 files changed, 19 insertions, 40 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index b78c30cd..ba2845f2 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -109,7 +109,7 @@
                   doom-modeline-buffer-modification-icon nil
                   doom-modeline-checker-simple-format t
                   doom-modeline-percent-position nil
-                  doom-modeline-project-detection 'projectile
+                  doom-modeline-project-detection 'project
                   doom-modeline-vcs-max-length 24
                   doom-modeline-height 28)
             (let ((foreground (face-attribute 'font-lock-comment-face :foreground)))
@@ -216,13 +216,7 @@ With two prefix arguments, write out the day and month name."
 (use-package savehist
   :init (savehist-mode +1)
   :config (progn
-            (add-to-list 'savehist-additional-variables 'command-history)
-            (add-to-list 'savehist-additional-variables 'projectile-configure-cmd-map)
-            (add-to-list 'savehist-additional-variables 'projectile-compilation-cmd-map)
-            (add-to-list 'savehist-additional-variables 'projectile-install-cmd-map)
-            (add-to-list 'savehist-additional-variables 'projectile-package-cmd-map)
-            (add-to-list 'savehist-additional-variables 'projectile-test-cmd-map)
-            (add-to-list 'savehist-additional-variables 'projectile-run-cmd-map)))
+            (add-to-list 'savehist-additional-variables 'command-history)))
 
 (use-package vertico
   :ghook ('after-init-hook #'vertico-mode))
@@ -247,12 +241,13 @@ With two prefix arguments, write out the day and month name."
 			completion-category-overrides '((file (styles basic partial-completion))))
 
 (use-package consult
-  :after projectile
   :general ([remap isearch-forward] #'consult-line
             [remap isearch-backward] #'consult-line
-            [remap projectile-switch-to-buffer] #'consult-project-buffer
-            [remap projectile-ag] #'consult-ripgrep
-            [remap projectile-ripgrep] #'consult-ripgrep))
+            [remap project-search] #'consult-ripgrep))
+
+(use-package consult-project-extra
+  :general ([remap project-switch-to-buffer] #'consult-project-buffer
+            [remap project-find-file] #'consult-project-find-file))
 
 (use-package smerge-mode
   :after magit
@@ -643,10 +638,8 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
                                             (delete-window))))))
 
 (use-package eshell-toggle
-  :after projectile
   :commands (eshell-toggle)
-  :general ("C-`" #'eshell-toggle)
-  :config (setq eshell-toggle-use-projectile-root t))
+  :general ("C-`" #'eshell-toggle))
 
 (use-package capf-autosuggest
   :after eshell
@@ -903,30 +896,18 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
 
 ;;; Projects
 
-(use-package projectile
-  :defer 1
-  :defines projectile-command-map
+(use-package project
+  :general (:keymaps 'project-prefix-map
+                     "s" #'project-search
+                     "o" #'consult-ghq-switch-project)
   :config (progn
-            (add-to-list 'projectile-globally-ignored-files "package-lock.json")
-            (add-to-list 'projectile-globally-ignored-files "pnpm-lock.yaml")
-            (add-to-list 'projectile-project-root-files "package.json")
-            (add-to-list 'projectile-project-root-files-bottom-up "pnpm-workspace.yaml")
-            (setq projectile-kill-buffers-filter 'kill-only-files
-                  projectile-sort-order 'modification-time
-                  projectile-project-search-path '(("~/projects/" . 2))
-                  projectile-auto-discover nil
-                  projectile-dynamic-mode-line nil)
-            (projectile-mode +1)
             (with-eval-after-load 'evil-ex
-              (evil-ex-define-cmd "rg" #'ripgrep-regexp)
-              (evil-ex-define-cmd "prg" #'projectile-ripgrep)
-              (evil-ex-define-cmd "pesh[ell]" #'projectile-run-eshell)
-              (evil-ex-define-cmd "pb" #'projectile-switch-to-buffer)
-              (evil-ex-define-cmd "psw[itch]" #'projectile-switch-project))))
+              (evil-ex-define-cmd "pesh[ell]" #'project-eshell)
+              (evil-ex-define-cmd "pb" #'project-switch-to-buffer)
+              (evil-ex-define-cmd "psw[itch]" #'project-switch-project))))
 
 (use-package envrc
   :defer 2
-  :after projectile
   :config (progn
             (envrc-global-mode)))
 
@@ -934,6 +915,7 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
   :defer 5
   :commands (magit-status magit-dispatch)
   :init (customize-set-value 'magit-auto-revert-mode nil)
+  :general ([remap project-vc-dir] #'magit-status)
   :config (progn
             (setq magit-section-visibility-indicator nil
                   magit-diff-refine-hunk 'all
@@ -1028,9 +1010,6 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
 (use-package tree-sitter-indent
   :ghook ('(rustic-mode-hook)))
 
-(unless (fboundp 'project-name)
-  (defun project-name (project)
-    (file-name-base (cdr project))))
 (use-package eglot
   :defer 30
   :general (:states 'normal :keymaps 'eglot-mode-map
@@ -1170,7 +1149,7 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
   "c" (general-simulate-key "C-c")
   "j" #'consult-eglot-symbols
   "q" #'evil-delete-buffer
-  "p" '(:keymap projectile-command-map :package projectile)
+  "p" '(:keymap project-prefix-map :package project)
   "v" #'split-window-right
   "o" #'other-window
   "u" #'universal-argument
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 12eafe0c..ae85a61c 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -75,7 +75,7 @@ in
         kx = "kubectx $*";
         kns = "kubens $*";
 
-        cdg = "cd (projectile-project-root)";
+        cdg = "cd (project-root)";
       };
     };
     extraPackages = epkgs: (with epkgs;
@@ -91,6 +91,7 @@ in
         company-tabnine
         consult
         consult-eglot
+        consult-project-extra
         counsel
         crux
         dired-git-info
@@ -144,7 +145,6 @@ in
         nerd-icons
         doom-modeline
         posframe
-        projectile
         quickrun
         rainbow-mode
         rainbow-delimiters