Conversation
dbfb012 to
1d09437
Compare
d89e997 to
6606657
Compare
|
Ok, so now it remains to generate good command completion sources. I think perhaps it is not desirable to include every imaginable command. Instead, I think, it would be more useful to only have the most relevant commands. Or, what do you guys think? Note: The current implementation supports:
The complete file syntax is this: Here the mode string is not necessary, and if it is not provided, the command is completed in both normal and math mode. The implementation lacks unicode symbols. I don't see how to add that in a simple manner. But if you guys would help me to generate the source files, then we could define a syntax such as this: Or perhaps there is a way to "infer" the symbol based on the command name? Note: I've decided not to use the |
|
Is there a possibility to setup neocomplete with this? Regarding the conversion of latex commands to unicode. Following scripts might be helpful to create these files:
Enter |
|
I use this to setup neocomplete (note the last line that will match commands): let g:neocomplete#sources#omni#input_patterns.tex =
\ '\v\\%('
\ . '\a*cite\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
\ . '|\a*ref%(\s*\{[^}]*|range\s*\{[^,}]*%(}\{)?)'
\ . '|hyperref\s*\[[^]]*'
\ . '|includegraphics\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
\ . '|%(include%(only)?|input)\s*\{[^}]*'
\ . '|usepackage%(\s*\[[^]]*\])?\s*\{[^}]*'
\ . '|documentclass%(\s*\[[^]]*\])?\s*\{[^}]*'
\ . '|\a*'
\ . ')'I'll look into your suggested links for unicode conversion. Also, I agree that for this completion type, we should anchor the regex. I'm updating and pushing now. |
|
I miss the completion of |
|
The symbol stuff is pretty trivial. This |
|
Thanks, @poppyschmo! I already figured out a lot of this stuff myself, e.g. from this SO post. Do you have any idea if your sources are better than the method from that post? |
6c58b1f to
313675f
Compare
|
Ok, I ended up combining symbols from several sources. I also made a script to add symbols to complete files. In any case, the current version should also show symbols when available. |
|
The question now is: Is the feature appropriate in itself? In that case, I propose to clean up and merge, independently from working on improved sources for command completion. |
4998a2c to
5ce8f4b
Compare
5ce8f4b to
7352298
Compare
|
Ok, I've ended up writing a parser for the What is lacking now is mode specific completion, but I think this should be fine for now. If someone would be willing to learn the format of the cwl files from texstudio and explain how to parse the mode specifiers, then I could try to parse that as well and add mode specific command completion. |
|
I've merged this now. Feel free to open new issues, I think there are several things that can be improved still. |

Adds a completion source for LaTeX commands. Very simple implementation, but should still be pretty useful.
When finished, this should solve #650.