julia-vim icon indicating copy to clipboard operation
julia-vim copied to clipboard

LaTeX to Unicode and YCM

Open felixjung opened this issue 11 years ago • 5 comments

The documentation states

Note that the YouCompleteMe and neocomplcache plug-ins do not work well with the suggestion of possible completions for partial matches, and therefore this feature is disabled if those plug-ins are detected.

However, I know that partial completion for snippets provided by UltiSnips works great! Below you see an example of various for loop snippets I wrote for julia (now included in vim-snippets). screen shot 2014-06-19 at 11 05 39

When I type for, YCM will give me suggestions for any snippet beginning with for. Can't you do the same with possible LaTeX completions?

felixjung avatar Jun 19 '14 09:06 felixjung

The problem I had was that plugins such as YCM and neocomplcache are continuously triggering the possible completions suggestions, so the generic tab-mapping-overloading conflicts with that. I didn't know about UltiSnips, I'll look into that and see how that can be used as a workaround for YCM (as soon as I have some time; otherwise, pull requests are welcome).

carlobaldassi avatar Jun 19 '14 17:06 carlobaldassi

Great thanks! I might take a look as well, but I simply don't have any experience with vim script and/or plugin development...

felixjung avatar Jun 19 '14 18:06 felixjung

I have now looked into this issue. The way UltiSnips works together with YCM is that YCM ships with a dedicated completion engine for UltiSnips. I explored ways to allow julia-vim LaTeX-to-Unicode and YCM to work together nicely (including writing a custom completer myself, which kinda works), but unfortunately this seems completely hopeless to me at the moment, the main reason being that YCM has serious issues with Unicode. So for example even if you're editing a python file (i.e. something completely unrelated to julia-vim), having Unicode characters in the text will mess up with the suggestions following that character. I believe it's something to do with wrong indices computations, which lead to nonsensical behaviour.

carlobaldassi avatar Aug 03 '14 01:08 carlobaldassi

I suspect then that the weird behaviors I've been seeing are a product of the incompatibilities? Every-time i space-complete (not tab-complete, i turned that off), the characters i type delete everything behind it up to the next matching character and i haven't the foggiest clue what the cause is.

It usually looks something like this:

Before:

Σ(n)=return ((n*(n-1))/2)
println(Σ(3))
\Sigma

After:

Σ(n)=return ((n*(n-1))/2)
println(ΣΣ

Is there any way to fix this?

LordUbuntu avatar Jul 20 '18 03:07 LordUbuntu

@LordUbuntu Do you use delimitMate? I have exactly the same problem and for me the expand_on_space setting of delimitMate caused the trouble. You can deactivate it for the current Julia buffer by adding

autocmd FileType julia let b:delimitMate_expand_space=0

to your .vimrc.

But I have no clue why this function causes this behavior...

IngoMeyer441 avatar Aug 03 '18 12:08 IngoMeyer441