1

I have posted an issue on github, but I am asking here too to see if someone can point me to an answer...

I have installed jedi-vim and I find it really nice to edit python files. But I came across a problem that I am unable to solve --- it makes editing of LaTeX files much more complex. The problem is the following. I have in my .vimrc:

Plug 'davidhalter/jedi-vim'
    autocmd FileType python setlocal completeopt-=preview 

And when I edit a LaTeX file, the $...$ marks that define an inline math disappears unless the line is under the cursor. It's like gvim trying to render the math formula... See:

Case 1, cursor in different line of the math formula (the cursor does not appear on screenshot, but believe me...)

selection_036

Case 2, few instant after, cursor in the same line:

selection_037

This make LaTeX files almost impossible to edit. Is there a way to restrict all of the jedi-vim effects to python buffers?

I checked that commenting out the plugin line will avoid the problem.

Does anyone know what's happening here?

Update

it is a conceallevel problem. If I open a .tex file, I have the following after issuing :verbose set conceallevel?:

set conceallevel verbose

...which I really do not understand. I checked my .vimrc and I did not find anything that would justify the fact that the python sysntax is loaded for my tex buffers... but it is.

Really puzzled. Anyway, adding

autocmd FileType tex set  conceallevel=0

to my .vimrc solves (hide?) the problem.

3
  • Indeed, I find it very strange you associating the issue with jedi when not using that plugin doesn't make any difference. O.o
    – muru
    Jul 20, 2015 at 11:02
  • @muru --- I have no problem if I comment out the Plug 'davidhalter/jedi-vim line in -vimrc --- maybe I explained myself badly. Sorry...
    – Rmano
    Jul 20, 2015 at 11:20
  • 1
    Oh, I suppose then I misread: I checked that commenting out the plugin will remove the problem. Even adding let g:jedi#auto_initialization = 0 will not solve the problem... It seemed like the last clause applied to both sentences.
    – muru
    Jul 20, 2015 at 11:21

1 Answer 1

3

Your problem has nothing to do with jedi-vim. It has to do with vim-latex using the conceal feature of gVim, where some parts of text are replaced by (supposedly better) graphic representations when you aren't editing the corresponding lines. In your case a superscript is replaced, but IIRC vim-latex does that with many other things, such as Greek letters in formulas, and various mathematical symbols. The result depends a lot of the quality of the font you're using.

If you don't want that to happen you can set conceallevel to 0:

set conceallevel=0

(There might be a better / "right" way to tell vim-latex about that, but with SourceForge still down I can't check it right now).

But try it again later with other fonts, you might start to like it.

Useful references: :help tex-conceal, :help conceallevel, :help concealcursor.

11
  • Ok, that fixed. But I am sure it show on when jedi-vim is enabled; it probably set the conceallevel to something different from 0 at startuo. Thanks!
    – Rmano
    Jul 20, 2015 at 11:27
  • @Rmano Now that you mention it, yes, jedi-vim does set conceallevel, but only locally, for python buffers. It should have nothing to do with latex buffers.
    – lcd047
    Jul 20, 2015 at 11:56
  • Yep, I see --- it's in .../plugged/jedi-vim/after/python.vim. I do not know why it is triggered for the latex files. Puzzled.
    – Rmano
    Jul 20, 2015 at 12:40
  • 1
    @Rmano It's a lot more likely that a latex-related plugin sets conceallevel than jedi-vim. To find out where conceallevel has been set, open a latex file and run :verbose set conceallevel?.
    – lcd047
    Jul 20, 2015 at 12:45
  • 1
    @Rmano Now this is something you could ask the jedi-vim guys: why does after/syntax/python.vim get run for latex files?
    – lcd047
    Jul 20, 2015 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.