I have new windows be opened in a split-window-horizontally way, but I want this specific lsp-find-references to be opened with split-window-vertically.

Is there any way to set this preference for this command?

..or, is there a way to call this function, telling it to open in the same window?

I have the same issue with M-x compile, as I want the compilation buffer to be on the vertical split.


1 Answer 1


You should check the manual before asking this type of question (and search for duplicate questions, of course). See chapter 21.6 Displaying a Buffer in a Window of the Emacs manual. In particular, subsection 21.6.1 How ‘display-buffer’ works tells you how to customize the behavior of display-buffer, which commands such as lsp-find-references and compile all use, in various ways.

Most importantly for you, you can customize the behavior by modifying display-buffer-alist to have an appropriate action function (such as display-buffer-below-selected perhaps) for buffers of a given name (such as "*Compile*" or whatever lsp-find-references uses).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.