top | item 44077638

(no title)

phforms | 9 months ago

I guess you already know the command `dired-find-file-other-window` (bound to `o` by default), which reuses the right split window, if already there and opens a new window if there is none. Horizontal splits do not seem to be reused though (they often don’t have enough vertical space for dired anyway, which is why I guess they designed it this way).

discuss

order

ww520|9 months ago

Yes. dired-find-file-other-window is the one I found annoying. It moves the cursor/focus to the other window, and it keeps opening new split windows. If I ran the cmd 3 times, it would open 3 new split windows. Really annoying.

I want the cursor/focus to remain on the dired window so that I can go down the file list and see the file content on the other window. Ctrl-n and ctrl-o are all I need to do.

phforms|9 months ago

Okay, I can see the issue now, maybe I haven’t really used dired intensely enough for it to bother me. I just tried your snippet and having the cursor remain on the dired buffer for a quick preview is a feature I didn’t know I needed. Thanks for sharing!