I am trying to apply the following setting for my .tex
files:
set scroll=4
I've put this both in my ~/.vimrc
and in my ~/.vim/ftplugin/tex.vim
file.
For general files, this works fine. For .tex
files, all other settings in these files are applied. But not the scroll setting.
Note: I have latex-suite installed, which is what I suspect is overriding the setting.
When I type
:verbose set scroll
I get:
scroll=22
Last set from ~/.vim/ftplugin/tex.vim
Note: 22 is half the height (number of lines) of the gvim window.
If I source the ~/.vim/ftplugin/tex.vim
file while editing, the scroll setting is applied fine, but I want it to be applied along with the other settings at startup.
Thanks
Thanks for the good advice. It didn't work yet though. I looked at scriptnames
and here's the output:
62: /home/patrick/.vim/after/ftplugin/tex.vim
63: /home/patrick/.vim/indent/tex.vim
64: /usr/share/vim/vim72/syntax/bib.vim
65: /home/patrick/.vim/ftplugin/bib_latexSuite.vim
66: /home/patrick/.vim/after/ftplugin/bib.vim
67: /usr/share/vim/vim72/indent/bib.vim
68: /home/patrick/.vim/nerdtree_plugin/exec_menuitem.vim
69: /home/patrick/.vim/nerdtree_plugin/fs_menu.vim
As you can see, I also added a bib.vim file in the after/ftplugin
directory, because I'm loading 4 tabs at startup, one of which is a bib file.
However, it still doesn't work.
Well I still got the same problem, but with more information. I'm now running a Windows build of vim. Again vim claims scroll was last set in ~/.vimrc
. But this gets overridden whenever
Hence I no longer believe this has anything to do with latex-suite or the order in which the settings are called.
I figured out a fix/hack. It probably hasn't got anything to do with latex suite or all that. It is overridden when a new tab is opened or the window is resized. A quick fix is to use
noremap <C-u> 4<C-u>
Which consequently is always used when scrolling. This also sets the scroll
variable to 4, so it will apply to as well.
Put your tex.vim
in your ~/.vim/after/ftplugin
directory. See :help after
for the details.
Also see the output of :scriptnames
to check the order in which vim loads all the script files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With