Skip to main content
8 votes

What is the easiest way to search all useful files inside a single project?

If your project uses Git, you only need counsel https://github.com/abo-abo/swiper counsel-git to find file counsel-git-grep to grep The only dependency is git Text grepping is faster than the ...
chen bin's user avatar
  • 4,897
7 votes

Set author per repository

you can do this with one-time git configuration. you can use it for email and so on, but also for using a different ssh key: in ~/.gitconfig: [includeIf "gitdir:~/work/"] path = .gitconfig_work in ~...
wouter bolsterlee's user avatar
5 votes
Accepted

Change C indent style for specific project?

A .dir-locals.el file would certainly do the trick! I like to use the function (add-dir-local-variable MODE VARIABLE VALUE) rather editing .dir-locals.el manually. For those two values eval (let ((...
ebpa's user avatar
  • 7,529
4 votes
Accepted

How to open a folder as project in emacs?

Emacs packages will automatically find the project root, company-gtags (for code completion) from https://github.com/company-mode/company-mode counsel-git-grep (for grepping) and counsel-git (for ...
chen bin's user avatar
  • 4,897
4 votes

Set author per repository

Anoter useful option is the git-identity package. From its README: This Emacs package lets you manage local Git identities, i.e. user.name and user.email options in .git/config, inside Emacs. It ...
Manuel Uberti's user avatar
3 votes

Projectile buffer names with project relative filenames

Actually, not quite as difficult as it seemed, added this to my init.el and it seems to work: (defun my-proj-relative-buf-name () (rename-buffer (file-relative-name buffer-file-name (projectile-...
Michael's user avatar
  • 151
3 votes

Emacs "context" plugin for switching between different tasks in one project without loosing concentration

Dunno exactly what constitutes a "project" in your context, but have a look at desktop bookmarks, with Bookmark+. An Emacs desktop records (and subsequently restores) the kinds of thing you mention: ...
Drew's user avatar
  • 78.1k
3 votes

Projectile switch between opened projects

What I would want is a function or a package that could display all opened projectile projects with ivy or helm and let me choose a candidate. When the candidate would be selected, the last buffer ...
Basil's user avatar
  • 12.5k
3 votes
Accepted

project.el: override project root with dir-local var?

I ran into this, too, and published the project-find-functions hook I use on https://michael.stapelberg.ch/posts/2021-04-02-emacs-project-override/: ;; Returns the parent directory containing a ....
Michael's user avatar
  • 156
2 votes

project.el: override project root with dir-local var?

No buffer-local vars available as an option, but you can add your own element to project-find-functions which would call project-current in some parent directory.
Dmitry's user avatar
  • 3,813
2 votes

Projectile switch between opened projects

As @Swedgin said in comments projectile-switch-open-project will work without doing nothing more. Given that you want to switch to an open project buffer, you should also customize projectile-switch-...
Muihlinn's user avatar
  • 2,664
2 votes
Accepted

How change name of file "projects" and set it in init.el?

You can customize the variable project-list-file. For example, try (setq project-list-file "~/.emacs.d/projects-laptop"). The variable docstring says "File in which to save the list of ...
Swarnendu Biswas's user avatar
2 votes
Accepted

How do I bind C-x p to the project.el project-prefix-map?

I found that upgrading the project.el package to 0.5.3 fixes the binding problem. To do this I first had to fix the GNU TLS algorithm priority as described in this Emacs Stack Exchange answer. Once ...
afrosteve's user avatar
  • 131
2 votes
Accepted

project.el: override project-find-regexp with use-package to show live results like project-find-file (preferably with consult)?

You cat just use consult-ripgrep to override project-find-regexp through: (advice-add #'project-find-regexp :override #'consult-ripgrep)
Tianshu Wang's user avatar
  • 1,784
2 votes
Accepted

Moving from VSCode: suggest a workflow that does not involve the tree view

This question will be closed because it is opinion–based and therefore not a good fit for StackExchange, but I’ll answer it any way. I use Projectile, which is a small Emacs package that adds project–...
db48x's user avatar
  • 18.5k
1 vote

How can I change the default shell Project.el uses?

Not without editing the source. If you look at the definition of project-shell in project.el you will see that it calls the shell function. The shell function starts shells, not vterms. If you look a ...
db48x's user avatar
  • 18.5k
1 vote

project-find-file completion and navigation

You can install a package which replaces the traditional completion interface, such as https://elpa.gnu.org/packages/counsel.html or https://elpa.gnu.org/packages/vertico.html. Or indeed https://...
Dmitry's user avatar
  • 3,813
1 vote
Accepted

Org-capture template extension with project name

Thanks for the pointer @Fran Burstall. :-) I was able to get the desired behavior with a custom funtion: (defun gkh/project-current-name () "Get the name of the current project by returning the ...
grszkthfr's user avatar
1 vote

Projectile switch between opened projects

Try this. (defun smart-switch-project () ...
hao li's user avatar
  • 111
1 vote

Finding in certain projects only files with particular extensions when doing a project(ile) grep

C-u M-x project-find-regexp. See its documentation, project-find-regexp is an interactive Lisp closure in ‘project.el.gz’. (project-find-regexp REGEXP) Probably introduced at or before Emacs ...
chen bin's user avatar
  • 4,897
1 vote

Finding in certain projects only files with particular extensions when doing a project(ile) grep

The help for projectile-grep mentions the setting projectile-grep-default-files. I believe that you could use directory–local variables to set this to the correct value on a per–project basis, but I’...
db48x's user avatar
  • 18.5k
1 vote
Accepted

"VC method not implemented for backend" for project-find call

For a quick workaround, you can try adding this definition to your init script: (defun vc-cvs-find-ignore-file (file) (expand-file-name ".cvsignore" (file-name-directory file)))
Dmitry's user avatar
  • 3,813
1 vote
Accepted

Why are my dir-locals always malformed

For the original question (repeating my comment): As others have pointed out, that value needs to be a string: "/usr/bin/php". You need to manually type the quotes because add-dir-local-variable has ...
phils's user avatar
  • 51.8k
1 vote

How to use xref-find-references on Elisp files without "No references found for" errors

Note: This is a very complicated solution. See How to use xref-find-references on Elisp files without "No references found for" errors for when I came to my senses and simplified things. ...
bgoodr's user avatar
  • 361
1 vote

How to use xref-find-references on Elisp files without "No references found for" errors

xref provides UI for code navigation. The actual functionalities are provided by the backend. In you case, the backend is etags. If you open TAGS file, its format is very simple. It has only the ...
chen bin's user avatar
  • 4,897
1 vote

Setup find-file-at-point to treat tilde as project root

Use https://github.com/technomancy/find-file-in-project (ffip). What ~ means does not matter. ffip will try to find file in project root using the file name under cursor. Example, https://emacs....
chen bin's user avatar
  • 4,897
1 vote

Setup find-file-at-point to treat tilde as project root

This custom function finds the file as described by looking for the src directory of the file currently being visited and assumes that the directory one above is the cwd. As a consequence it only ...
Hubisan's user avatar
  • 1,745
1 vote

C Source code browsing similar to eclipse

For C developers, I suggest ctags. The problem of GNU Gloal is that it treats the function declaration as reference. That's awkward if you want to check the declaration of function ONLY. C++ code ...
chen bin's user avatar
  • 4,897
1 vote

C Source code browsing similar to eclipse

I could think of two solutions as of now, Speedbar mode - A separate frame pop-ups with the list of files/folders related to the current project. More Info (https://www.emacswiki.org/emacs/SpeedBar). ...
Hariharan's user avatar
  • 473
1 vote

What is the easiest way to search all useful files inside a single project?

M-x rgrep search-pattern *.[c,h]
mcp's user avatar
  • 556

Only top scored, non community-wiki answers of a minimum length are eligible