Closed dcollinsn closed 6 years ago
Look at the settings listed under :CommandTOpen
:
If you override g:CommandTAcceptSelectionSplitCommand
and friends, you can implement arbitrary logic. The simplest version would be to set it to sp
instead of CommandTOpen sp
(the latter goes to great lengths to re-open things in their existing splits if the item in question is already open, which in your case is not what you want).
@dcollinsn I have this setup in my vimrc:
let g:CommandTAcceptSelectionCommand = 'e'
let g:CommandTAcceptSelectionSplitCommand = 'sp'
let g:CommandTAcceptSelectionTabCommand = 'CommandTOpen tabe'
let g:CommandTAcceptSelectionVSplitCommand = 'vs'
here CommandTOpen
command is used only when opening file in a new tab since usually I don't need to "intelligently find" file in current tab - I see all the files in current tab and if I open file, say, via <Enter>
I usually mean to open that file in currently focused window without trying to find it in other windows (just like in your case). Same for opening file in either horizontal or vertical split.
Closing as I believe this is covered by the settings.
vim a.txt
:vsp
<leader>t b.txt <enter>
<leader>t a.txt <enter>
Expected:
'a.txt' will be open in both splits
Actual:
'a.txt' will be open in the left split, 'b.txt' will be open in the right split, and the left split will have "focus"
This used to work as I expected, I think it changed around the same time as you fixed #295? I'd like to be able to open the same file in multiple splits so that I can view one part of a file while editing a different part.
Is there a configuration option to restore the old behaviour?