Refresh generated neovim config
This commit is contained in:
@ -59,17 +59,24 @@ The following explains the most common and popular approaches.
|
||||
|
||||
In Neovim, [lazy.nvim](https://github.com/folke/lazy.nvim) is probably the most popular plugin manger.
|
||||
To install VimTeX, add a plugin spec similar to this:
|
||||
|
||||
```lua
|
||||
{
|
||||
"lervag/vimtex",
|
||||
lazy = false, -- we don't want to lazy load VimTeX
|
||||
-- tag = "v2.15", -- uncomment to pin to a specific release
|
||||
init = function()
|
||||
-- VimTeX configuration goes here
|
||||
-- VimTeX configuration goes here, e.g.
|
||||
vim.g.vimtex_view_method = "zathura"
|
||||
end
|
||||
}
|
||||
```
|
||||
|
||||
VimTeX is mostly implemented with Vimscript and is configured with the
|
||||
classical vimscript variable convention like `g:vimtex_OPTION_NAME`. Nowadays,
|
||||
Neovim is often configured with Lua, thus some users may be interested in
|
||||
reading `:help lua-vimscript`.
|
||||
|
||||
### vim-plug
|
||||
|
||||
If you use [vim-plug](https://github.com/junegunn/vim-plug), then add *one* of the following lines to your configuration.
|
||||
@ -111,12 +118,13 @@ overview of some of the main aspects.
|
||||
|
||||
```vim
|
||||
" This is necessary for VimTeX to load properly. The "indent" is optional.
|
||||
" Note that most plugin managers will do this automatically.
|
||||
" Note: Most plugin managers will do this automatically!
|
||||
filetype plugin indent on
|
||||
|
||||
" This enables Vim's and neovim's syntax-related features. Without this, some
|
||||
" VimTeX features will not work (see ":help vimtex-requirements" for more
|
||||
" info).
|
||||
" Note: Most plugin managers will do this automatically!
|
||||
syntax enable
|
||||
|
||||
" Viewer options: One may configure the viewer either by specifying a built-in
|
||||
|
||||
@ -136,13 +136,13 @@ endfunction
|
||||
|
||||
" }}}1
|
||||
function! s:vimtex.get_tex_program() abort dict " {{{1
|
||||
let l:tex_program_re =
|
||||
\ '\v^\c\s*\%\s*!?\s*tex\s+%(ts-)?program\s*\=\s*\zs.*\ze\s*$'
|
||||
|
||||
let l:lines = vimtex#parser#preamble(self.tex, {'root' : self.root})[:20]
|
||||
call map(l:lines, 'matchstr(v:val, l:tex_program_re)')
|
||||
call filter(l:lines, '!empty(v:val)')
|
||||
return tolower(get(l:lines, -1, '_'))
|
||||
call map(l:lines, { _, x ->
|
||||
\ matchstr(x, '\v^\c\s*\%\s*!?\s*tex\s+%(ts-)?program\s*\=\s*\zs.*$')
|
||||
\})
|
||||
call filter(l:lines, { _, x -> !empty(x) })
|
||||
let l:tex_program = get(l:lines, -1, '_')
|
||||
return tolower(trim(l:tex_program))
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
@ -67,6 +67,8 @@ function! vimtex#syntax#core#init_rules() abort " {{{1
|
||||
syntax match texSpecialChar "\\[SP@]\ze[^a-zA-Z@]"
|
||||
syntax match texSpecialChar "\^\^\%(\S\|[0-9a-f]\{2}\)"
|
||||
|
||||
syntax match texError "[_^]"
|
||||
|
||||
" }}}2
|
||||
" {{{2 Commands: general
|
||||
|
||||
|
||||
@ -4135,11 +4135,17 @@ Examples (Vimscript) - see below for a Lua example: >vim
|
||||
augroup END
|
||||
|
||||
" Specify extra behaviour after reverse goto
|
||||
augroup vimtex_event_4
|
||||
augroup vimtex_event_5
|
||||
au!
|
||||
au User VimtexEventViewReverse normal! zMzvzz
|
||||
augroup END
|
||||
|
||||
" Focus the terminal after inverse search
|
||||
augroup vimtex_event_6
|
||||
autocmd!
|
||||
autocmd User VimtexEventViewReverse call b:vimtex.viewer.xdo_focus_vim()
|
||||
augroup END
|
||||
|
||||
Examples - Lua: >lua
|
||||
|
||||
local au_group = vim.api.nvim_create_augroup("vimtex_events", {}),
|
||||
@ -4151,6 +4157,13 @@ Examples - Lua: >lua
|
||||
command = "VimtexClean"
|
||||
})
|
||||
|
||||
-- Focus the terminal after inverse search
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'VimtexEventViewReverse',
|
||||
group = au_group,
|
||||
command = "call b:vimtex.viewer.xdo_focus_vim()"
|
||||
})
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
TEXT OBJECTS *vimtex-text-objects*
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ $
|
||||
|
||||
\begin{document}
|
||||
|
||||
Test accents \v! and \v@ here.
|
||||
Test accents \v! and \v@ here. And errors: _ ^
|
||||
|
||||
Line with inline verbatim: \verb+verb+
|
||||
Line with inline verbatim: \verb*+verb+
|
||||
|
||||
Reference in New Issue
Block a user