6

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?

Drew
  • 75,699
  • 9
  • 109
  • 225
iLemming
  • 1,223
  • 9
  • 14

0 Answers0