File: test-toggle-custom-frac.vim

package info (click to toggle)
vim-vimtex 2.16-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,660 kB
  • sloc: makefile: 367; python: 103
file content (28 lines) | stat: -rw-r--r-- 691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
set nocompatible
set runtimepath^=../..
filetype plugin on

let g:vimtex_toggle_fractions = {
        \ 'INLINE': 'frac',
        \ 'frac': 'dfrac',
        \ 'dfrac': 'cfrac',
        \ 'cfrac': 'INLINE',
        \}


" tsf  /  Toggle surrounding fraction
for [s:in, s:out] in [
      \ ['$x / (x-1)$', '$\frac{x}{x-1}$'],
      \ ['$\frac{x}{x-1}$', '$\dfrac{x}{x-1}$'],
      \ ['$\dfrac{x}{x-1}$', '$\cfrac{x}{x-1}$'],
      \ ['$\cfrac{x}{x-1}$', '$x/(x-1)$'],
      \]
  if s:in =~# '\/'
    call vimtex#test#keys('f/ltsf', s:in, s:out)
    call vimtex#test#keys('f/htsf', s:in, s:out)
  else
    call vimtex#test#keys('f{tsf', s:in, s:out)
  endif
endfor

call vimtex#test#finished()