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

Is there an easy way to yank the tag in ToC view? #2815

Open
ThSGM opened this issue Oct 20, 2023 · 1 comment
Open

Is there an easy way to yank the tag in ToC view? #2815

ThSGM opened this issue Oct 20, 2023 · 1 comment
Labels

Comments

@ThSGM
Copy link

ThSGM commented Oct 20, 2023

Description

I'd like to hover over the relevant entries in the ToC corresponding to labels and then yank the label key. Can this be easily done with a shortcut?

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

no

VimtexInfo

N/A
@ThSGM ThSGM added the bug label Oct 20, 2023
@lervag
Copy link
Owner

lervag commented Oct 22, 2023

I'd like to hover over the relevant entries in the ToC corresponding to labels and then yank the label key. Can this be easily done with a shortcut?

To be honest, I'm not sure what you mean. First, what is "hover" here? Do you mean with your mouse?

Perhaps you could create a mapping within vimtex-toc filetypes? Labeled stuff typically has as its text only the label, right? So, you could just copy that. Something like this:

autocmd FileType vimtex-toc nnoremap 02Wvt(by

You may want to experiment with this. The idea is:

0                         go to beginning of line
 2W                       jump two WORDS to get to start of label
   vt(                    enter visual mode and move to the paranthesis
      b                   go back to last character of the label
       y                  yank selected text

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

No branches or pull requests

2 participants