Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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.
@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.
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.set switchbuf=useopen
then use<c-w><c-]>
nnoremap <silent> <c-w>] :vert winc ]<cr>