<commit_before>" vimtex - LaTeX plugin for Vim
"
" Maintainer: <NAME>
" Email:      <EMAIL>
"

function! vimtex#init() " {{{1
  call s:check_version()

  call s:init_options()
  call s:init_highlights()
  call s:init_state()
  call s:init_buffer()
  call s:init_default_mappings()

  if exists('#User#VimtexEventInitPost')
    doautocmd User VimtexEventInitPost
  endif
endfunction

" }}}1

function! s:check_version() " {{{1
  if get(g:, 'vimtex_disable_version_warning', 0)
    return
  endif

  if v:version <= 703 && !has('patch544')
    echoerr 'vimtex error: Please use Vim version 7.3.544 or newer!'
  endif
endfunction

" }}}1

function! s:init_options() " {{{1
  call s:init_option('vimtex_compiler_enabled', 1)
  call s:init_option('vimtex_compiler_method', 'latexmk')
  call s:init_option('vimtex_compiler_progname',
        \ get(v:, 'progpath', get(v:, 'progname')))
  call s:init_option('vimtex_compiler_callback_hooks', [])

  call s:init_option('vimtex_complete_enabled', 1)
  call s:init_option('vimtex_complete_close_braces', 0)
  call s:init_option('vimtex_complete_recursive_bib', 0)

  call s:init_option('vimtex_echo_ignore_wait', 0)

  call s:init_option('vimtex_fold_enabled', 0)
  if &diff
    let g:vimtex_fold_manual = 0
  else
    call s:init_option('vimtex_fold_manual', 0)
  endif
  call s:init_option('vimtex_fold_comments', 0)
  call s:init_option('vimtex_fold_levelmarker', '*')
  call s:init_option('vimtex_fold_preamble', 1)
  call s:init_option('vimtex_fold_envs', 1)
  call s:init_option('vimtex_fold_markers', 1)
  call s:init_option('vimtex_fold_parts',
        \ [
        \   'part',
        \   'appendix',
        \   'frontmatter',
        \   'mainmatter',
        \   'backmatter',
        \ ])
  call s:init_option('vimtex_fold_sections',
        \ [
        \   'chapter',
        \   'section',
        \   'subsection',
        \   'subsubsection',
        \ ])
  call s:init_option('vimtex_fold_commands_default', {
        \ 'hypersetup' : 'single',
        \ 'tikzset' : 'single',
        \ 'usepackage' : 'single_opt',
        \ 'includepdf' : 'single_opt',
        \ '%(re)?new%(command|environment)' : 'multi',
        \ 'providecommand' : 'multi',
        \ 'presetkeys' : 'multi',
        \ 'Declare%(Multi|Auto)?CiteCommand' : 'multi',
        \ 'Declare%(Index)?%(Field|List|Name)%(Format|Alias)' : 'multi',
        \})

  call s:init_option('vimtex_format_enabled', 0)

  call s:init_option('vimtex_imaps_enabled', 1)
  call s:init_option('vimtex_imaps_disabled', [])
  call s:init_option('vimtex_imaps_list', [
        \ { 'lhs' : '0',  'rhs' : '\emptyset' },
        \ { 'lhs' : '6',  'rhs' : '\partial' },
        \ { 'lhs' : '8',  'rhs' : '\infty' },
        \ { 'lhs' : '=',  'rhs' : '\equiv' },
        \ { 'lhs' : '\',  'rhs' : '\setminus' },
        \ { 'lhs' : '.',  'rhs' : '\cdot' },
        \ { 'lhs' : '*',  'rhs' : '\times' },
        \ { 'lhs' : '<',  'rhs' : '\leq' },
        \ { 'lhs' : '>',  'rhs' : '\geq' },
        \ { 'lhs' : '[',  'rhs' : '\subseteq' },
        \ { 'lhs' : ']',  'rhs' : '\supseteq' },
        \ { 'lhs' : '(',  'rhs' : '\subset' },
        \ { 'lhs' : ')',  'rhs' : '\supset' },
        \ { 'lhs' : 'A',  'rhs' : '\forall' },
        \ { 'lhs' : 'E',  'rhs' : '\exists' },
        \ { 'lhs' : 'qj', 'rhs' : '\downarrow' },
        \ { 'lhs' : 'qJ', 'rhs' : '\Downarrow' },
        \ { 'lhs' : 'qk', 'rhs' : '\uparrow' },
        \ { 'lhs' : 'qK', 'rhs' : '\Uparrow' },
        \ { 'lhs' : 'qh', 'rhs' : '\leftarrow' },
        \ { 'lhs' : 'qH', 'rhs' : '\Leftarrow' },
        \ { 'lhs' : 'ql', 'rhs' : '\rightarrow' },
        \ { 'lhs' : 'qL', 'rhs' : '\Rightarrow' },
        \ { 'lhs' : 'a',  'rhs' : '\alpha' },
        \ { 'lhs' : 'b',  'rhs' : '\beta' },
        \ { 'lhs' : 'c',  'rhs' : '\chi' },
        \ { 'lhs' : 'd',  'rhs' : '\delta' },
        \ { 'lhs' : 'e',  'rhs' : '\epsilon' },
        \ { 'lhs' : 'f',  'rhs' : '\phi' },
        \ { 'lhs' : 'g',  'rhs' : '\gamma' },
        \ { 'lhs' : 'h',  'rhs' : '\eta' },
        \ { 'lhs' : 'i',  'rhs' : '\iota' },
        \ { 'lhs' : 'k',  'rhs' : '\kappa' },
        \ { 'lhs' : 'l',  'rhs' : '\lambda' },
        \ { 'lhs' : 'm',  'rhs' : '\mu' },
        \ { 'lhs' : 'n',  'rhs' : '\nu' },
        \ { 'lhs' : 'p',  'rhs' : '\pi' },
        \ { 'lhs' : 'q',  'rhs' : '\theta' },
        \ { 'lhs' : 'r',  'rhs' : '\rho' },
        \ { 'lhs' : 's',  'rhs' : '\sigma' },
        \ { 'lhs' : 't',  'rhs' : '\tau' },
        \ { 'lhs' : 'y',  'rhs' : '\psi' },
        \ { 'lhs' : 'u',  'rhs' : '\upsilon' },
        \ { 'lhs' : 'w',  'rhs' : '\omega' },
        \ { 'lhs' : 'z',  'rhs' : '\zeta' },<commit_msg>Refined imaps (cf. #818)<commit_after>" vimtex - LaTeX plugin for Vim
"
" Maintainer: <NAME>
" Email:      <EMAIL>
"

function! vimtex#init() " {{{1
  call s:check_version()

  call s:init_options()
  call s:init_highlights()
  call s:init_state()
  call s:init_buffer()
  call s:init_default_mappings()

  if exists('#User#VimtexEventInitPost')
    doautocmd User VimtexEventInitPost
  endif
endfunction

" }}}1

function! s:check_version() " {{{1
  if get(g:, 'vimtex_disable_version_warning', 0)
    return
  endif

  if v:version <= 703 && !has('patch544')
    echoerr 'vimtex error: Please use Vim version 7.3.544 or newer!'
  endif
endfunction

" }}}1

function! s:init_options() " {{{1
  call s:init_option('vimtex_compiler_enabled', 1)
  call s:init_option('vimtex_compiler_method', 'latexmk')
  call s:init_option('vimtex_compiler_progname',
        \ get(v:, 'progpath', get(v:, 'progname')))
  call s:init_option('vimtex_compiler_callback_hooks', [])

  call s:init_option('vimtex_complete_enabled', 1)
  call s:init_option('vimtex_complete_close_braces', 0)
  call s:init_option('vimtex_complete_recursive_bib', 0)

  call s:init_option('vimtex_echo_ignore_wait', 0)

  call s:init_option('vimtex_fold_enabled', 0)
  if &diff
    let g:vimtex_fold_manual = 0
  else
    call s:init_option('vimtex_fold_manual', 0)
  endif
  call s:init_option('vimtex_fold_comments', 0)
  call s:init_option('vimtex_fold_levelmarker', '*')
  call s:init_option('vimtex_fold_preamble', 1)
  call s:init_option('vimtex_fold_envs', 1)
  call s:init_option('vimtex_fold_markers', 1)
  call s:init_option('vimtex_fold_parts',
        \ [
        \   'part',
        \   'appendix',
        \   'frontmatter',
        \   'mainmatter',
        \   'backmatter',
        \ ])
  call s:init_option('vimtex_fold_sections',
        \ [
        \   'chapter',
        \   'section',
        \   'subsection',
        \   'subsubsection',
        \ ])
  call s:init_option('vimtex_fold_commands_default', {
        \ 'hypersetup' : 'single',
        \ 'tikzset' : 'single',
        \ 'usepackage' : 'single_opt',
        \ 'includepdf' : 'single_opt',
        \ '%(re)?new%(command|environment)' : 'multi',
        \ 'providecommand' : 'multi',
        \ 'presetkeys' : 'multi',
        \ 'Declare%(Multi|Auto)?CiteCommand' : 'multi',
        \ 'Declare%(Index)?%(Field|List|Name)%(Format|Alias)' : 'multi',
        \})

  call s:init_option('vimtex_format_enabled', 0)

  call s:init_option('vimtex_imaps_enabled', 1)
  call s:init_option('vimtex_imaps_disabled', [])
  call s:init_option('vimtex_imaps_list', [
        \ { 'lhs' : '0',  'rhs' : '\emptyset' },
        \ { 'lhs' : '6',  'rhs' : '\partial' },
        \ { 'lhs' : '8',  'rhs' : '\infty' },
        \ { 'lhs' : '=',  'rhs' : '\equiv' },
        \ { 'lhs' : '\',  'rhs' : '\setminus' },
        \ { 'lhs' : '.',  'rhs' : '\cdot' },
        \ { 'lhs' : '*',  'rhs' : '\times' },
        \ { 'lhs' : '<',  'rhs' : '\langle' },
        \ { 'lhs' : '>',  'rhs' : '\rangle' },
        \ { 'lhs' : '[',  'rhs' : '\subseteq' },
        \ { 'lhs' : ']',  'rhs' : '\supseteq' },
        \ { 'lhs' : '(',  'rhs' : '\subset' },
        \ { 'lhs' : ')',  'rhs' : '\supset' },
        \ { 'lhs' : 'A',  'rhs' : '\forall' },
        \ { 'lhs' : 'E',  'rhs' : '\exists' },
        \ { 'lhs' : 'jj', 'rhs' : '\downarrow' },
        \ { 'lhs' : 'jJ', 'rhs' : '\Downarrow' },
        \ { 'lhs' : 'jk', 'rhs' : '\uparrow' },
        \ { 'lhs' : 'jK', 'rhs' : '\Uparrow' },
        \ { 'lhs' : 'jh', 'rhs' : '\leftarrow' },
        \ { 'lhs' : 'jH', 'rhs' : '\Leftarrow' },
        \ { 'lhs' : 'jl', 'rhs' : '\rightarrow' },
        \ { 'lhs' : 'jL', 'rhs' : '\Rightarrow' },
        \ { 'lhs' : 'a',  'rhs' : '\alpha' },
        \ { 'lhs' : 'b',  'rhs' : '\beta' },
        \ { 'lhs' : 'c',  'rhs' : '\chi' },
        \ { 'lhs' : 'd',  'rhs' : '\delta' },
        \ { 'lhs' : 'e',  'rhs' : '\epsilon' },
        \ { 'lhs' : 'f',  'rhs' : '\phi' },
        \ { 'lhs' : 'g',  'rhs' : '\gamma' },
        \ { 'lhs' : 'h',  'rhs' : '\eta' },
        \ { 'lhs' : 'i',  'rhs' : '\iota' },
        \ { 'lhs' : 'k',  'rhs' : '\kappa' },
        \ { 'lhs' : 'l',  'rhs' : '\lambda' },
        \ { 'lhs' : 'm',  'rhs' : '\mu' },
        \ { 'lhs' : 'n',  'rhs' : '\nu' },
        \ { 'lhs' : 'p',  'rhs' : '\pi' },
        \ { 'lhs' : 'q',  'rhs' : '\theta' },
        \ { 'lhs' : 'r',  'rhs' : '\rho' },
        \ { 'lhs' : 's',  'rhs' : '\sigma' },
        \ { 'lhs' : 't',  'rhs' : '\tau' },
        \ { 'lhs' : 'y',  'rhs' : '\psi' },
        \ { 'lhs' : 'u',  'rhs' : '\upsilon' },
        \ { 'lhs' : 'w',  'rhs' : '\omega' },
        \ { 'lhs' : 'z',  'rhs' : '\zeta' },
{'fraction_non_alphanumeric': 0.23898431665421957, 'fraction_numerical': 0.007574949322522138, 'mean_word_length': 2.2201992442459635, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3174645', 'n_tokens_mistral': 3943, 'n_tokens_neox': 3861, 'n_words': 659}