diff --git a/core/core-editor.el b/core/core-editor.el index e5dceafcc..7a1364624 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -411,6 +411,16 @@ files, so this replace calls to `pp' with the much faster `prin1'." (server-start))) +(after! tramp + (setq remote-file-name-inhibit-cache 60 + tramp-completion-reread-directory-timeout 60 + tramp-verbose 1 + vc-ignore-dir-regexp (format "%s\\|%s\\|%s" + vc-ignore-dir-regexp + tramp-file-name-regexp + "[/\\\\]node_modules"))) + + ;; ;;; Packages diff --git a/core/core-projects.el b/core/core-projects.el index 32860d3fe..abcaa31b9 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -36,7 +36,15 @@ debian, and derivatives). On most it's 'fd'.") projectile-kill-buffers-filter 'kill-only-files projectile-known-projects-file (concat doom-cache-dir "projectile.projects") projectile-ignored-projects '("~/") - projectile-ignored-project-function #'doom-project-ignored-p) + projectile-ignored-project-function #'doom-project-ignored-p + + ;; The original `projectile-default-mode-line' can be expensive over + ;; TRAMP, so we gimp it in remote buffers. + projectile-mode-line-function + (lambda () + (if (file-remote-p default-directory) + (projectile-default-mode-line) + ""))) (global-set-key [remap evil-jump-to-tag] #'projectile-find-tag) (global-set-key [remap find-tag] #'projectile-find-tag) @@ -147,13 +155,14 @@ c) are not valid projectile projects." ;; HACK Don't rely on VCS-specific commands to generate our file lists. That's ;; 7 commands to maintain, versus the more generic, reliable and ;; performant `fd' or `ripgrep'. - (defadvice! doom--only-use-generic-command-a (vcs) + (defadvice! doom--only-use-generic-command-a (fn vcs) "Only use `projectile-generic-command' for indexing project files. And if it's a function, evaluate it." - :override #'projectile-get-ext-command - (if (functionp projectile-generic-command) + :around #'projectile-get-ext-command + (if (and (functionp projectile-generic-command) + (not (file-remote-p default-directory))) (funcall projectile-generic-command vcs) - projectile-generic-command)) + (funcall fn vcs))) ;; `projectile-generic-command' doesn't typically support a function, but my ;; `doom--only-use-generic-command-a' advice allows this. I do it this way so