From 89a47a0a44d56cd085613547a61870b9c7e71d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Wed, 16 Jul 2014 23:08:00 +0200 Subject: [PATCH] Move options to latex#init() --- autoload/latex.vim | 62 ++++++++++++++++++++++++++++++++++++++++++++++ ftplugin/tex.vim | 61 --------------------------------------------- 2 files changed, 62 insertions(+), 61 deletions(-) diff --git a/autoload/latex.vim b/autoload/latex.vim index ad93d8e..2bd627b 100644 --- a/autoload/latex.vim +++ b/autoload/latex.vim @@ -2,6 +2,7 @@ let s:initialized = 0 function! latex#init() " {{{1 + call s:init_options() call s:init_environment() call s:init_errorformat() @@ -113,6 +114,11 @@ function! s:init_environment() " {{{1 call latex#util#set_default('g:latex#data', []) call latex#util#set_default('b:latex', {}) + " + " Set some file type specific vim options + set suffixesadd+=.tex + set commentstring=\%\ %s + " " Create new or link to old blob " @@ -202,6 +208,62 @@ function! s:init_errorformat() " {{{1 setlocal efm+=%-G%.%# endfunction " }}}1 +function! s:init_options() " {{{1 + call latex#util#error_deprecated('g:latex_errorformat_ignore_warnings') + call latex#util#error_deprecated('g:latex_errorformat_show_warnings') + call latex#util#error_deprecated('g:latex_latexmk_autojump') + call latex#util#error_deprecated('g:latex_latexmk_quickfix') + + call latex#util#set_default('g:latex_build_dir', '.') + call latex#util#set_default('g:latex_complete_enabled', 1) + call latex#util#set_default('g:latex_complete_close_braces', 0) + call latex#util#set_default('g:latex_complete_recursive_bib', 0) + call latex#util#set_default('g:latex_complete_patterns', + \ { + \ 'ref' : '\C\\v\?\(eq\|page\|[cC]\|labelc\)\?ref\*\?\_\s*{[^{}]*', + \ 'bib' : '\C\\\a*cite\a*\*\?\(\[[^\]]*\]\)*\_\s*{[^{}]*', + \ }) + call latex#util#set_default('g:latex_fold_enabled', 1) + call latex#util#set_default('g:latex_fold_preamble', 1) + call latex#util#set_default('g:latex_fold_envs', 1) + call latex#util#set_default('g:latex_fold_parts', + \ [ + \ "part", + \ "appendix", + \ "frontmatter", + \ "mainmatter", + \ "backmatter", + \ ]) + call latex#util#set_default('g:latex_fold_sections', + \ [ + \ "chapter", + \ "section", + \ "subsection", + \ "subsubsection", + \ ]) + call latex#util#set_default('g:latex_indent_enabled', 1) + call latex#util#set_default('g:latex_latexmk_enabled', 1) + call latex#util#set_default('g:latex_latexmk_callback', 1) + call latex#util#set_default('g:latex_latexmk_options', '') + call latex#util#set_default('g:latex_latexmk_output', 'pdf') + call latex#util#set_default('g:latex_mappings_enabled', 1) + call latex#util#set_default('g:latex_motion_enabled', 1) + call latex#util#set_default('g:latex_motion_matchparen', 1) + call latex#util#set_default('g:latex_quickfix_autojump', '0') + call latex#util#set_default('g:latex_quickfix_ignore_all_warnings', 0) + call latex#util#set_default('g:latex_quickfix_ignored_warnings', []) + call latex#util#set_default('g:latex_quickfix_mode', '2') + call latex#util#set_default('g:latex_quickfix_open_on_warning', '1') + call latex#util#set_default('g:latex_toc_enabled', 1) + call latex#util#set_default('g:latex_toc_width', 30) + call latex#util#set_default('g:latex_toc_split_side', 'leftabove') + call latex#util#set_default('g:latex_toc_resize', 1) + call latex#util#set_default('g:latex_toc_hide_help', 0) + call latex#util#set_default('g:latex_toc_fold', 0) + call latex#util#set_default('g:latex_toc_fold_levels', 0) + call latex#util#set_default('g:latex_viewer', 'xdg-open') +endfunction +" }}}1 function! s:get_id(main) " {{{1 if exists('g:latex#data') && !empty(g:latex#data) diff --git a/ftplugin/tex.vim b/ftplugin/tex.vim index 445fe3f..3f18a27 100644 --- a/ftplugin/tex.vim +++ b/ftplugin/tex.vim @@ -12,67 +12,6 @@ if exists('b:did_ftplugin') endif let b:did_ftplugin = 1 -set suffixesadd+=.tex -set commentstring=\%\ %s - -" {{{1 Options - -call latex#util#error_deprecated('g:latex_errorformat_ignore_warnings') -call latex#util#error_deprecated('g:latex_errorformat_show_warnings') -call latex#util#error_deprecated('g:latex_latexmk_autojump') -call latex#util#error_deprecated('g:latex_latexmk_quickfix') - -call latex#util#set_default('g:latex_build_dir', '.') -call latex#util#set_default('g:latex_complete_enabled', 1) -call latex#util#set_default('g:latex_complete_close_braces', 0) -call latex#util#set_default('g:latex_complete_recursive_bib', 0) -call latex#util#set_default('g:latex_complete_patterns', - \ { - \ 'ref' : '\C\\v\?\(eq\|page\|[cC]\|labelc\)\?ref\*\?\_\s*{[^{}]*', - \ 'bib' : '\C\\\a*cite\a*\*\?\(\[[^\]]*\]\)*\_\s*{[^{}]*', - \ }) -call latex#util#set_default('g:latex_fold_enabled', 1) -call latex#util#set_default('g:latex_fold_preamble', 1) -call latex#util#set_default('g:latex_fold_envs', 1) -call latex#util#set_default('g:latex_fold_parts', - \ [ - \ "part", - \ "appendix", - \ "frontmatter", - \ "mainmatter", - \ "backmatter", - \ ]) -call latex#util#set_default('g:latex_fold_sections', - \ [ - \ "chapter", - \ "section", - \ "subsection", - \ "subsubsection", - \ ]) -call latex#util#set_default('g:latex_indent_enabled', 1) -call latex#util#set_default('g:latex_latexmk_enabled', 1) -call latex#util#set_default('g:latex_latexmk_callback', 1) -call latex#util#set_default('g:latex_latexmk_options', '') -call latex#util#set_default('g:latex_latexmk_output', 'pdf') -call latex#util#set_default('g:latex_mappings_enabled', 1) -call latex#util#set_default('g:latex_motion_enabled', 1) -call latex#util#set_default('g:latex_motion_matchparen', 1) -call latex#util#set_default('g:latex_quickfix_autojump', '0') -call latex#util#set_default('g:latex_quickfix_ignore_all_warnings', 0) -call latex#util#set_default('g:latex_quickfix_ignored_warnings', []) -call latex#util#set_default('g:latex_quickfix_mode', '2') -call latex#util#set_default('g:latex_quickfix_open_on_warning', '1') -call latex#util#set_default('g:latex_toc_enabled', 1) -call latex#util#set_default('g:latex_toc_width', 30) -call latex#util#set_default('g:latex_toc_split_side', 'leftabove') -call latex#util#set_default('g:latex_toc_resize', 1) -call latex#util#set_default('g:latex_toc_hide_help', 0) -call latex#util#set_default('g:latex_toc_fold', 0) -call latex#util#set_default('g:latex_toc_fold_levels', 0) -call latex#util#set_default('g:latex_viewer', 'xdg-open') - -" }}}1 - call latex#init() " vim: fdm=marker