Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    I am new to projectile. I 'C-c p s s' to search with ag (projectile-ag). I often want to search my use of a particular bit of code in another project so I can pull that code into my current one. However, projectile-ag searches the current project. Projectile-switch-project would work, but, aside from being another step, also seems to want me to open a file in the project I'm switching to. I'd have to switch back into my current project after, as well. Is there a way to simply grep into another project for a string?
    Nate Hardt
    is there a way to search for file:linenumber in a project? seems to be a format commonly found in logs
    i have a project defined as basedir then use: ```
    (defun open-matching-files-goto-line(dir file matcher lineno)
      "Open file if it matches, goto lineno"
      (when (string-equal file matcher)
        (find-file (concat dir file))
        (goto-line (string-to-number lineno))
    (defun find-file-line-in-project (fileline)
      "Find file line in project"
      (interactive "sFind file:line in project: ")
      (let (pt)
         (lambda (dir file) (open-matching-files-goto-line
                             (elt (split-string fileline ":") 0)
                             (elt (split-string fileline ":") 1)
    seems like something that could already exist but haven't found it
    (my lisp is no good)
    Alex Dalshov
    Hi evrryone. I wrote my question on github issue -
    Alex Dalshov
    So Ill duplicate it here. Id like to create project-specific build system - integrate cmake-ide to projectile. I will apreceatecany ideas and hints in that direction. My idea is to replace projectile string with functions (allow string or function). So it will allow to remain current behaviour or use some lisp code
    Andreas Marschke
    https://github.com/andreas-marschke/company-javadoc-lookup open sourced my first company backend, would love to get some feedback, may have missed a few things on making it better. @bbatsov
    Troy Hinckley
    A better forum would be the emacs reddit
    Andreas Marschke
    @CeleritasCelery Yeah you're right. Sorry about that.
    @bbatsov Something I've been wondering about for projectile, the basic configuration for new project types is awesome. But it feels like a limitation that the test/run/building portion is just a string and doesn't allow for a symbol in that spot that would resolve to a function to run to resolve. Is this something I could contribute? I've lightly checked through the code to find the pieces necessary but would love to know if it's something interesting to you too. The idea is that the project configuration points for tests at a function that is executed when you for example call C-c p P or C-c p c and a function would assemble the build call. This would be interesting for example if you wanted to build a function that created the test line based on the file you're currently working on.
    Alex Dalshov
    Andreas Marschke


    Just gonna guage interest in this, if this is something you guys want I'll add docs, tests and provide as MR. cc @bbatsov

    Troy Hinckley
    This Gitter isn’t active. You should probably just open a PR on github and go from there. @andreas-marschke
    How can I for a specific project or in general have projectile ignore git submodules for helm-gitignore?
    Jeremy Cowgar

    Any thoughts on this? I am running Emacs 26 on windows. When switching projects, the command fails. The directory does exist, but I don't know what that extra 'tr' is.

    [helm-current-buffer projectile-project-p buffer-live-p projectile-project-root projectile-current-project-files nil expand-file-name] 8]’
    (file-missing "Setting current directory" "No such file or directory" "c:/Users/jerem/Projects/amps/drgnjs/'tr' is not recognized as an internal or external command,
    operable program or batch file.

    Jeremy Cowgar
    OK, so I add tr to the path and all works :-)
    Francesco Giannelli
    Philipp Meier
    What's a proper / easy way to develop and debug projectile from master with your regular emacs config? (I use spacemacs which ships with melpa projectile)
    Dave Kleinschmidt
    Is there a way to switch project and open VC for the new project in a single command? I'm using projectile with Ivy and when I switch projects with <prefix>-p I have to first select a file to open before I can activate VC.
    Louis Roché
    Hey. I am trying to understand how to use https://projectile.readthedocs.io/en/latest/projects/#customizing-project-root-files but it is not clear yet.
    My goal is to have nested git projects. Let's say I have a directory structure like /a/{b,c}. Folders a, b and c have been created using git clone. From project a, I'd like to be able to use projectile-find-file over files of a, b and c. Am I looking at the good part of the documentation to do that?
    Barry G
    Hello, I’m wondering if I can use projectile-replace only on files with a specific suffix?
    I have a git repo which contains many clojure projects, each in its own subdirectory with a project.clj. Projectile sees the .git as the project root and the project type as 'generic'. Is there a way to get it to see the project.clj as the project root?
    Bruno Furtado
    I never tried but you should be able to customize the project root files as you wish: https://www.projectile.mx/en/latest/projects/#customizing-project-root-files
    I tried removing the "local-file" strategy because my naive guess is that I want bottom-up first but no joy. Time to get out the toolbox
    Aha -- each strategy has its own list of dominating files and "project.clj" was not in projectile-project-root-files-bottom-up
    katco DxyMSw5UUAAQJbD.bin
    katco Ugh sorry. Misclicked share on mobile. For those curious (and star trek fans) here's the tweet https://twitter.com/DevinatelyDevin/status/1088899470060908544?s=20
    Tobias Langer
    Is it possible to register a function as projectile-project-build-cmd / projectile-project-test-cmd (from .dir-locals.el)? I've defined a function (defun foo() "echo foo"), but the returned string won't appear as prompt for the project / won't be executed
    (I'm quite new to elisp so any pointers are helpful, I guess :))
    Louis Roché
       (eval progn
             (require 'projectile)
              "make -C backend" projectile-compilation-cmd-map))))
    I have something like this, not exactly for projectile-project-build-cmd, but maybe it can help
    Tobias Langer
    Excuse me if I don't understand it correctly, but this appears to be a one time thing at startup, doesn't it? What I want is to call (completing-read..) to be called everytime I call projectile-compile-project, so that I can interactively choose between different build targets
    Louis Roché
    yes it is a one time thing when the file is open
    Tobias Langer
    hm, thanks anyway!

    I have asked this question before on /r/emacs, I think asking here may provide me with some insight:

    ```I think projectile and treemacs are independent project and treemacs-projectile is written as helper. However I think I fail to understand the concept of it.

    I want to see all my projectile projects be shows in treemacs as I add them via projectile (and be added to projectile if I add them to treemacs). And if I close a project in either mode it should be closed with all its buffers.

    Right now I achieve the same result by calling commands from each manually. Which is very cumbersome.```

    Reddit link

    Hi! When i call projectile-compile-project in a go project, projectile runs go build ./.... The command finishes without error, but I can find no binary. When I change that to go build, a binary is created.
    • what does ./... mean? I use CLI for ~20 years and have never seen that
    • how can I change the default to go build? I don't want to use C-u C-c p c allways...
    Vladimir Macko
    I am a root project (git repo) A. The '.gitignore' of this project A has a folder B set to ignore. In this folder B I have another folder that is also a git repo C. I am not able to have projectile recognise this folder C as a project. Any pointers? Thanks!
    Mark Lakewood
    Hi all. Im wanting to use projectile, lsp-mode with python but with pyls running in a docker container. I've got pyls and lsp-mode working with docker, but with the command hard-coded to a particular container, what I really want is a function to get the current root directory of the projectile project im working in, so that I can use a standard command to do this.
    Pranaya Behera
    This is my full init.el: https://gist.github.com/shadow-fox/7bd91d02a75aee138be0f137829081b2 , The projectile not able to fetch any the projects. I have ran projectile-discover-project-in-search-path but projectile-known-projects is empty. I have tried with melpa-stable and melpa . Still the issue persists.
    Erik Lovlie
    hello, this question is not directly related to projectile (I think) but hey: when I try to use the abbreviation thingy, e.g. "M-x proj-fi-fi" for "projectile-find-file" I get the completion "project-find-file" and that seems to be the sole completion
    I am however able to run "M-x projectile-find-file" just fine if I type it out
    wonder if anyone have a tip on what could be wrong? I should probably bind it to a key I suppose, but I'd like to understand ... what I don't understand here
    I am using projectile-mode-line but I dont like the project-type showing up ex: projectile[test:generic]. How to remove the :generic part?
    Christopher Batey
    Is there a way to disable auto discovery of a project type? I have quite a few git repos that contain many projects I want to work on separately and anytime I use one of these i end up with the current project being the git repo one level up rather than the sub project
    Christopher Batey
    I removed projectile-project-root-files-bottom-up, let me know if there is a better way of doing it
    Adrian Smith
    I think I'm slowing figuring out how to use projectile, I'm using evil mode if that makes any difference but if I do C-c p f, it lags for a bit then does this: https://i.imgur.com/zgQpEBf.png what do those warnings mean and how do interact with this prompt? when I type anything it disappears