I like what the shortcut Ctrl+Wf does, but I want to have a vertical split instead of horizontal.
I managed to achieve this by defining the following mapping:
nnoremap <c-w>f :vertical wincmd f<cr>
and in normal mode it works perfectly. But I failed to do the same for visual mode.
What I have tried so far:
" This yields 'E481: No range allowed
vnoremap <c-w>f :vertical wincmd f<cr>
" This just ignores my selection and behaves like <c-w>f in normal mode,
" i.e. attempts to open the file under cursor
vnoremap <c-w>f :<c-u>vertical wincmd f<cr>
How can I do such a thing for the visual mode?
<C-W>f
is only defined for Normal mode. What makes you think it'll be of use in Visual mode too?/home/ovandriyanov
and visually select only/home
, then vim opens/home
, while in normal mode it opens/home/ovandriyanov
. The only thing I would like to change is to have vertical split instead of horizontal.