Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LaTeX-to-Unicode for other file types #33

Closed
jovaha opened this issue Sep 25, 2014 · 9 comments
Closed

Use LaTeX-to-Unicode for other file types #33

jovaha opened this issue Sep 25, 2014 · 9 comments

Comments

@jovaha
Copy link

jovaha commented Sep 25, 2014

The LaTeX-to-Unicode is a very useful feature in general text editing, so it would be nice to be able to use it for any file type. Is this possible?

@carlobaldassi
Copy link
Contributor

I have oftentimes wanted that too. The proper way to have that would seem to be factoring out the relevant bits in an independent plugin. Except that 1) vim lacks a plugin manager which allows to specify dependencies, and I'd really hate to need to specify in the README (which nobody reads anyway usually) that you need to download something else to get the full functionality, and 2) the LaTeX labels are somehow Julia-specific. The second point is very minor, of course, but the first one is what blocked me. Even more relevant, after Julia 1.0 I hope to have the plugin shipped with vim by default, in which case the chances of someone looking into the README and discovering that they need to get another plugin basically get to 0. In other words, it should just work, like now, anything else is a regression in my opinion.

So the alternative could be to provide a configuration option which enables the feature for any file via autoload, perhaps via a whitelist/blacklist pair of options to specify filetypes. It's a bit strange to do this from a filetype-specific plugin though. But unless someone has a better idea, or simply objects to this kind of plan, I may try going down that road, with some refactoring it may be feasible.

@jovaha
Copy link
Author

jovaha commented Sep 25, 2014

The idea of making it available via a configuration option sounds like a good idea. Considering your goal of including it in vim and the usefulness of this feature not involving Julia I think an unorthodox way of making it available is merited.

The quality of this feature is impressive and really useful for general scientific work, so it would be sad if it couldn't be used without ft=julia.

P.S. I am just commenting as a user. I hope that is ok

@carlobaldassi
Copy link
Contributor

P.S. I am just commenting as a user. I hope that is ok

Totally ok, no worries!

@carlobaldassi
Copy link
Contributor

Ok, I went through a major refactoring and now LaTeX-to-Unicode should be available on all file types. It's a bit of a weird arrangement, basically the L2U stuff is a "guest-plugin" inside the Julia one, but I hope it's useful. Of course, I immediately set

let g:latex_to_unicode_file_types = ".*"

in my .vimrc :)

I hope everything works as intended.

@carlobaldassi
Copy link
Contributor

Ah and of course refer to the documentation for the details.

@jovaha
Copy link
Author

jovaha commented Oct 1, 2014

Updated, and works perfectly. Thanks for grate response

@mbaz
Copy link

mbaz commented Mar 31, 2015

How do you specify just some file types? I'd like to have this functionality only for Julia and Latex files. I have tried combinations such as "julia, tex", "julia tex", "*jl *tex", but they don't work.

@carlobaldassi
Copy link
Contributor

@mbaz Like this:

let g:latex_to_unicode_file_types = ["julia", "tex", "plaintex"]

see also the help (or better :help julia-vim-L2U-file-types).

@mbaz
Copy link

mbaz commented Apr 1, 2015

@carlobaldassi Thanks! and sorry for missing the documentation. I went by the project's readme, which only has ".*" as an example, and I didn't know how to specify a list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants