set scrollopt+=hor
set scrollopt-=ver
set nowrap
set mouse=a
2split
windo set scrollbind
set statusline=%F%m%r%h%w[%{&ff}]%y%p%%\ %04l\/%04L\ Oc:Hx\ %b:%B%=%qF[%n]%t
Above .vimrc is working quite well for me but I'd like to start already in that second (main split) ready to scroll with mouse etc rather than having to click into it from the first split - which is intended to work as a header...
Really surprised I have not managed to find this anywhere yet!
I am issuing vim file_to_inspect
to start Vim.
If it is not possible to be directly in split 2 by .vimrc but the command line can do it that would be second best, then a fix up in my shell would allow:
vim -{some opts} file_to_inspect
(My second day of looking into vim, getting a bit polished in a few places but lots of rooms to explore.)
Things tried:
:wincmd k (&j)
within vim typing the command :wincmd j & then wincmd k DO toggle me between splits in the same way that <C-w> j & k do.
Line placed in .vimrc I arrive in 1st split (the header) either (j or k variant) line at the end of .vimcr made no difference in either case. Here is the file I tried with j as last char (I tried k too).
:set scrollopt+=hor
:set scrollopt-=ver
:set nowrap
:set mouse=a
:2split
:windo set scrollbind
:set statusline=%F%m%r%h%w[%{&ff}]%y%p%%\ %04l\/%04L\ Oc:Hx\ %b:%B%=%qF[%n]%t
:wincmd j
Tried autocmd VimEnter * winced j
and that is what I needed.
@Tumbler41 Thanks! If you'd like to make an answer I can accept it.
(NO idea why the rather obvious winced did not work - my first noob stab at that yesterday was to try and enter the ctrl-w command somehow directly in .vimrc)
:h :wincmd
? Does addingwincmd k
solves your problem?wincmd
(stackoverflow.com/questions/8822237/…) but it doesn't seem to work upon starting vim. Maybe an autocmd is needed there ? I can't find it so far...wincmd
to your.vimrc
? (Edit your question to show what you tried please)autocmd VimEnter * wincmd j
. That works. Not sure why it wouldn't work straight from vimrc though.