2

When I opened two split windows for the same buffer and called vim.lsp.buf.definition, if the symbol definition is in the same file, it would always jump to definition in the first window.

Is there a way to jump to definition in current window instead of the first window?

3
  • How exactly are you calling the function? If I open a file, split it, and then type :lua vim.lsp.buf.definition(), I jump in whichever window I am currently in while the other remains as-is. Commented Aug 12, 2024 at 20:39
  • 1
    @carschandler I am using Lazyvim, and I realised it's using reuse_win to jump to definition. Setting it to false solve the problem! Thanks for your help. Commented Aug 15, 2024 at 6:43
  • @ngkaokis THANK YOU. Goodness that was driving me nuts had no idea why that is a default. Commented Jan 16 at 17:59

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.