aperezdc / vim-template

Simple templates plugin for Vim
371 stars 152 forks source link

Are multiple occurrences of the same variable on the same line supposed to work? #147

Closed danielfalbo closed 3 years ago

danielfalbo commented 3 years ago

In my =template=.tex I have the following line:

\author{\Large %AUTHOR% --- \texttt{\href{mailto:%MAIL%}{%MAIL%}}}

.

When I open a new .tex file, the first %MAIL% turns into the actual value of my g:mail variable, while the second one doesn't (i.e.:

\author{\Large Daniel Falbo --- \texttt{\href{mailto:danielfalbo@engineer.com}{%MAIL%}}}

). I can also replace %MAIL% with any other variable (for example, %USER%) and the same thing happens.

Is this a bug or is it a choice not to use the same variable twice in the same line?

danielfalbo commented 3 years ago

There was probably something bad in my init.vim because I don't have this issue anymore 👍

danielfalbo commented 3 years ago

For people here because they have the same issue, I just discovered that the problem was set gdefaults, removing it from the vimrc solves this issue.

aperezdc commented 3 years ago

@danielfalbo Sorry for the late reply. I'm glad that you got things working :pray:

This is a known issue, and it is mentioned in the FAQ section of the documentation.