Emacs弹丸在一个项目中有多个repos(git/svn等)

guo*_*oxx 8 git emacs emacs-projectile

我有一个git repo,其目录结构如下所示:

root ---------- src
        |
        |
        |------ 3rd
Run Code Online (Sandbox Code Playgroud)

root是我的工作目录,3rd由多个第三方git子模块组成.
projectile-find-file只查找文件src,它不适用于子模块.

guo*_*oxx 6

projectile-git-command用于git ls-files列出属于项目的文件,
因此我使用以下代码解决了问题:

(setq projectile-git-command "git-ls-all-files")
Run Code Online (Sandbox Code Playgroud)

git-ls-all-files 是一个shell脚本:

\#!/bin/zsh
files=`git ls-files -co --exclude-standard`
sb_files=`git --no-pager submodule --quiet foreach 'git ls-files --full-name -co --exclude-standard | sed s!^!$path/!'`
all_files=$files$sb_files

echo $all_files
Run Code Online (Sandbox Code Playgroud)


Mik*_*H-R 5

我只是有一个同样的问题,我通过.projectile在我的root目录中添加一个空文件来修复它,这告诉抛射物该目录是真正的项目根目录,并且当你想要找到某些东西时搜索它的子目录中的所有文件.

有关详细信息,请参见此处