LaTeXTools icon indicating copy to clipboard operation
LaTeXTools copied to clipboard

About the quickpanel

Open jdumas opened this issue 9 years ago • 8 comments

Hi everyone,

I am getting confused with the new quickpanel (C-r) to access sections and labels. I have mostly two questions:

  1. When I open the "goto anything" panel with C-r, I would expect to see only the current sections and paragraph, in the file I am currently editing. If I want to see all of them, I would just use the project-wide search with ^C-R. It seems to me this behavior is something that has changed recently, can you confirm?

  2. When I open the panel with C-r to access labels in the project, I need to manually enable the "Show Labels" toggle. But I don't see an option in the config file to show them by default. Did I miss something? Is it possible to do so?

Cheers.

jdumas avatar Nov 15 '16 10:11 jdumas

  1. Yes there is a new panel to overwrite C-r #779. You can disable this behavior in the settings, but still access this panel via C-l, C-r. I personally like that more than the usual C-r and C-shift-r, because it fits better to the document structure (correct section ordering, only sections inside the document, ...).
  2. This is currently not possible, but it would be easy to add a keybinding argument.

r-stein avatar Nov 15 '16 10:11 r-stein

  1. I like the new panel as well, but I would have liked to have "two" versions of it. One that shows the sections of the current file only (useful to navigate quickly within a file), and one "global" to the project that allows to navigate between the files (and which would override C-shift-r).
  2. Might I suggest also to provide a "quickpanel" for the references only? E.g. to quickly jump to a figure or a table, I just want to navigate through the list of labels. Right now it's kinda "mixed" together with the sections and I feel that these should be separate entities.

jdumas avatar Nov 15 '16 11:11 jdumas

  1. You could just disable it to use the default locally and map this to C-shift-r:

    {
        "keys": ["ctrl+shift+r"],
        "command": "latex_toc_quickpanel",
        "context":
        [
            { "key": "selector", "operator": "equal", "operand": "text.tex" }
        ]
    },
    
  2. There is already a function to search for arbitrary commands. Press ctrl+shift+p and write LaTeXTools: Search for commands in document afterwards provide a comma separated list of commands. This will open a similar navigation panel. You could also bind it to a keybinding and pass commands, e.g.:

    {
        "keys": ["ctrl+l", "ctrl+s"],
        "command": "latex_search_command",
        "args": {
            "commands": ["label", "ref", "autoref", "cite"]
        },
        "context":
        [
            { "key": "selector", "operator": "equal", "operand": "text.tex.latex" }
        ]
    },
    

r-stein avatar Nov 15 '16 12:11 r-stein

  1. Good idea! The default quickpanel mixes sections and labels by defaults now, so it's not ideal either, but still better fits my needs.
  2. Hmm this doesn't have the same feeling. Using the latex_search_command, I need to know the exact name of the reference, figure or table I want to jump to. I cannot use fuzzy search, preview the surrounding latex code, etc. I was simply suggesting an option to "hide" the section from your new quickpanel, to show only the labels and navigate between them.

jdumas avatar Nov 15 '16 12:11 jdumas

The latex_search_command also jumps to the command in the document and you can also use fuzzy search. In fact it just shows a little different item text and is missing the toggles. I actually just wrote it to demonstrate the navigation quickpanel used for the C-r command.

demo

r-stein avatar Nov 15 '16 14:11 r-stein

Ok, I missed this because I was typing the name of the label directly (fig:), and it was not showing any result. If I type the command label instead, it indeed opens the quickpanel as you showed. This is super useful, thank for pointing that out!

jdumas avatar Nov 15 '16 14:11 jdumas

Hi,

I think after a while that neither the new C-r panel nor the sublime default fits my need. I would like to quickly navigate between the section of my currently open file. With the C-r panel provided by LaTeXTools, I can do that but globally, i.e. across my different .tex files. With the sublime default C-r panel, I see not only the sections of the current file, but also all the labels defined in this file (including figures and so on).

I can workaround a little bit using the latex_search_command you showed above, to search for "section", "subsection", ..., but the results doesn't look as nice as the C-r panel provided by LaTeXTools.

I was wondering if it would be possible to provide an option or a command to have the LaTeXTools C-r panel hide sections which do not belong to the currently opened file?

jdumas avatar Jan 15 '17 15:01 jdumas

Adding an option to the command to limit it to the current file should be possible and reasonable.

r-stein avatar Jan 15 '17 19:01 r-stein