# Vim-latex not starting automatically for .tex files

I have Vim on Ubuntu 18.04 and I am trying to use the vim-latex package. By typing :set rtp? on Vim I get the following output:

From that, it seems to me that the vim-latex package is indeed installed. However, I haven't been able to make the package start automatically once I open a latex file on vim. I am assuming (maybe incorrectly, so I would thank any corrections to my thinking) that this is happening because I haven't completed step 2 of the vim-latex installation as in their Installation Instructions page, which includes adding filetype plugin on to my ~/.vimrc.

By typing :version on Vim, I get the following output:

system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"

Inspecting my system, I couldn't find $HOME/.vimrc, so I created one. I could find ~/.vim/vimrc, but my system did not let me make changes to it. Nevertheless, when I start a .tex file on Vim I believe it still does not start the package as I don't see anything similar to what is describe in this tutorial. Some further details: By running :filetype I get filetype detection:ON plugin:ON indent:ON. I was getting indent:OFF before adding the line for indetation in my $HOME/.vimrc, so I believe it is getting the right file.

By running :verbose set ft? I get:

filetype=plaintex

By running scriptnames I get:

1: /usr/share/vim/vimrc
2: /usr/share/vim/vim80/debian.vim
3: /usr/share/vim/vim80/syntax/syntax.vim
5: /usr/share/vim/vim80/syntax/syncolor.vim
6: /usr/share/vim/vim80/filetype.vim
7: ~/.vimrc
8: /usr/share/vim/vim80/ftplugin.vim
9: /usr/share/vim/vim80/indent.vim
10: /usr/share/vim/vim80/plugin/getscriptPlugin.vim
11: /usr/share/vim/vim80/plugin/gzip.vim
12: /usr/share/vim/vim80/plugin/logiPat.vim
13: /usr/share/vim/vim80/plugin/manpager.vim
14: /usr/share/vim/vim80/plugin/matchparen.vim
15: /usr/share/vim/vim80/plugin/netrwPlugin.vim
16: /usr/share/vim/vim80/plugin/rrhelper.vim
17: /usr/share/vim/vim80/plugin/spellfile.vim
18: /usr/share/vim/vim80/plugin/tarPlugin.vim
19: /usr/share/vim/vim80/plugin/tohtml.vim
20: /usr/share/vim/vim80/plugin/vimballPlugin.vim
21: /usr/share/vim/vim80/plugin/zipPlugin.vim
22: ~/.vim/pack/bundle/start/vim-latex-1.10.0/plugin/SyntaxFolds.vim
23: ~/.vim/pack/bundle/start/vim-latex-1.10.0/plugin/filebrowser.vim
24: ~/.vim/pack/bundle/start/vim-latex-1.10.0/plugin/imaps.vim
25: ~/.vim/pack/bundle/start/vim-latex-1.10.0/plugin/remoteOpen.vim
• Yes, please ask a new question. Please note that $VIM/vimrc is the "global" vimrc file and probably not the one you should be changing, since it's likely to be overwritten when Vim is upgraded. What you want is your user vimrc file, which will be ~/.vimrc or ~/.vim/vimrc (Vim will use the first of these two that it can find.) – filbranden Sep 14 '20 at 16:47 • Thanks @filbraden. I have it updated in my ~/.vimrc too, but for some reason it wasn't working. It only worked when I added it to $VIM/vimrc. But that's good information, I will know where to look at in case I have issues with that in the future. – RobertoAS Sep 15 '20 at 1:39
• It's odd, output of :scriptnames shows your Vim is definitely sourcing your ~/.vimrc, and the value of this variable is only evaluated at runtime, only when a *.tex file is actually opened... If you have the setting in ~/.vimrc only, does :verbose let g:tex_flavor confirm it's set to 'latex' (and set from your ~/.vimrc)? – filbranden Sep 15 '20 at 3:23
• @filbraden, now it is working. I deleted let g:tex_flavor = 'latex' from \$VIM/vimrc`, but things kept working. Not sure what happened before, but thanks for the help! – RobertoAS Sep 15 '20 at 3:39