1
0
mirror of https://github.com/amix/vimrc synced 2025-06-29 19:34:59 +08:00

Updated plugins

This commit is contained in:
Amir
2024-01-07 16:14:20 +01:00
parent 86762cf230
commit f676f799e7
172 changed files with 3227 additions and 1204 deletions

View File

@ -169,6 +169,9 @@ on the fly adding those.
Currently all snippets from UltiSnips have been put into `/UltiSnips` - some work
on merging should be done (dropping duplicates etc). Also see engines section above.
Since UltiSnips supports both UltiSnip and vim-snipmate snippets, when
contributing fixes/new snippets, please prefer adding vim-snipmate snippets.
Related repositories
--------------------

View File

@ -21,7 +21,7 @@ def nl(snip):
snip.rv += " "
def getArgs(group):
import re
word = re.compile('[a-zA-Z0-9><.]+ \w+')
word = re.compile(r'[a-zA-Z0-9><.]+ \w+')
return [i.split(" ") for i in word.findall(group) ]
def camel(word):

View File

@ -6,7 +6,7 @@ import vim
# Set g:ultisnips_php_scalar_types to 1 if you'd like to enable PHP 7's scalar types for return values
def isPHPScalarTypesEnabled():
isEnabled = vim.eval("get(g:, 'ultisnips_php_scalar_types', 0)") == "1"
return isEnabled or re.match('<\?php\s+declare\(strict_types=[01]\);', '\n'.join(vim.current.window.buffer))
return isEnabled or re.match(r'<\?php\s+declare\(strict_types=[01]\);', '\n'.join(vim.current.window.buffer))
endglobal
## Snippets from SnipMate, taken from

View File

@ -285,7 +285,7 @@ snippet fnt "Footnote or Citation" i
.. [$1] ${2:Reference}
endsnippet
# Only for Nikola - Static Site Generator
# Only for Nikola Static Site Generator
snippet chart "Pygal chart for Nikola" b
.. chart:: $1`!p snip.rv=complete(t[1], CHART_TYPES)`
:title: '${2:Browser usage evolution (in %)}'

View File

