diff --git a/.gitmodules b/.gitmodules index 9ffd1e2..fec44fc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -84,3 +84,9 @@ [submodule "bundle/base16-vim"] path = bundle/base16-vim url = https://github.com/chriskempson/base16-vim/ +[submodule "bundle/ultisnips"] + path = bundle/ultisnips + url = git@github.com:SirVer/ultisnips.git +[submodule "bundle/vim-snippets"] + path = bundle/vim-snippets + url = git@github.com:honza/vim-snippets.git diff --git a/.vimrc b/.vimrc index 0f15e3e..66b7bca 100644 --- a/.vimrc +++ b/.vimrc @@ -131,6 +131,9 @@ let g:tex_conceal='abdmg' let g:table_mode_corner_corner='+' let g:table_mode_header_fillchar='=' +" UtiliSnips +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsEditSplit="vertical" " Lion let g:lion_squeeze_spaces = 1 @@ -138,171 +141,171 @@ let g:lion_squeeze_spaces = 1 " Quick tex options {{{2 " HTML {{{3 -let g:quicktex_html = { - \' ' : "\/<+.*+>\\"_c/+>/e\", - \';b' : "<+++> <++>", - \';i' : "<+++> <++>", - \';1' : "

<+++>

<++>", - \';2' : "

<+++>

<++>", - \';3' : "

<+++>

<++>", - \';p' : "

<+++>

<++>", - \';a' : "\"><+++> <++>", - \';ul' : "
    \
  • <+++>
  • \
\\<++>", - \';ol' : "
    \
  1. <+++>
  2. \
