14

Helm seem to support marking files in helm-find-files. Is it possible to open the marked files, each one inside of its own buffer from within the find file buffer?

Update: I noticed that I was using helm-projectile-switch-project rather than the Helm enhanced find-file command.

2 Answers2

17

Yes, use C-SPC to mark each file individually or mark all with M-a, then press RET to open all those files. I wrote a Helm guide here that covers Helm basics and most of default commands. Also check my helm-projectile. It has the multifile opening right at the beginning.

Aside from the answer above, the question was updated with the question to open multiple files using helm-projectile-switch-project. To use helm-projectile-switch-project to switch to another project and open multiple files, either helm-projectile or helm-projectile-find-file must be set to projectile-switch-project-action:

(setq projectile-completion-system 'helm
      projectile-switch-project-action 'helm-projectile)

After that, you can open files in any project (including current projejct) without ever leaving your current working project. This is also explained in Enter project portal: helm-projectile-switch-project, C-c p p in my guide.

Tu Do
  • 6,772
  • 20
  • 39
  • @Andrea It works a long time ago. Probably you didn't notice, or use `find-file` with Helm's `completing-read`, not `helm-find-files`. – Tu Do Oct 10 '14 at 14:41
  • Most probably I was too distracted with the task at hand and never noticed the buffers were actually being opened! Thanks. –  Oct 10 '14 at 14:43
  • I figured what's the problem: regardless of the marks I set, if I press RET over an unmarked file, then only that file will be opened in a buffer. –  Oct 10 '14 at 14:55
  • @Andrea No it's not. If you marked files, Helm always opens marked files regardless where the highlighter is. – Tu Do Oct 10 '14 at 14:59
  • 1
    Aha, you are right. Although that's not the case inside the *helm completion* buffer opened with Projectile! –  Oct 10 '14 at 15:13
  • @Andrea It's the same. Did you use `helm-projectile-find-file` command or `projectile-find-file` with Helm's `completing-read`? If not, you should activate `helm-projectile` with `(helm-projectile-on)`. [A demo](http://tuhdo.github.io/helm-projectile.html) at the top of my guide. – Tu Do Oct 10 '14 at 15:19
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/17776/discussion-between-andrea-and-tu-do). –  Oct 10 '14 at 15:21
  • I think It's worth updating your answer to reflect the fact that setting the `projectile-completion-system` and `projectile-switch-project-action` variables did the trick for me. –  Oct 10 '14 at 16:10
  • @Andrea updated. – Tu Do Oct 10 '14 at 16:45
  • ```(setq projectile-completion-system 'helm) (setq projectile-switch-project-action 'helm-projectile) (helm-projectile-on) ``` – Javed Dec 03 '19 at 10:41
0

This worked for me

(projectile-mode +1)                                                                                                         
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)                                                         
;; projectile with helm                                                                                                      
(projectile-global-mode)                                                                                                     
(setq projectile-completion-system 'helm)                                                                                    
(setq projectile-switch-project-action 'helm-projectile)                                                                     
(helm-projectile-on) 
Javed
  • 111
  • 3