5

My Emacs system satisfies the following three conditions:

  1. The Emacs packages helm and helm-projectile are installed on it.
  2. The directory ~/MyProj/ is recognized as a projectile project (it is a Git directory).
  3. ~/MyProj/ contains the following text files (and possibly other files):
    • README.md
    • file1
    • file2

Consider the following scenario:

  1. Open a new Emacs session.
  2. Execute M-x cd <RET> ~/MyProj <RET> to switch the default directory to the project directory.
  3. Execute C-c p f to run the projectile-find-file command.

The mini-buffer now displays:

[-] Find file: {README.md | file1 | file2}

projectile-find-file

Why are the completions listed horizontally in the mini-buffer rather than vertically in a separate helm window, as is the norm with helm commands? Compare the above screencap to the following, resulting from executing C-x c C-x C-f (= helm-find-files).

helm-find-files

I find the latter display style more convenient that the former. Is it possible to view the results of the various projectile commands this way?

5

Set projectile-completion-system to helm:

(setq projectile-completion-system 'helm)

Or try enabling helm-projectile like this:

(helm-projectile-on)
  • Thanks. Are you sure the second line is necessary? It appears to work fine without it. – Evan Aad Jun 4 '17 at 8:53
  • I'm not sure, the doc says it just enables some keybindings. – mkcms Jun 4 '17 at 8:54
  • Which doc? Could you please provide a link? – Evan Aad Jun 4 '17 at 8:56
  • 2
    I think I've figured out what the helm-projectile-on function do: It routes every invocation of a projectile-... function to the corresponding helm-projectile-... function. So, for example, while executing C-c p f normally invoke the projectile-find-files function, if the helm-projectile-on function is in effect (e.g. if it's been invoked when .emacs was loaded), then the helm-projectile-find-files function will be invoked instead. Thus the two lines in your answer describe two alternative ways to accomplish the same result. There is no need to use them simultaneously. – Evan Aad Jun 4 '17 at 10:31
  • 1
    I've edited my answer to include this information. – mkcms Jun 4 '17 at 11:17
0

C-c p h will ask you to select a project. It will then launch the projectile-find-files command with a helm-style completion list. In fact, all the helm-projectile... commands (e.g. helm-projectile, which is bound to C-c p h), will employ helm-style completion lists. See here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.