More awesome latex snippets

This commit is contained in:
Pavel Korytov 2019-10-09 21:56:54 +03:00
parent 474903d04e
commit 273b90172e
8 changed files with 35 additions and 12 deletions

View file

@ -26,6 +26,7 @@ Plug 'junegunn/gv.vim'
Plug 'luochen1990/rainbow'
Plug 'tpope/vim-surround'
Plug 'valloric/matchtagalways'
Plug 'junegunn/vim-easy-align'
" Plug 'mbbill/undotree'
Plug 'simnalamburt/vim-mundo'
@ -178,6 +179,12 @@ noremap + :FSAbove<CR>
" noremap j+ :FSSplitBelow<CR>
" noremap k+ :FSSplitAbove<CR>
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
let g:UltiSnipsUsePythonVersion = 3
let g:UltiSnipsExpandTrigger="<a-q>"
let g:UltiSnipsJumpForwardTrigger="<a-q>"
@ -256,7 +263,8 @@ au Filetype tex
augroup filetype_tex
autocmd!
autocmd Filetype tex
\ let b:AutoPairs = {"(": ")", '[': ']', '{': '}', '$': '$', '\left(': '\right)', '\left[': 'right]', "''": '``', "``": "''"}
\ let b:AutoPairs = {"(": ")", '[': ']', '{': '}', '$': '$', '\left(': '\right)',
\ '\left[': 'right]', "''": '``', "``": "''", '"': '"', 'sympy': 'sympy', '<<': '>>'}
augroup END
autocmd Filetype vim setlocal foldmethod=marker

View file

@ -1,3 +1,17 @@
snippet 'sympy(.*)sympy' "evaluate sympy" wr
`!p
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
init_printing()
snip.rv = eval('latex(' + match.group(1).replace('\\', '') \
.replace('^', '**') \
.replace('{', '(') \
.replace('}', ')') + ')')
`
endsnippet
snippet vec "vector sign"
\vec{$0}
endsnippet
@ -82,6 +96,18 @@ snippet <= "\Leftarrow"
\Leftarrow $0
endsnippet
snippet '(\w+)_' "_\{text}" r
`!p snip.rv=match.group(1)`_\text{$1} $0
endsnippet
snippet '".*"' "`` ''" r
\`\``!p snip.rv=match.group(0)[1:-1]`'' $0
endsnippet
snippet '<<.*>>' "\enquote{text}" r
\enquote{`!p snip.rv=match.group(0)[2:-2]`} $0
endsnippet
snippet <- "\leftarrow"
\leftarrow $0
endsnippet

Binary file not shown.

Binary file not shown.

View file

@ -1,11 +0,0 @@
были
ЗЛП
крайнейточкой
крайнюю
афинная
ЗНП
ЗВП
афинные
:
Балтрашевич
Корытов

Binary file not shown.

Binary file not shown.

Binary file not shown.