11

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.

13

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.

  • @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. – user66 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. – user66 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! – user66 Oct 10 '14 at 15:13
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) 

Your Answer

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