@ -36,24 +36,6 @@ endglobal
# ENVIRONMENT #
###############
snippet beg "begin{} / end{}" bi
\begin{$1}
${0:${VISUAL}}
\end{$1}
endsnippet
snippet cnt "Center" bi
\begin{center}
${0:${VISUAL}}
\end{center}
endsnippet
snippet desc "Description" bi
\begin{description}
\item[${1:${VISUAL}}] $0
\end{description}
endsnippet
snippet lemma "Lemma" bi
\begin{lemma}
${0:${VISUAL}}
@ -135,24 +117,6 @@ snippet fig "Figure environment" bi
\end{figure}
endsnippet
snippet enum "Enumerate" bi
\begin{enumerate}
\item ${0:${VISUAL}}
\end{enumerate}
endsnippet
snippet item "Itemize" bi
\begin{itemize}
\item ${0:${VISUAL}}
\end{itemize}
endsnippet
snippet case "cases" bi
\begin{cases}
${0:${VISUAL}}
\end{cases}
endsnippet
snippet abs "abstract environment" b
\begin{abstract}
${0:${VISUAL}}
@ -247,26 +211,6 @@ snippet srto "... Root" wi
\sqrt[$1]{${2:${VISUAL}}}$0
endsnippet
snippet bf "Bold" wi
\bf{${1:${VISUAL}}}$0
endsnippet
snippet it "Italic" wi
\it{${1:${VISUAL}}}$0
endsnippet
snippet un "Underline" wi
\un{${1:${VISUAL}}}$0
endsnippet
snippet rm "Text" wi
\rm{${1:${VISUAL}}}$0
endsnippet
snippet itm "Item" wi
\item ${0:${VISUAL}}
endsnippet
snippet ceil "Ceil" w
\left\lceil $1 \right\rceil $0
endsnippet
@ -283,34 +227,10 @@ snippet bmat "Bmat" w
\begin{bmatrix} $1 \end{bmatrix} $0
endsnippet
snippet () "Left( right)" w
\left( ${1:${VISUAL}} \right) $0
endsnippet
snippet lr "left( right)" i
\left( ${1:${VISUAL}} \right) $0
endsnippet
snippet lr( "left( right)" i
\left( ${1:${VISUAL}} \right) $0
endsnippet
snippet lr| "left| right|" i
\left| ${1:${VISUAL}} \right| $0
endsnippet
snippet lr{ "left\{ right\}" i
\left\\{ ${1:${VISUAL}} \right\\} $0
endsnippet
snippet lrb "left\{ right\}" i
\left\\{ ${1:${VISUAL}} \right\\} $0
endsnippet
snippet lr[ "left[ right]" i
\left[ ${1:${VISUAL}} \right] $0
endsnippet
snippet lra "leftangle rightangle" wi
\left<${1:${VISUAL}} \right>$0
endsnippet
@ -467,112 +387,4 @@ snippet ac "Acroynm normal" bi
\ac{${1:acronym}}
endsnippet
snippet ni "Non-indented paragraph" bi
\noindent
endsnippet
############
# SECTIONS #
############
snippet chap "Chapter" wi
\chapter{$1${VISUAL}}
endsnippet
snippet sec "Section" wi
\section{$1${VISUAL}}
endsnippet
snippet sec* "Section*" wi
\section*{$1${VISUAL}}
endsnippet
snippet sub "Subsection" wi
\subsection{$1${VISUAL}}
endsnippet
snippet sub* "Subsection*" wi
\subsection*{$1${VISUAL}}
endsnippet
snippet subsub "Subsection" wi
\subsubsection{$1${VISUAL}}
endsnippet
snippet subsub* "Subsubsection" wi
\subsubsection*{$1${VISUAL}}
endsnippet
snippet par "Paragraph" wi
\paragraph{$1${VISUAL}}
endsnippet
snippet par* "Paragraph*" wi
\paragraph*{$1${VISUAL}}
endsnippet
snippet subpar "Sub Paragraph" wi
\subparagraph{$1${VISUAL}}
endsnippet
snippet subpar* "Sub Paragraph*" wi
\subparagraph*{$1${VISUAL}}
endsnippet
snippet chapl "Chapter with label" wi
\chapter{$1${VISUAL}}
\label{cha:${2:${1/\W+/-/g}}}
endsnippet
snippet secl "Section with label" wi
\section{$1${VISUAL}}
\label{sec:${2:${1/\W+/-/g}}}
endsnippet
snippet sec*l "Section* with label" wi
\section*{$1${VISUAL}}
\label{sec:${2:${1/\W+/-/g}}}
endsnippet
snippet subl "Subsection with label" wi
\subsection{$1${VISUAL}}
\label{sub:${2:${1/\W+/-/g}}}
endsnippet
snippet sub*l "Subsection* with label" wi
\subsection*{$1${VISUAL}}
\label{sub:${2:${1/\W+/-/g}}}
endsnippet
snippet subsubl "Subsection with label" wi
\subsubsection{$1${VISUAL}}
\label{ssub:${2:${1/\W+/-/g}}}
endsnippet
snippet subsub*l "Subsubsection with label" wi
\subsubsection*{$1${VISUAL}}
\label{ssub:${2:${1/\W+/-/g}}}
endsnippet
snippet parl "Paragraph with label" wi
\paragraph{$1${VISUAL}}
\label{par:${2:${1/\W+/-/g}}}
endsnippet
snippet par*l "Paragraph* with label" wi
\paragraph*{$1${VISUAL}}
\label{par:${2:${1/\W+/-/g}}}
endsnippet
snippet subparl "Sub Paragraph with label" wi
\subparagraph{$1${VISUAL}}
\label{subp:${2:${1/\W+/-/g}}}
endsnippet
snippet subpar*l "Sub Paragraph* with label" wi
\subparagraph*{$1${VISUAL}}
\label{subp:${2:${1/\W+/-/g}}}
endsnippet
# vim:ft=snippets:

View File

@ -14,7 +14,7 @@ def complete(tab, opts):
:return: a string that match with tab
"""
el = [x for x in tab]
pat = "".join(list(map(lambda x: x + "\w*" if re.match("\w", x) else x,
pat = "".join(list(map(lambda x: x + r"\w*" if re.match(r"\w", x) else x,
el)))
try:
opts = [x for x in opts if re.search(pat, x, re.IGNORECASE)]

View File

@ -16,11 +16,9 @@ snippet mainn
# #include <...>
snippet inc
#include <${1:stdio}.h>
$0
# #include "..."
snippet Inc
#include "${1:`vim_snippets#Filename("$1.h")`}"
$0
# ifndef...define...endif
snippet ndef
#ifndef $1

View File

@ -251,3 +251,29 @@ snippet sr "std::ranges::"
# STL std::views::
snippet sv "std::views::"
std::views::
##
## Tests
# GTest:add main
snippet gtemain "GTest:add main"
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
# GTest:add test
snippet gtetest "GTest:add test"
TEST(${1:SuiteName}, ${2:TestName}) {
${0}
}
# GTest:add fixture
snippet gtefix "GTest:add fixture"
TEST_F(${1:SuiteName}, ${2:TestName}) {
${0}
}
# GTest:add parameterized test
snippet gtepar "GTest:add parameterized test"
TEST_P(${1:SuiteName}, ${2:TestName}) {
${0}
}
# GTest:instantiate parameterized test
snippet gteparins "GTest:instantiate parameterized test"
INSTANTIATE_TEST_SUITE_P(${1:InstantiationName}, ${2:SuiteName}, ${0});

View File

@ -1,3 +1,10 @@
snippet af
(${1}) {${2}}${0}
snippet pr
print(${1});
snippet deb
debugger();
${0}
snippet lib
library ${1};
${0}

View File

@ -17,7 +17,7 @@ snippet *
# Definition
snippet def
(define (${1:name})
${0:definition})
${0:definition})
# Definition with lambda
snippet defl

View File

@ -195,11 +195,21 @@ snippet par \paragraph
\\paragraph{${1:paragraph name}}%
\\label{par:${2:$1}}
${0}
# Paragraph*
snippet par* \paragraph*
\\paragraph*{${1:paragraph name}}%
\\label{par:${2:$1}}
${0}
# Sub Paragraph
snippet subp \subparagraph
\\subparagraph{${1:subparagraph name}}%
\\label{subp:${2:$1}}
${0}
# Sub Paragraph*
snippet subp* \subparagraph*
\\subparagraph*{${1:subparagraph name}}%
\\label{subp:${2:$1}}
${0}
snippet ni \noindent
\\noindent
${0}