Compare commits
29 Commits
issue-630/
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
de61b31cf8 | ||
|
9ef8463dae | ||
|
d57b7720f8 | ||
|
008b9eb78d | ||
|
e0624cb5e7 | ||
|
beb5d4eb59 | ||
|
87ce498b0e | ||
|
a070901fb2 | ||
|
3e63a12448 | ||
|
a5d006513f | ||
|
4968c11868 | ||
|
9d614b6a1b | ||
|
f535f07a6d | ||
|
2495c848ed | ||
|
7c1b6c02e7 | ||
|
8e5ccd4e1c | ||
|
85cf4215ea | ||
|
05697bddb0 | ||
|
96ce49de01 | ||
|
a9e8f2e502 | ||
|
10372c7d3a | ||
|
f86a72ce90 | ||
|
c98b178377 | ||
|
184fca889a | ||
|
b344cfa968 | ||
|
ce316881ef | ||
|
1e565580d5 | ||
|
baa6467bc6 | ||
|
4c76e8f740 |
3
.vintrc.yaml
Normal file
3
.vintrc.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
policies:
|
||||
ProhibitAbbreviationOption:
|
||||
enabled: false
|
@ -81,7 +81,7 @@ if get(g:, 'tex_fast', 'r') =~# 'r'
|
||||
\ '[Ppf]?[Nn]otecite',
|
||||
\]
|
||||
execute 'syntax match texStatement'
|
||||
\ '/\v\\' . s:pattern . '\ze\s*\{/'
|
||||
\ '/\v\\' . s:pattern . '\ze\s*%(\[|\{)/'
|
||||
\ 'nextgroup=texRefOption,texCite'
|
||||
endfor
|
||||
|
||||
@ -97,7 +97,7 @@ if get(g:, 'tex_fast', 'r') =~# 'r'
|
||||
\ 'cite%(field|list|name)',
|
||||
\]
|
||||
execute 'syntax match texStatement'
|
||||
\ '/\v\\' . s:pattern . '\ze\s*\{/'
|
||||
\ '/\v\\' . s:pattern . '\ze\s*%(\[|\{)/'
|
||||
\ 'nextgroup=texRefOptions,texCites'
|
||||
endfor
|
||||
|
||||
@ -175,12 +175,12 @@ syntax region texZone
|
||||
\ keepend
|
||||
\ transparent
|
||||
\ contains=texBeginEnd,@LUA
|
||||
syntax region texZone
|
||||
\ start='\\\(directlua\|luadirect\){'rs=s
|
||||
\ end='}'re=e
|
||||
\ keepend
|
||||
\ transparent
|
||||
\ contains=texBeginEnd,@LUA
|
||||
syntax match texStatement '\\\(directlua\|luadirect\)' nextgroup=texZoneLua
|
||||
syntax region texZoneLua matchgroup=Delimiter
|
||||
\ start='{'
|
||||
\ end='}'
|
||||
\ contained
|
||||
\ contains=@LUA
|
||||
let b:current_syntax = 'tex'
|
||||
|
||||
" }}}1
|
||||
|
@ -427,7 +427,7 @@ function! s:init_mappings() " {{{1
|
||||
call s:map('n', '<localleader>lY', '<plug>(vimtex-labels-toggle)')
|
||||
endif
|
||||
|
||||
if get(g:, 'vimtex_view_enabled', 0)
|
||||
if has_key(b:vimtex, 'viewer')
|
||||
call s:map('n', '<localleader>lv', '<plug>(vimtex-view)')
|
||||
if has_key(b:vimtex.viewer, 'reverse_search')
|
||||
call s:map('n', '<localleader>lr', '<plug>(vimtex-reverse-search)')
|
||||
@ -456,28 +456,46 @@ function! s:init_local_blob() " {{{1
|
||||
let l:filename = expand('%:p')
|
||||
|
||||
if b:vimtex.tex !=# l:filename
|
||||
let l:local = deepcopy(b:vimtex)
|
||||
let l:local.tex = l:filename
|
||||
let l:local.pid = 0
|
||||
let l:local.name = fnamemodify(l:filename, ':t:r')
|
||||
let l:local.root = fnamemodify(l:filename, ':h')
|
||||
let l:local.base = fnamemodify(l:filename, ':t')
|
||||
let l:vimtex_id = s:get_id(l:filename)
|
||||
if l:vimtex_id >= 0
|
||||
let b:vimtex_local = {
|
||||
\ 'active' : 0,
|
||||
\ 'main_id' : b:vimtex_id,
|
||||
\ 'sub_id' : l:vimtex_id,
|
||||
\}
|
||||
else
|
||||
let l:local = deepcopy(b:vimtex)
|
||||
let l:local.tex = l:filename
|
||||
let l:local.pid = 0
|
||||
let l:local.name = fnamemodify(l:filename, ':t:r')
|
||||
let l:local.root = fnamemodify(l:filename, ':h')
|
||||
let l:local.base = fnamemodify(l:filename, ':t')
|
||||
|
||||
let s:vimtex_next_id += 1
|
||||
let g:vimtex_data[s:vimtex_next_id] = l:local
|
||||
let s:vimtex_next_id += 1
|
||||
let g:vimtex_data[s:vimtex_next_id] = l:local
|
||||
|
||||
let b:vimtex_local = {
|
||||
\ 'active' : 0,
|
||||
\ 'main_id' : b:vimtex_id,
|
||||
\ 'sub_id' : s:vimtex_next_id,
|
||||
\}
|
||||
let b:vimtex_local = {
|
||||
\ 'active' : 0,
|
||||
\ 'main_id' : b:vimtex_id,
|
||||
\ 'sub_id' : s:vimtex_next_id,
|
||||
\}
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
function! s:init_local_options() " {{{1
|
||||
let b:vimtex.sources = []
|
||||
let b:vimtex.packages = {}
|
||||
for l:line in vimtex#parser#tex(b:vimtex.tex, {
|
||||
\ 'detailed' : 0,
|
||||
\ 're_stop' : '\\begin\s*{document}',
|
||||
\})
|
||||
if l:line =~# '\\usepackage.*{tikz}'
|
||||
let b:vimtex.packages.tikz = 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
let b:vimtex.sources = []
|
||||
for [l:file, l:lnum, l:line] in vimtex#parser#tex(b:vimtex.tex)
|
||||
let l:cand = substitute(l:file, '\M' . b:vimtex.root, '', '')
|
||||
if l:cand[0] ==# '/' | let l:cand = l:cand[1:] | endif
|
||||
@ -594,21 +612,7 @@ endfunction
|
||||
|
||||
" }}}1
|
||||
function! s:get_main_latexmain(file) " {{{1
|
||||
"
|
||||
" Gather candidate files
|
||||
"
|
||||
let l:path = expand('%:p:h')
|
||||
let l:dirs = l:path
|
||||
while l:path != fnamemodify(l:path, ':h')
|
||||
let l:path = fnamemodify(l:path, ':h')
|
||||
let l:dirs .= ',' . l:path
|
||||
endwhile
|
||||
let l:candidates = split(globpath(fnameescape(l:dirs), '*.latexmain'), '\n')
|
||||
|
||||
"
|
||||
" Use first valid candidate
|
||||
"
|
||||
for l:cand in l:candidates
|
||||
for l:cand in s:findfiles_recursive('*.latexmain', expand('%:p:h'))
|
||||
let l:cand = fnamemodify(l:cand, ':p:r')
|
||||
if s:file_reaches_current(l:cand)
|
||||
return l:cand
|
||||
@ -636,20 +640,9 @@ function! s:get_main_recurse(...) " {{{1
|
||||
endif
|
||||
|
||||
"
|
||||
" Gather candidate files
|
||||
" Search through candidates found recursively upwards in the directory tree
|
||||
"
|
||||
let l:path = fnamemodify(l:file, ':p:h')
|
||||
let l:dirs = l:path
|
||||
while l:path != fnamemodify(l:path, ':h')
|
||||
let l:path = fnamemodify(l:path, ':h')
|
||||
let l:dirs .= ',' . l:path
|
||||
endwhile
|
||||
let l:candidates = split(globpath(fnameescape(l:dirs), '*.tex'), '\n')
|
||||
|
||||
"
|
||||
" Search through candidates
|
||||
"
|
||||
for l:cand in l:candidates
|
||||
for l:cand in s:findfiles_recursive('*.tex', fnamemodify(l:file, ':p:h'))
|
||||
" Avoid infinite recursion (checking the same file repeatedly)
|
||||
if l:cand == l:file | continue | endif
|
||||
|
||||
@ -706,6 +699,17 @@ function! s:file_reaches_current(file) " {{{1
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
function! s:findfiles_recursive(expr, path) " {{{1
|
||||
let l:path = a:path
|
||||
let l:dirs = l:path
|
||||
while l:path != fnamemodify(l:path, ':h')
|
||||
let l:path = fnamemodify(l:path, ':h')
|
||||
let l:dirs .= ',' . l:path
|
||||
endwhile
|
||||
return split(globpath(fnameescape(l:dirs), a:expr), '\n')
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
function! s:get_log() dict " {{{1
|
||||
@ -844,7 +848,7 @@ function! s:buffer_deleted(...) " {{{1
|
||||
" latex project
|
||||
"
|
||||
if l:count <= 1
|
||||
let l:vimtex = remove(g:vimtex_data, l:vimtex_id)
|
||||
let l:vimtex = g:vimtex_data[l:vimtex_id]
|
||||
|
||||
if exists('#User#VimtexEventQuit')
|
||||
if exists('b:vimtex')
|
||||
|
@ -10,7 +10,6 @@ function! vimtex#complete#init_options() " {{{1
|
||||
|
||||
call vimtex#util#set_default('g:vimtex_complete_close_braces', 0)
|
||||
call vimtex#util#set_default('g:vimtex_complete_recursive_bib', 0)
|
||||
call vimtex#util#set_default('g:vimtex_complete_img_use_tail', 0)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
@ -367,7 +366,8 @@ function! s:ref.parse_number(num_tree) dict " {{{2
|
||||
return self.parse_number(a:num_tree[l:index])
|
||||
endif
|
||||
else
|
||||
return str2nr(a:num_tree) > 0 ? a:num_tree : '-'
|
||||
let l:matches = matchlist(a:num_tree, '\v(^|.*\s)((\u|\d+)(\.\d+)*)($|\s.*)')
|
||||
return len(l:matches) > 3 ? l:matches[2] : '-'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@ -378,39 +378,68 @@ let s:img = {
|
||||
\ 'patterns' : ['\v\\includegraphics\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*$'],
|
||||
\ 'ext_re' : '\v\.%('
|
||||
\ . join(['png', 'jpg', 'eps', 'pdf', 'pgf', 'tikz'], '|')
|
||||
\ . ')$'
|
||||
\ . ')$',
|
||||
\}
|
||||
|
||||
function! s:img.complete(regex) dict " {{{2
|
||||
let self.candidates = []
|
||||
let self.candidates = split(globpath(b:vimtex.root, '**/*.*'), '\n')
|
||||
call self.gather_candidates()
|
||||
|
||||
let l:output = b:vimtex.out()
|
||||
call filter(self.candidates, 'v:val !=# l:output')
|
||||
call filter(self.candidates, 'v:val =~? self.ext_re')
|
||||
call filter(self.candidates, 'v:val =~# a:regex')
|
||||
|
||||
call map(self.candidates, 'strpart(v:val, len(b:vimtex.root)+1)')
|
||||
call map(self.candidates, '{
|
||||
\ ''abbr'' : v:val,
|
||||
\ ''word'' : v:val,
|
||||
\ ''menu'' : '' [graphics]'',
|
||||
\ }')
|
||||
|
||||
if g:vimtex_complete_img_use_tail
|
||||
for l:cand in self.candidates
|
||||
let l:cand.word = fnamemodify(l:cand.word, ':t')
|
||||
endfor
|
||||
endif
|
||||
call filter(self.candidates, 'v:val.word =~# a:regex')
|
||||
|
||||
return self.candidates
|
||||
endfunction
|
||||
|
||||
function! s:img.graphicspaths() dict " {{{2
|
||||
" Get preamble text and remove comments
|
||||
let l:preamble = vimtex#parser#tex(b:vimtex.tex, {
|
||||
\ 're_stop': '\\begin{document}',
|
||||
\ 'detailed': 0,
|
||||
\})
|
||||
call map(l:preamble, 'substitute(v:val, ''\\\@<!%.*'', '''', '''')')
|
||||
|
||||
" Parse preamble for graphicspaths
|
||||
let l:graphicspaths = []
|
||||
for l:path in split(matchstr(join(l:preamble, ' '),
|
||||
\ '\\graphicspath{\s*{\s*\zs.\{-}\ze\s*}\s*}'), '}\s*{')
|
||||
if l:path[0] ==# '/'
|
||||
call add(l:graphicspaths, l:path[:-2])
|
||||
else
|
||||
call add(l:graphicspaths, simplify(b:vimtex.root . '/' . l:path[:-2]))
|
||||
endif
|
||||
endfor
|
||||
|
||||
" Project root is always valid
|
||||
return l:graphicspaths + [b:vimtex.root]
|
||||
endfunction
|
||||
|
||||
" }}}2
|
||||
function! s:img.gather_candidates() dict " {{{2
|
||||
let l:added_files = []
|
||||
let l:generated_pdf = b:vimtex.out()
|
||||
|
||||
let self.candidates = []
|
||||
for l:path in self.graphicspaths()
|
||||
for l:file in split(globpath(l:path, '**/*.*'), '\n')
|
||||
if l:file !~? self.ext_re
|
||||
\ || l:file ==# l:generated_pdf
|
||||
\ || index(l:added_files, l:file) >= 0 | continue | endif
|
||||
|
||||
call add(l:added_files, l:file)
|
||||
|
||||
call add(self.candidates, {
|
||||
\ 'abbr': vimtex#paths#shorten_relative(l:file),
|
||||
\ 'word': vimtex#paths#relative(l:file, l:path),
|
||||
\ 'menu': '[graphics]',
|
||||
\})
|
||||
endfor
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
" {{{1 Filenames (\input and \include)
|
||||
|
||||
let s:inc = {
|
||||
\ 'patterns' : ['\v\\%(include%(only)?|input)\s*\{[^}]*$'],
|
||||
\ 'patterns' : ['\v\\%(include%(only)?|input|subfile)\s*\{[^}]*$'],
|
||||
\}
|
||||
|
||||
function! s:inc.complete(regex) dict " {{{2
|
||||
|
@ -19,7 +19,7 @@ function! vimtex#echo#wait() " {{{1
|
||||
|
||||
if filereadable(expand('%'))
|
||||
echohl VimtexMsg
|
||||
call input('Press any key to continue ...')
|
||||
call input('Press ENTER to continue')
|
||||
echohl None
|
||||
else
|
||||
sleep 1
|
||||
|
@ -118,8 +118,9 @@ endfunction
|
||||
" }}}1
|
||||
|
||||
function! vimtex#env#is_inside(env) " {{{1
|
||||
let l:stopline = max([line('.') - 50, 1])
|
||||
return searchpair('\\begin\s*{' . a:env . '\*\?}', '',
|
||||
\ '\\end\s*{' . a:env . '\*\?}', 'bnW')
|
||||
\ '\\end\s*{' . a:env . '\*\?}', 'bnW', 0, l:stopline)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
@ -430,8 +430,9 @@ function! s:cmd_single_opt(cmds) " {{{1
|
||||
endfunction
|
||||
|
||||
function! l:fold.text(line) dict
|
||||
let l:col = strlen(matchstr(a:line, '^\s*')) + 1
|
||||
return matchstr(a:line, self.re.text) . '[...]{'
|
||||
\ . vimtex#cmd#get_at(v:foldstart, 1).args[0].text . '}'
|
||||
\ . vimtex#cmd#get_at(v:foldstart, l:col).args[0].text . '}'
|
||||
endfunction
|
||||
|
||||
return l:fold
|
||||
|
@ -110,7 +110,7 @@ function! s:format(top, bottom) " {{{1
|
||||
endif
|
||||
|
||||
" Handle long lines
|
||||
if len(l:line) > s:textwidth
|
||||
if strchars(l:line) > s:textwidth
|
||||
let l:bottom += s:format_build_lines(l:current, l:mark)
|
||||
let l:mark = l:current-1
|
||||
endif
|
||||
@ -160,7 +160,7 @@ function! s:format_build_lines(start, end) " {{{1
|
||||
let l:lnum = a:start-1
|
||||
let l:current = repeat(' ', indent(a:start))
|
||||
for l:word in l:words
|
||||
if len(l:word) + len(l:current) > s:textwidth
|
||||
if strchars(l:word) + strchars(l:current) > s:textwidth
|
||||
call append(l:lnum, substitute(l:current, '\s$', '', ''))
|
||||
let l:lnum += 1
|
||||
let l:current = repeat(' ', VimtexIndent(a:start))
|
||||
|
@ -15,7 +15,8 @@ function! vimtex#latexmk#init_options() " {{{1
|
||||
call vimtex#util#set_default('g:vimtex_latexmk_background', 0)
|
||||
call vimtex#util#set_default('g:vimtex_latexmk_callback', 1)
|
||||
call vimtex#util#set_default('g:vimtex_latexmk_continuous', 1)
|
||||
call vimtex#util#set_default('g:vimtex_latexmk_options', '')
|
||||
call vimtex#util#set_default('g:vimtex_latexmk_options',
|
||||
\ '-verbose -pdf -file-line-error -synctex=1 -interaction=nonstopmode')
|
||||
call vimtex#util#set_default('g:vimtex_quickfix_autojump', '0')
|
||||
call vimtex#util#set_default('g:vimtex_quickfix_ignore_all_warnings', 0)
|
||||
call vimtex#util#set_default('g:vimtex_quickfix_ignored_warnings', [])
|
||||
@ -580,13 +581,7 @@ function! s:latexmk_build_cmd() " {{{1
|
||||
endif
|
||||
endif
|
||||
|
||||
" Add general options for latexmk
|
||||
if !empty(g:vimtex_latexmk_options)
|
||||
let cmd .= ' ' . g:vimtex_latexmk_options
|
||||
else
|
||||
let cmd .= ' -verbose -pdf -file-line-error'
|
||||
let cmd .= ' -synctex=1 -interaction=nonstopmode'
|
||||
endif
|
||||
let cmd .= ' ' . g:vimtex_latexmk_options
|
||||
|
||||
if g:vimtex_latexmk_build_dir !=# ''
|
||||
let cmd .= ' -outdir=' . g:vimtex_latexmk_build_dir
|
||||
@ -667,13 +662,7 @@ function! s:latexmk_build_cmd_selected(fname) " {{{1
|
||||
endif
|
||||
endif
|
||||
|
||||
" Add general options for latexmk
|
||||
if !empty(g:vimtex_latexmk_options)
|
||||
let cmd .= ' ' . g:vimtex_latexmk_options
|
||||
else
|
||||
let cmd .= ' -verbose -pdf -file-line-error'
|
||||
let cmd .= ' -synctex=1 -interaction=nonstopmode'
|
||||
endif
|
||||
let cmd .= ' ' . g:vimtex_latexmk_options
|
||||
|
||||
let cmd .= ' ' . vimtex#util#shellescape(a:fname)
|
||||
|
||||
|
44
autoload/vimtex/paths.vim
Normal file
44
autoload/vimtex/paths.vim
Normal file
@ -0,0 +1,44 @@
|
||||
" vimtex - LaTeX plugin for Vim
|
||||
"
|
||||
" Maintainer: Karl Yngve Lervåg
|
||||
" Email: karl.yngve@gmail.com
|
||||
"
|
||||
|
||||
function! vimtex#paths#shorten_relative(path) " {{{1
|
||||
" Input: An absolute path
|
||||
" Output: Relative path with respect to the vimtex root, path relative to
|
||||
" vimtex root (unless absolute path is shorter)
|
||||
|
||||
let l:relative = vimtex#paths#relative(a:path, b:vimtex.root)
|
||||
return strlen(l:relative) < strlen(a:path)
|
||||
\ ? l:relative : a:path
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
function! vimtex#paths#relative(path, current) " {{{1
|
||||
" Note: This algorithm is based on the one presented by @Offirmo at SO,
|
||||
" http://stackoverflow.com/a/12498485/51634
|
||||
let l:target = a:path
|
||||
|
||||
let l:common = a:current
|
||||
let l:result = ''
|
||||
while substitute(l:target, '^' . l:common, '', '') ==# l:target
|
||||
let l:common = fnamemodify(l:common, ':h')
|
||||
let l:result = empty(l:result) ? '..' : '../' . l:result
|
||||
endwhile
|
||||
|
||||
if l:common ==# '/'
|
||||
let l:result .= '/'
|
||||
endif
|
||||
|
||||
let l:forward = substitute(l:target, '^' . l:common, '', '')
|
||||
if !empty(l:forward)
|
||||
let l:result = empty(l:result)
|
||||
\ ? l:forward[1:]
|
||||
\ : l:result . l:forward
|
||||
endif
|
||||
|
||||
return l:result
|
||||
endfunction
|
||||
|
||||
" }}}1
|
@ -24,8 +24,7 @@ function! vimtex#view#zathura#new() " {{{1
|
||||
" Check if the xdotool is available
|
||||
"
|
||||
if !executable('xdotool')
|
||||
call vimtex#echo#warning('Zathura requires xdotool!')
|
||||
return {}
|
||||
call vimtex#echo#warning('Zathura requires xdotool for forward search!')
|
||||
endif
|
||||
|
||||
"
|
||||
|
@ -375,12 +375,6 @@ Options~
|
||||
|
||||
Default value: 0
|
||||
|
||||
*g:vimtex_complete_img_use_tail*
|
||||
If enabled, only the tail part of file names are completed. This is useful
|
||||
if one uses the `graphicx` package and the `\graphicspath` command.
|
||||
|
||||
Default value: 0
|
||||
|
||||
*g:vimtex_delim_toggle_mod_list*
|
||||
Define list of delimiter modifiers to toggle through with
|
||||
|<plug>(vimtex-delim-toggle-modifier)|.
|
||||
@ -769,8 +763,8 @@ Options~
|
||||
-synctex=1 -- Generate synctex data
|
||||
-interaction=nonstopmode -- Disable interactive mode
|
||||
|
||||
< However, if `g:vimtex_latexmk_options` is defined and is nonzero, it will
|
||||
override the above with the user supplied options.
|
||||
< However, if `g:vimtex_latexmk_options` is defined, it will override the
|
||||
above with the user supplied options.
|
||||
|
||||
Note: Options may also be specified indirectly to `latexmk` through
|
||||
both a global and a project specific `.latexmkrc` file. One should
|
||||
@ -779,7 +773,8 @@ Options~
|
||||
one has to set `g:vimtex_latexmk_options` to a string that contains
|
||||
the desired options.
|
||||
|
||||
Default value: ''
|
||||
Default value:
|
||||
'-verbose -pdf -file-line-error -synctex=1 -interaction=nonstopmode'
|
||||
|
||||
*g:vimtex_latexmk_progname*
|
||||
Path to vim executable. This is used for the callback functionality, and it
|
||||
@ -921,7 +916,7 @@ Options~
|
||||
and backward search. Recommended settings are: >
|
||||
|
||||
let g:vimtex_view_general_viewer = 'okular'
|
||||
let g:vimtex_view_general_options = '--unique @pdf\#src:@line@tex'
|
||||
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
|
||||
let g:vimtex_view_general_options_latexmk = '--unique'
|
||||
|
||||
< Backward search must be set up from the viewer through
|
||||
@ -991,13 +986,15 @@ Options~
|
||||
the command line. This can be utilized to set the correct
|
||||
|servername| for inverse search: >
|
||||
|
||||
let g:vimtex_view_general_viewer = 'SumatraPDF -reuse-instance '
|
||||
let g:vimtex_view_general_viewer = 'SumatraPDF'
|
||||
let g:vimtex_view_general_options
|
||||
\ = '-reuse-instance -forward-search @tex @line @pdf'
|
||||
\ . '-inverse-search "gvim --servername ' . v:servername
|
||||
\ . ' --remote-send \"^<C-\^>^<C-n^>'
|
||||
\ . ':drop \%f^<CR^>:\%l^<CR^>:normal\! zzzv^<CR^>'
|
||||
\ . ':execute ''drop '' . fnameescape(''\%f'')^<CR^>'
|
||||
\ . ':\%l^<CR^>:normal\! zzzv^<CR^>'
|
||||
\ . ':call remote_foreground('''.v:servername.''')^<CR^>\""'
|
||||
\ . ':call remote_foreground('''.v:servername.''')^<CR^>^<CR^>\""'
|
||||
<
|
||||
*vimtex_viewer_mupdf*
|
||||
http://www.mupdf.com/
|
||||
@ -2008,9 +2005,9 @@ to go from a specific position in the pdf file to the corresponding position
|
||||
in vim (inverse/backward search).
|
||||
|
||||
To make synctex work, it must be enabled. vimtex enables this by default by
|
||||
passing `-synctex=1` on the command line, unless the user sets the option
|
||||
|g:vimtex_latexmk_options| to a nonempty value. In the latter case, the user
|
||||
should ensure that the synctex flag is passed, i.e. with: >
|
||||
passing `-synctex=1` on the command line, unless the user overrides the option
|
||||
|g:vimtex_latexmk_options|. In the latter case, the user should ensure that the
|
||||
synctex flag is passed, i.e. with: >
|
||||
|
||||
let g:vimtex_latexmk_options = '... -synctex=1 ...'
|
||||
|
||||
|
@ -16,8 +16,8 @@ call vimtex#util#set_default('g:vimtex_indent_ignored_envs', [
|
||||
\ 'document',
|
||||
\])
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
setlocal autoindent
|
||||
setlocal indentexpr=VimtexIndent(v:lnum)
|
||||
@ -80,9 +80,8 @@ endfunction
|
||||
|
||||
" }}}1
|
||||
function! s:is_verbatim(line, lnum) " {{{1
|
||||
let l:env = a:line !~# '\v\\%(begin|end)\{%(verbatim|lstlisting|minted)'
|
||||
let l:syn = synIDattr(synID(a:lnum, 1, 1), 'name') ==# 'texZone'
|
||||
return l:env && l:syn
|
||||
return a:line !~# '\v\\%(begin|end)\{%(verbatim|lstlisting|minted)'
|
||||
\ && vimtex#env#is_inside('\%(lstlisting\|verbatim\|minted\)')
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
@ -138,6 +137,8 @@ let s:re_delims = vimtex#delim#get_delim_regexes()
|
||||
|
||||
" }}}1
|
||||
function! s:indent_tikz(lnum, prev) " {{{1
|
||||
if !has_key(b:vimtex.packages, 'tikz') | return 0 | endif
|
||||
|
||||
let l:env_lnum = vimtex#env#is_inside('tikzpicture')
|
||||
if l:env_lnum > 0 && l:env_lnum < a:lnum
|
||||
let l:prev_starts = a:prev =~# s:tikz_commands
|
||||
@ -267,7 +268,7 @@ endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: fdm=marker sw=2
|
||||
|
@ -90,6 +90,8 @@ const double pi = 3.1415926535
|
||||
% Cite commands
|
||||
\cite{}
|
||||
\citet*{}
|
||||
\citep{bibtexkey1}
|
||||
\citep[e.g.][]{bibtexkey2}
|
||||
\citealt{}
|
||||
\citealt*{}
|
||||
\citealp{}
|
||||
@ -102,6 +104,18 @@ const double pi = 3.1415926535
|
||||
\citeyearpar{}
|
||||
\bibentry{}
|
||||
|
||||
\directlua{
|
||||
if pdf.getminorversion() \string~= 7 then
|
||||
print "pfd version 1.7"
|
||||
end
|
||||
}
|
||||
|
||||
\begin{luacode}
|
||||
if pdf.getminorversion() \string~= 7 then
|
||||
print "pfd version 1.7"
|
||||
end
|
||||
\end{luacode}
|
||||
|
||||
\end{document}
|
||||
|
||||
% vim: fdl=9
|
||||
|
0
test/issues/640/testagain/test.pgf
Normal file
0
test/issues/640/testagain/test.pgf
Normal file
0
test/issues/640/tested.pdf
Normal file
0
test/issues/640/tested.pdf
Normal file
0
test/issues/640/tester/test.pdf
Normal file
0
test/issues/640/tester/test.pdf
Normal file
13
test/issues/640/tester/test.tex
Normal file
13
test/issues/640/tester/test.tex
Normal file
@ -0,0 +1,13 @@
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{graphicx}
|
||||
\graphicspath{{test} {testing}%
|
||||
{../}
|
||||
{../testagain/}
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\includegraphics[width=0.9\linewidth]{}
|
||||
|
||||
\end{document}
|
0
test/issues/640/tester/test/test.png
Normal file
0
test/issues/640/tester/test/test.png
Normal file
0
test/issues/640/tester/testing/test.eps
Normal file
0
test/issues/640/tester/testing/test.eps
Normal file
0
test/issues/664/figs1/fig1_1.png
Normal file
0
test/issues/664/figs1/fig1_1.png
Normal file
0
test/issues/664/figs1/fig1_2.png
Normal file
0
test/issues/664/figs1/fig1_2.png
Normal file
0
test/issues/664/figs2/fig2_1.png
Normal file
0
test/issues/664/figs2/fig2_1.png
Normal file
0
test/issues/664/figs2/fig2_2.png
Normal file
0
test/issues/664/figs2/fig2_2.png
Normal file
0
test/issues/664/figs2/fig2_3.png
Normal file
0
test/issues/664/figs2/fig2_3.png
Normal file
5
test/issues/664/minivimrc
Normal file
5
test/issues/664/minivimrc
Normal file
@ -0,0 +1,5 @@
|
||||
set nocompatible
|
||||
let &rtp = '~/.vim/bundle/vimtex,' . &rtp
|
||||
let &rtp .= ',~/.vim/bundle/vimtex/after'
|
||||
filetype plugin indent on
|
||||
syntax enable
|
15
test/issues/664/test.tex
Normal file
15
test/issues/664/test.tex
Normal file
@ -0,0 +1,15 @@
|
||||
\documentclass{beamer}
|
||||
\graphicspath{{figs1/}{figs2/}}
|
||||
|
||||
\begin{textblock*}{100mm}(\textwidth, 0.1cm)
|
||||
\includegraphics[height=0.9cm]{fig1_1.png}
|
||||
\end{textblock*}}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{frame}
|
||||
\titlepage
|
||||
\includegraphics[width=0.9\linewidth]{}
|
||||
\end{frame}
|
||||
|
||||
\end{document}
|
9
test/issues/682/minivimrc
Normal file
9
test/issues/682/minivimrc
Normal file
@ -0,0 +1,9 @@
|
||||
set nocompatible
|
||||
let &rtp = '~/.vim/bundle/vimtex,' . &rtp
|
||||
let &rtp .= ',~/.vim/bundle/vimtex/after'
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
let g:vimtex_view_enabled = 1
|
||||
edit test.sty
|
||||
quit
|
3
test/issues/682/test.sty
Normal file
3
test/issues/682/test.sty
Normal file
@ -0,0 +1,3 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{varticle}
|
||||
\endimput
|
@ -141,8 +141,9 @@ Given tex (Indent: tikz):
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
|
||||
Do (Indent):
|
||||
gg=G
|
||||
Execute (Indent):
|
||||
let b:vimtex.packages.tikz = 1
|
||||
normal gg=G
|
||||
|
||||
Expect tex (Verify):
|
||||
\tikz \fill[green] rectangle (0.5,0.5); Something
|
||||
|
Loading…
x
Reference in New Issue
Block a user