\\<++>", - \';li' : "
  • <++>
  • ", -\} -" CSS {{{3 -let g:quicktex_css = { - \' ' : "\/<+.*+>\\"_c/+>/e\", - \ - \'w' : "width: <+++>;\<++>", - \'h' : "height: <+++>;\<++>", - \'mw' : "max-width: <+++>;\<++>", - \'mh' : "max-height: <+++>;\<++>", - \'t' : "top: <+++>;\<++>", - \'b' : "bottom: <+++>;\<++>", - \'l' : "left: <+++>;\<++>", - \'r' : "right: <+++>;\<++>", - \'pos' : "position: <+++>;\<++>", - \ - \'m' : "margin: <+++>;\<++>", - \'mt' : "margin-top: <+++>;\<++>", - \'mb' : "margin-bottom: <+++>;\<++>", - \'ml' : "margin-left: <+++>;\<++>", - \'mr' : "margin-right: <+++>;\<++>", - \ - \'p' : "padding: <+++>;\<++>", - \'pt' : "padding-top: <+++>;\<++>", - \'pb' : "padding-bottom: <+++>;\<++>", - \'pl' : "padding-left: <+++>;\<++>", - \'pr' : "padding-right: <+++>;\<++>", - \ - \'bor' : "border: <+++>;\<++>", - \'bort' : "border-top: <+++>;\<++>", - \'borb' : "border-bottom: <+++>;\<++>", - \'borl' : "border-left: <+++>;\<++>", - \'borr' : "border-right: <+++>;\<++>", - \ - \';abs' : "position: absolute;\<++>", - \';rel' : "position: relative;\<++>", - \';fix' : "position: fixed;\<++>", - \ - \';block' : "display: block;\<++>", - \';inl' : "display: inline;\<++>", - \';inb' : "display: inline-block;\<++>", - \';flex' : "display: flex;\<++>", - \';inf' : "display: inline-flex;\<++>", - \ - \'include' : "@import \"<+++>\";\<++>", - \'@include' : "@import \"<+++>\";\<++>", - \'require' : "@import \"<+++>\";\<++>", - \'@require' : "@import \"<+++>\";\<++>", - \'import' : "@import \"<+++>\";\<++>", - \ - \'media' : "@media (<+++>){\<++>\}", - \';minw' : "@media (min-width: <+++>){\<++>\}", - \';mindw' : "@media (min-width: @min-desktop-width){\<+++>\}", -\} -let g:quicktex_less = g:quicktex_css - -" JS {{{3 -let g:quicktex_javascript = { - \' ' : "\/<+.*+>\\"_c/+>/e\", - \ - \';fun' : "function <+++>(<++>){\<++>\}", - \ -\} -" Latex Normal {{{3 -let g:quicktex_tex = { - \' ' : "\/<+.*+>\\"_c/+>/e\", - \';b' : "\\textbf{<+++>} <++>", - \';e' : "\\emph{<+++>} <++>", - \'prf' : "\\begin{proof}\<+++>\\\end{proof}", - \';m' : "$<+++>$ <++>", - \';M' : "\\[ <+++> \\] <++>", - \';ma' : "$a$ ", - \';mb' : "$b$ ", - \';mc' : "$c$ ", - \';md' : "$d$ ", - \';me' : "$e$ ", - \';mf' : "$f$ ", - \';mg' : "$g$ ", - \';mh' : "$h$ ", - \';mi' : "$i$ ", - \';mj' : "$j$ ", - \';mk' : "$k$ ", - \';ml' : "$l$ ", - \';mm' : "$m$ ", - \';mn' : "$n$ ", - \';mo' : "$o$ ", - \';mp' : "$p$ ", - \';mq' : "$q$ ", - \';mr' : "$r$ ", - \';ms' : "$s$ ", - \';mt' : "$t$ ", - \';mu' : "$u$ ", - \';mv' : "$v$ ", - \';mw' : "$w$ ", - \';mx' : "$x$ ", - \';my' : "$y$ ", - \';mz' : "$z$ ", - \';mA' : "$A$ ", - \';mB' : "$B$ ", - \';mC' : "$C$ ", - \';mD' : "$D$ ", - \';mE' : "$E$ ", - \';mF' : "$F$ ", - \';mG' : "$G$ ", - \';mH' : "$H$ ", - \';mI' : "$I$ ", - \';mJ' : "$J$ ", - \';mK' : "$K$ ", - \';mL' : "$L$ ", - \';mM' : "$M$ ", - \';mN' : "$N$ ", - \';mO' : "$O$ ", - \';mP' : "$P$ ", - \';mQ' : "$Q$ ", - \';mR' : "$R$ ", - \';mS' : "$S$ ", - \';mT' : "$T$ ", - \';mU' : "$U$ ", - \';mV' : "$V$ ", - \';mW' : "$W$ ", - \';mX' : "$X$ ", - \';mY' : "$Y$ ", - \';mZ' : "$Z$ ", -\} - -" Latex Maths {{{3 -let g:quicktex_math = { - \' ' : "\/<+.*+>\\"_c/+>/e\", - \';b' : "\\mathbf{<+++>} <++>", - \';B' : "\\mathbb{<+++>} <++>", - \'fr' : '\mathcal{R} ', - \'eq' : '= ', - \'set' : '\{ <+++> \} <++>', - \'frac' : '\frac{<+++>}{<++>} <++>', - \'in' : '\in ', - \'bn' : '\mathbb{N} ', -\} - -" Markdown {{{3 -let g:quicktex_markdown = { - \' ' : "\/<+.*+>\\"_c/+>/e\", - \';b' : "**<+++>** <++>", - \';i' : "*<+++>* <++>", - \';a' : "[<+++>](<+url+>) <++>", -\} -let g:quicktex_pandoc = g:quicktex_markdown -" PHP {{{3 -let g:quicktex_php = { - \' ' : "\/<+.*+>\\"_c/+>/e\", - \';ob' : "ob_start();\<+++>\ob_get_clean();", - \';vd' : "var_dump(<+++>);", - \';obvd' : "ob_start();\var_dump(<+++>);\echo htmlspecialchars(ob_get_clean());", - \';nl' : "echo '
    ';", -\} +" let g:quicktex_html = { +" \' ' : "\/<+.*+>\\"_c/+>/e\", +" \';b' : "<+++> <++>", +" \';i' : "<+++> <++>", +" \';1' : "

    <+++>

    <++>", +" \';2' : "

    <+++>

    <++>", +" \';3' : "

    <+++>

    <++>", +" \';p' : "

    <+++>

    <++>", +" \';a' : "\"><+++> <++>", +" \';ul' : "
      \
    • <+++>
    • \
    \\<++>", +" \';ol' : "
      \
    1. <+++>
    2. \
    \\<++>", +" \';li' : "
  • <++>
  • ", +" \} +" " CSS {{{3 +" let g:quicktex_css = { +" \' ' : "\/<+.*+>\\"_c/+>/e\", +" \ +" \'w' : "width: <+++>;\<++>", +" \'h' : "height: <+++>;\<++>", +" \'mw' : "max-width: <+++>;\<++>", +" \'mh' : "max-height: <+++>;\<++>", +" \'t' : "top: <+++>;\<++>", +" \'b' : "bottom: <+++>;\<++>", +" \'l' : "left: <+++>;\<++>", +" \'r' : "right: <+++>;\<++>", +" \'pos' : "position: <+++>;\<++>", +" \ +" \'m' : "margin: <+++>;\<++>", +" \'mt' : "margin-top: <+++>;\<++>", +" \'mb' : "margin-bottom: <+++>;\<++>", +" \'ml' : "margin-left: <+++>;\<++>", +" \'mr' : "margin-right: <+++>;\<++>", +" \ +" \'p' : "padding: <+++>;\<++>", +" \'pt' : "padding-top: <+++>;\<++>", +" \'pb' : "padding-bottom: <+++>;\<++>", +" \'pl' : "padding-left: <+++>;\<++>", +" \'pr' : "padding-right: <+++>;\<++>", +" \ +" \'bor' : "border: <+++>;\<++>", +" \'bort' : "border-top: <+++>;\<++>", +" \'borb' : "border-bottom: <+++>;\<++>", +" \'borl' : "border-left: <+++>;\<++>", +" \'borr' : "border-right: <+++>;\<++>", +" \ +" \';abs' : "position: absolute;\<++>", +" \';rel' : "position: relative;\<++>", +" \';fix' : "position: fixed;\<++>", +" \ +" \';block' : "display: block;\<++>", +" \';inl' : "display: inline;\<++>", +" \';inb' : "display: inline-block;\<++>", +" \';flex' : "display: flex;\<++>", +" \';inf' : "display: inline-flex;\<++>", +" \ +" \'include' : "@import \"<+++>\";\<++>", +" \'@include' : "@import \"<+++>\";\<++>", +" \'require' : "@import \"<+++>\";\<++>", +" \'@require' : "@import \"<+++>\";\<++>", +" \'import' : "@import \"<+++>\";\<++>", +" \ +" \'media' : "@media (<+++>){\<++>\}", +" \';minw' : "@media (min-width: <+++>){\<++>\}", +" \';mindw' : "@media (min-width: @min-desktop-width){\<+++>\}", +" \} +" let g:quicktex_less = g:quicktex_css +" +" " JS {{{3 +" let g:quicktex_javascript = { +" \' ' : "\/<+.*+>\\"_c/+>/e\", +" \ +" \';fun' : "function <+++>(<++>){\<++>\}", +" \ +" \} +" " Latex Normal {{{3 +" let g:quicktex_tex = { +" \' ' : "\/<+.*+>\\"_c/+>/e\", +" \';b' : "\\textbf{<+++>} <++>", +" \';e' : "\\emph{<+++>} <++>", +" \'prf' : "\\begin{proof}\<+++>\\\end{proof}", +" \';m' : "$<+++>$ <++>", +" \';M' : "\\[ <+++> \\] <++>", +" \';ma' : "$a$ ", +" \';mb' : "$b$ ", +" \';mc' : "$c$ ", +" \';md' : "$d$ ", +" \';me' : "$e$ ", +" \';mf' : "$f$ ", +" \';mg' : "$g$ ", +" \';mh' : "$h$ ", +" \';mi' : "$i$ ", +" \';mj' : "$j$ ", +" \';mk' : "$k$ ", +" \';ml' : "$l$ ", +" \';mm' : "$m$ ", +" \';mn' : "$n$ ", +" \';mo' : "$o$ ", +" \';mp' : "$p$ ", +" \';mq' : "$q$ ", +" \';mr' : "$r$ ", +" \';ms' : "$s$ ", +" \';mt' : "$t$ ", +" \';mu' : "$u$ ", +" \';mv' : "$v$ ", +" \';mw' : "$w$ ", +" \';mx' : "$x$ ", +" \';my' : "$y$ ", +" \';mz' : "$z$ ", +" \';mA' : "$A$ ", +" \';mB' : "$B$ ", +" \';mC' : "$C$ ", +" \';mD' : "$D$ ", +" \';mE' : "$E$ ", +" \';mF' : "$F$ ", +" \';mG' : "$G$ ", +" \';mH' : "$H$ ", +" \';mI' : "$I$ ", +" \';mJ' : "$J$ ", +" \';mK' : "$K$ ", +" \';mL' : "$L$ ", +" \';mM' : "$M$ ", +" \';mN' : "$N$ ", +" \';mO' : "$O$ ", +" \';mP' : "$P$ ", +" \';mQ' : "$Q$ ", +" \';mR' : "$R$ ", +" \';mS' : "$S$ ", +" \';mT' : "$T$ ", +" \';mU' : "$U$ ", +" \';mV' : "$V$ ", +" \';mW' : "$W$ ", +" \';mX' : "$X$ ", +" \';mY' : "$Y$ ", +" \';mZ' : "$Z$ ", +" \} +" +" " Latex Maths {{{3 +" let g:quicktex_math = { +" \' ' : "\/<+.*+>\\"_c/+>/e\", +" \';b' : "\\mathbf{<+++>} <++>", +" \';B' : "\\mathbb{<+++>} <++>", +" \'fr' : '\mathcal{R} ', +" \'eq' : '= ', +" \'set' : '\{ <+++> \} <++>', +" \'frac' : '\frac{<+++>}{<++>} <++>', +" \'in' : '\in ', +" \'bn' : '\mathbb{N} ', +" \} +" +" " Markdown {{{3 +" let g:quicktex_markdown = { +" \' ' : "\/<+.*+>\\"_c/+>/e\", +" \';b' : "**<+++>** <++>", +" \';i' : "*<+++>* <++>", +" \';a' : "[<+++>](<+url+>) <++>", +" \} +" let g:quicktex_pandoc = g:quicktex_markdown +" " PHP {{{3 +" let g:quicktex_php = { +" \' ' : "\/<+.*+>\\"_c/+>/e\", +" \';ob' : "ob_start();\<+++>\ob_get_clean();", +" \';vd' : "var_dump(<+++>);", +" \';obvd' : "ob_start();\var_dump(<+++>);\echo htmlspecialchars(ob_get_clean());", +" \';nl' : "echo '
    ';", +" \} "}}} diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets new file mode 100644 index 0000000..25b6cb9 --- /dev/null +++ b/UltiSnips/php.snippets @@ -0,0 +1,40 @@ +snippet iff "Adds a function in an if" +if( !function_exists( '${1:function_name}' ) ): + /** + * $1 +`!p +parameters = t[2].split(',') +lines = [] +for param in parameters: + param = param.strip(); + if( param != '' ): + lines.append(' * @param ' + param + ' @todo'); + +snip.rv = "\n".join(lines); +` + * @return @todo + **/ + function $1($2){ + $6 + } + add_${3:action}( '${4:action_name}', '$1', ${5:10}, `!p +parameters = t[2] +if ( parameters == '' ): + snip.rv = 0 +else: + snip.rv = len( parameters.split(',') ); + +`); +endif; +$0 +endsnippet + +snippet obvd "Adds a var dump that is html escaped" +ob_start(); + var_dump(${1:${VISUAL}}); +echo htmlspecialchars(ob_get_clean()); +endsnippet + +snippet vd "Var dump" +var_dump(${1:${VISUAL}}); +endsnippet diff --git a/bundle/ultisnips b/bundle/ultisnips new file mode 160000 index 0000000..1a99766 --- /dev/null +++ b/bundle/ultisnips @@ -0,0 +1 @@ +Subproject commit 1a99766b73783bafb08cfa07d7e29e5387c55189 diff --git a/bundle/vim-snippets b/bundle/vim-snippets new file mode 160000 index 0000000..5dc42db --- /dev/null +++ b/bundle/vim-snippets @@ -0,0 +1 @@ +Subproject commit 5dc42dbc6c4d9b5068ddde901b79c5e483c42114