5

This question already has an answer here:

Very often I need to open a file in dired in other window and for that dired-find-file-other-window comes handy, but sometimes I want to open file in specific split - vertical or horizontal. So if I have:
two windows (with dired on the left)

  |-----------+-----------|
  | -window1- | -window2- |
  | file1     |           |
  | file1     |           |
  | file3     |           |

and want to explicitly tell dired to open file:

either by creating a vertical split in window1:

  |-----------+-----------|
  | -window1- | -window2- |
  | file1     |           |
  |-----------+           |
  | (content) |           |

or in window2 (which is usually a default behavior of dired-find-file-other-window:

  |-----------+-----------|
  | -window1- | (content) |
  | file1     |           |
  | file1     |           |
  | file3     |           |

or below window2 (by creating vertical split in window2):

  |-----------+-----------|
  | -window1- | -window2- |
  | file1     |           |
  | file1     |           |
  | file3     +-----------|
  |           | (content) |

or by creating horizontal split (adding new window to the right of window2):

  |-----------+-----------+-----------|
  | -window1- | -window2- | (content) |
  | file1     |           |           |
  | file1     |           |           |
  | file3     |           |           |

Is there a package for doing something like that? If not, can someone help me writing a function/functions?

marked as duplicate by lawlist, Drew, Community Nov 7 '16 at 17:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.