Added filename completer for standalone files
* Added filename completer for standalone files * added the tikz file
This commit is contained in:
parent
7b5e6858a7
commit
e647ebe16a
@ -17,7 +17,7 @@ endfunction
|
|||||||
function! vimtex#complete#init_script() " {{{1
|
function! vimtex#complete#init_script() " {{{1
|
||||||
if !g:vimtex_complete_enabled | return | endif
|
if !g:vimtex_complete_enabled | return | endif
|
||||||
|
|
||||||
let s:completers = [s:bib, s:ref, s:img, s:inc, s:pdf, s:gls]
|
let s:completers = [s:bib, s:ref, s:img, s:inc, s:pdf, s:sta, s:gls]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
@ -414,6 +414,27 @@ function! s:pdf.complete(regex) dict " {{{2
|
|||||||
return self.candidates
|
return self.candidates
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
" {{{1 Filenames (\includestandalone)
|
||||||
|
|
||||||
|
let s:sta = {
|
||||||
|
\ 'patterns' : ['\v\\includestandalone%(\s*\[[^]]*\])?\s*\{[^}]*$'],
|
||||||
|
\ 'enabled' : 1,
|
||||||
|
\}
|
||||||
|
|
||||||
|
function! s:sta.complete(regex) dict " {{{2
|
||||||
|
let self.candidates = substitute(globpath(b:vimtex.root, '**/*.tex'), '\.tex', '', 'g')
|
||||||
|
let self.candidates = split(self.candidates, '\n')
|
||||||
|
let self.candidates = map(self.candidates,
|
||||||
|
\ 'strpart(v:val, len(b:vimtex.root)+1)')
|
||||||
|
let self.candidates = map(self.candidates, '{
|
||||||
|
\ ''word'' : v:val,
|
||||||
|
\ ''abbr'' : v:val,
|
||||||
|
\ ''menu'' : '' [includestandalone]'',
|
||||||
|
\}')
|
||||||
|
return self.candidates
|
||||||
|
endfunction
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
" {{{1 Glossary
|
" {{{1 Glossary
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
\usepackage{cleveref}
|
\usepackage{cleveref}
|
||||||
\usepackage{graphicx}
|
\usepackage{graphicx}
|
||||||
\usepackage{pdfpages}
|
\usepackage{pdfpages}
|
||||||
|
\usepackage{standalone}
|
||||||
|
|
||||||
\usepackage[backend=biber,style=authoryear]{biblatex}
|
\usepackage[backend=biber,style=authoryear]{biblatex}
|
||||||
\addbibresource{biblatex-examples.bib}
|
\addbibresource{biblatex-examples.bib}
|
||||||
|
10
test/features/completions/tikz_pic.tex
Normal file
10
test/features/completions/tikz_pic.tex
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
\documentclass{standalone}
|
||||||
|
\usepackage{standalone}
|
||||||
|
\usepackage{tikz}
|
||||||
|
\begin{document}
|
||||||
|
\begin{tikzpicture}
|
||||||
|
\draw ((0, 0) node[below left]{\large Reliability} --
|
||||||
|
(0: 4) node[below right]{\large Acquisition costs} --
|
||||||
|
(60: 4) node[above]{\large Energy consumption} -- cycle;
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{document}
|
Loading…
x
Reference in New Issue
Block a user