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
Feature request: extend \ref to custom commands like \figref or \secref #1323
Comments
Do you use the dropdown when pressing |
In this issue I meant the dropdown triggering on typing smth like |
If you only want that menu (other autocompletion is imo not really helpful for citations) you can just add this keybinding to your user keybindings: {
"keys": ["{"],
"command": "latex_fill_all",
"args": { "completion_type": "ref", "insert_char": "{" },
"context": [
{ "key": "selector", "operand": "text.tex.latex" },
{ "key": "preceding_text", "operator": "regex_match", "operand": "\\\\(?:sec|fig|tab)ref", "match_all": true },
],
}, |
Cool! I did not think of doing this. Neat. I guess I can close the issue and the PR now. |
Hmm, @r-stein this actually does not work on all my machines. Is there an easy way to debug this? I did not find any setting to control verbosity of plugin output in this plugin, is there one that I am missing? |
You can open the console and write |
When writing a huge document it is really helpful to define the way figures, sections, etc. are referenced in a single place to allow changing this at any point in time. Currently, LaTeXTools works with
\ref
and\eqref
, but won't work with custom commands like\secref
for sections or\figref
for figures. Is it possible to extend the completion functionality to these too?UPD: I have added a small PR to solve this issue. It would probably make more sense to add a setting for that, but I don't have the time now to look into how to do it here. I might return to this later if somebody finds it a useful feature.
The text was updated successfully, but these errors were encountered: