1

I usually always have only two vertical splits open. One I use for actual coding and the other for reference. I would like to be able to search for tag in Window1 and have the result appear in Window2. Is this possible?

  • Assuming you only want your "tag-split" to appear on the right split always and when there is only two vertical splits, it's not that hard. I could think of some keymappings like, nnoremap <c-]> <c-w>o<c-w>v<c-w>l<c-]> But that's lazy. If you find yourself doing that often enough, then you should consider building a function for it. – klaus Jun 3 '18 at 7:02
  • set switchbuf=useopen then use <c-w><c-]> – Mass Jun 3 '18 at 23:23
  • @EnanAjmain Thanks that does work. It does seem messy and does assume that the specific position of the window. But should work in my case. – Phaino Jun 4 '18 at 3:36
  • @Mass I tried that and wasn't able to get it to work. It always does a split instead of a vsplit. Although, I do actually like that functionality and will probably use it in the future. Thanks for pointing it out. – Phaino Jun 4 '18 at 3:38
  • yes, unfortunately there is no way to have it always open vertically, but you can use a mapping: nnoremap <silent> <c-w>] :vert winc ]<cr> – Mass Jun 4 '18 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.