I do not know how to switch to a window based on the file name, but I use the following shortcuts in mine .vimrcto move between windows.
noremap <S-W> <C-w><Up>
noremap <S-S> <C-w><Down>
noremap <S-A> <C-w><Left>
noremap <S-D> <C-w><Right>
It is just as simple, and I do not have more than four windows, so I have no more than 2 windows from any window. In addition, you do not need to enter a file name.
FPS, wasd, , , - , . , (hjkl )
Shift Ctrl/Alt/Option/Cmd, (, Fn macbook pro, Ctrl Mac) vim Linux, Cmd.