From 83abc4e180f3537c0b0a581118c3404f8cd8b2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Sun, 17 Oct 2021 20:50:34 +0200 Subject: [PATCH] feat(syntax): support \nameref refer: #2208 --- autoload/vimtex/syntax/p/hyperref.vim | 2 ++ autoload/vimtex/syntax/p/nameref.vim | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 autoload/vimtex/syntax/p/nameref.vim diff --git a/autoload/vimtex/syntax/p/hyperref.vim b/autoload/vimtex/syntax/p/hyperref.vim index 0bf2c7eae0..3b147465c4 100644 --- a/autoload/vimtex/syntax/p/hyperref.vim +++ b/autoload/vimtex/syntax/p/hyperref.vim @@ -5,6 +5,8 @@ " function! vimtex#syntax#p#hyperref#load(cfg) abort " {{{1 + call vimtex#syntax#packages#load('nameref') + syntax match texCmdHyperref '\\autoref\>' nextgroup=texRefOpt,texRefArg syntax match texCmdHyperref '\\hyperref\>' nextgroup=texRefOpt,texRefArg diff --git a/autoload/vimtex/syntax/p/nameref.vim b/autoload/vimtex/syntax/p/nameref.vim new file mode 100644 index 0000000000..fc53130e0f --- /dev/null +++ b/autoload/vimtex/syntax/p/nameref.vim @@ -0,0 +1,13 @@ +" VimTeX - LaTeX plugin for Vim +" +" Maintainer: Karl Yngve LervÄg +" Email: karl.yngve@gmail.com +" + +function! vimtex#syntax#p#nameref#load(cfg) abort " {{{1 + syntax match texCmdNameref '\\[nN]ameref\>' nextgroup=texRefOpt,texRefArg + + highlight def link texCmdNameref texCmd +endfunction + +" }}}1