dotfiles/vim/ftplugin/tex.vim

30 lines
1.0 KiB
VimL
Raw Normal View History

2023-04-29 16:36:57 +02:00
" this is mostly a matter of taste. but LaTeX looks good with just a bit
" of indentation.
set softtabstop=2
set shiftwidth=2
set textwidth=78
" TIP: if you write your \label's as \label{fig:something}, then if you
" type in \ref{fig: and press <C-n> you will automatically cycle through
" all the figure labels. Very useful!
set iskeyword+=:
" Permits é in documents
imap <buffer> +it <Plug>Tex_InsertItemOnThisLine
" Permits ì in documents
imap <C-l> <Plug>Tex_LeftRight
" PDF Format
let g:Tex_CustomTemplateDirectory = '~/.vim/ftplugin/latex-suite/templates'
let g:Tex_DefaultTargetFormat = 'pdf'
let g:Tex_CompileRule_pdf = 'xelatex -interaction=nonstopmode $*'
let g:Tex_ViewRule_pdf = 'evince'
" Mappings for Beamer
call IMAP('BFR', "\\begin{frame}\<CR>\<Tab>\\frametitle{<+title+>}\<cr><++>\<cr>\\end{frame}<++>", 'tex')
call IMAP('BAL', "\\alert{~++~}~+overlay+~", 'tex', '~+', '+~')
call IMAP('BBL', "\\begin{block}{~+title+~}~+overlay+~\<CR>~++~\<CR>\\end{block}~++~", 'tex', '~+', '+~')
" Trying a vmap
vmap ,a "zdi\alert{<C-R>z}<ESC>