Skip to content

Commit

Permalink
doc: add description of vimtex#cite#get_key
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Apr 29, 2024
1 parent 0157240 commit a809347
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions doc/vimtex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6234,7 +6234,19 @@ API REFERENCE *vimtex-code-api*
This is an API reference of the most useful VimTeX functions available to
users for customization.

Note: This API is currently a work in progress!
Note: This reference is currently a work in progress!

*vimtex#cite#get_key*
Returns the citation key under the cursor. Can be useful e.g. to create
a function to open a citation in another progrem such as BibDesk or Zotero.
For example: >vim

function! OpenInBibDesk() abort
let l:key = vimtex#cite#get_key()
if empty(l:key) | return | endif

call vimtex#util#www('x-bdsk://' .. vimtex#util#url_encode(l:key))
endfunction

*vimtex#compiler#callback*
Utility function to be used as a compiler callback function. Takes a single
Expand All @@ -6248,24 +6260,6 @@ Note: This API is currently a work in progress!
the |VimtexEventCompiling|, |VimtexEventCompileFailed| and
|VimtexEventCompileSuccess| events.

*vimtex#syntax#in*
`vimtex#syntax#in(name)` -> |Boolean|
`vimtex#syntax#in(name, line, column)` -> |Boolean|
Returns |v:true| if the cursor position or the specified position is inside
the `name`d group. `name` is a regex that is used to matched against the
syntax group stack.

*vimtex#syntax#in_mathzone*
`vimtex#syntax#in_mathzone()` -> |Boolean|
`vimtex#syntax#in_mathzone(line, column)` -> |Boolean|
Returns |v:true| if the cursor position or the specified position is inside
a math zone.

*vimtex#view#inverse_search*
Utility function for reverse search from pdf viewer. Takes two arguments:
the line number and a filename. The function runs the event
|VimtexEventViewReverse| at the end, which allows more user customization.

*vimtex#env#get_inner*
*vimtex#env#get_outer*
*vimtex#env#get_all*
Expand All @@ -6286,6 +6280,24 @@ Note: This API is currently a work in progress!
is, the return value is a list of two numbers: The line number and the
column number. These are both 0 if no surrounding environment was found.

*vimtex#syntax#in*
`vimtex#syntax#in(name)` -> |Boolean|
`vimtex#syntax#in(name, line, column)` -> |Boolean|
Returns |v:true| if the cursor position or the specified position is inside
the `name`d group. `name` is a regex that is used to matched against the
syntax group stack.

*vimtex#syntax#in_mathzone*
`vimtex#syntax#in_mathzone()` -> |Boolean|
`vimtex#syntax#in_mathzone(line, column)` -> |Boolean|
Returns |v:true| if the cursor position or the specified position is inside
a math zone.

*vimtex#view#inverse_search*
Utility function for reverse search from pdf viewer. Takes two arguments:
the line number and a filename. The function runs the event
|VimtexEventViewReverse| at the end, which allows more user customization.

==============================================================================
FAQ *vimtex-faq*

Expand Down

0 comments on commit a809347

Please sign in to comment.