Change back to project.el (faster in tramp)

This commit is contained in:
Zelong Kuang
2026-04-11 18:14:44 +10:00
parent 4a0416dd54
commit 955e6174cc
3 changed files with 18 additions and 84 deletions

View File

@@ -176,12 +176,12 @@ If this is a daemon session, load them all immediately instead."
(setq make-backup-files nil)
(setq use-short-answers t)
(setq frame-title-format
'((:eval (if (and (boundp 'projectile-mode)
projectile-mode
(projectile-project-p))
(format "[%s] %s" (projectile-project-name) (buffer-name)) ;; Add project name in front when avaliable
"%b")))) ;; Otherwise buffer name only
(setq custom-safe-themes t)
'((:eval
(let* ((proj (project-current nil))
(pname (and proj (project-name proj))))
(if pname
(format "[%s] %s" pname (buffer-name))
(buffer-name)))))) ;; Otherwise buffer name only
(add-to-list 'default-frame-alist '(drag-internal-border . 1))
(add-to-list 'default-frame-alist '(internal-border-width . 5))
@@ -271,7 +271,6 @@ If this is a daemon session, load them all immediately instead."
(use-package tramp-rpc
:ensure (tramp-rpc :host github :repo "ArthurHeymans/emacs-tramp-rpc")
:config
(tramp-rpc-magit-enable)
(tramp-rpc-projectile-enable))
(tramp-rpc-magit-enable))
(provide 'init-better-default)

View File

@@ -1,60 +0,0 @@
;; -*- lexical-binding: t; -*-
(use-package treemacs
:custom-face
(cfrs-border-color ((t (:inherit posframe-border))))
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
:config
(pcase (cons (not (null (executable-find "git")))
(not (null (executable-find "python3"))))
(`(t . t)
(treemacs-git-mode 'deferred))
(`(t . _)
(treemacs-git-mode 'simple)))
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0)
treemacs-missing-project-action 'remove
treemacs-user-mode-line-format 'none
treemacs-sorting 'alphabetic-asc
treemacs-follow-elpaca-after-init t
treemacs-width 30
treemacs-show-hidden-files nil
treemacs-silent-refresh t
treemacs-no-png-images 1)
:bind
(:map global-map
("M-0" . treemacs-select-window)
("C-x t 1" . treemacs-delete-other-windows)
("C-c o p" . treemacs)
("C-x t d" . treemacs-select-directory)
("C-x t B" . treemacs-bookmark)
("C-x t C-t" . treemacs-find-file)
("C-x t M-t" . treemacs-find-tag)))
(use-package treemacs-magit
:hook ((magit-post-commit
git-commit-post-finish
magit-post-stage
magit-post-unstage)
. treemacs-magit--schedule-update))
(use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode
:after (treemacs)
:ensure t
:config (treemacs-set-scope-type 'Tabs))
(use-package treemacs-nerd-icons
:demand t
:config (treemacs-nerd-icons-config))
(use-package treemacs-persp
:after (treemacs persp-mode)
:demand t
:functions treemacs-set-scope-type
:config (treemacs-set-scope-type 'Perspectives))
(use-package treemacs-projectile
:after (treemacs projectile-mode))
(provide 'init-treemacs)

View File

@@ -1,14 +1,7 @@
;; -*- lexical-binding: t; -*-
;; (use-package project)
(use-package projectile
:hook elpaca-after-init
:config
;; Recommended keymap prefix on macOS
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
;; Recommended keymap prefix on Windows/Linux
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map))
(use-package project)
(use-package ibuffer
:ensure nil
@@ -22,20 +15,22 @@
(use-package nerd-icons-ibuffer
:ensure t
:hook (ibuffer-mode-hook . nerd-icons-ibuffer-mode))
(use-package ibuffer-projectile
:init
(add-hook 'ibuffer-hook
(lambda ()
(ibuffer-projectile-set-filter-groups)
(unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic)))))
;; Group ibuffer's list by project
(use-package ibuffer-project
:autoload (ibuffer-project-generate-filter-groups ibuffer-do-sort-by-project-file-relative)
:hook (ibuffer . (lambda ()
"Group ibuffer's list by project."
(setq ibuffer-filter-groups (ibuffer-project-generate-filter-groups))
(unless (eq ibuffer-sorting-mode 'project-file-relative)
(ibuffer-do-sort-by-project-file-relative))))
:init (setq ibuffer-project-use-cache t))
(use-package beframe
:hook elpaca-after-init
:bind ("C-x f" . other-frame-prefix)
:config
(define-key global-map (kbd "C-c b") #'beframe-prefix-map)
(setq beframe-functions-in-frames '(projectile-switch-project)
(setq beframe-functions-in-frames '(project-switch-project)
beframe-rename-function #'ignore
beframe-global-buffers '("*scratch*" "*Messages*" "*Backtrace*"))
(use-package embark