0

I would like a helm replacement for find-file-other-window—one that acts like helm-find-files but has helm-find-files-other-window as the default action.

Is there an easy way to do this?

  • I'm not perfectly clear what you're looking for. In my setup, C-x C-f does helm-find-files, and C-x 4 C-f does find-file-other-window wrapped with a Helm interface. Does that sound like what you want? – Gastove Apr 1 '16 at 22:31
  • I have that too but it doesn't work quite the same way that helm-find-files does. For example, it doesn't seem to have the same behavior for finding files as point. C-h m suggests using the fully featured helm-find-files instead. – Michael Hoffman Apr 2 '16 at 15:58
2

The first action is the default action, so you can change the first element of helm-find-files-actions to helm-find-files-other-window, use e.g.:

(with-eval-after-load 'helm-files
  (push '("Find file other window `C-c o'" . helm-find-files-other-window)
        helm-find-files-actions)
  (delete-dups helm-find-files-actions))

If you use Emacs's custom system, you can also use M-x customise-variable helm-find-files-actions, this way should require less emacs lisp knowledge.


Personally, I use helm-find-files-other-window a lot as well. However, instead of making it as the default action, I just bind a shorter key (M-o) to it.

(define-key helm-find-files-map [?\M-o] #'helm-ff-run-switch-other-window)
  • Very useful! Is there a way to have a new command with this default and still retain the original behavior for helm-find-files? – Michael Hoffman Apr 2 '16 at 15:59
  • Yes, just change the value of helm-find-files-actions locally and call helm-find-files in the new command, for example, (let ((helm-find-files-actions ...)) (helm-find-files)). – xuchunyang Apr 3 '16 at 4:43

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.