Installs UltiSnips

master
Jonathan Hodgson 5 years ago
parent a1608ce532
commit 6b21ece902
  1. 6
      .gitmodules
  2. 333
      .vimrc
  3. 40
      UltiSnips/php.snippets
  4. 1
      bundle/ultisnips
  5. 1
      bundle/vim-snippets

6
.gitmodules vendored

@ -84,3 +84,9 @@
[submodule "bundle/base16-vim"] [submodule "bundle/base16-vim"]
path = bundle/base16-vim path = bundle/base16-vim
url = https://github.com/chriskempson/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

333
.vimrc

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

@ -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

@ -0,0 +1 @@
Subproject commit 1a99766b73783bafb08cfa07d7e29e5387c55189

@ -0,0 +1 @@
Subproject commit 5dc42dbc6c4d9b5068ddde901b79c5e483c42114
Loading…
Cancel
Save