summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2019-01-04 13:41:05 +0100
committerFlorian Pritz <bluewind@xinu.at>2019-01-04 13:41:05 +0100
commit32c9d6f3ae2826057903cc9a2e1cafa1528fbed5 (patch)
treefc9f132d97ae42ca5ad2fb7dd0c4c20ea04fbda6
parentdec3c0391c75ba921baa89ee613e712117fe97bd (diff)
downloaddotfiles-32c9d6f3ae2826057903cc9a2e1cafa1528fbed5.tar.gz
dotfiles-32c9d6f3ae2826057903cc9a2e1cafa1528fbed5.tar.xz
vim: add perl/tex snippets
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--.vim/UltiSnips/perl.snippets150
-rw-r--r--.vim/UltiSnips/tex.snippets11
2 files changed, 161 insertions, 0 deletions
diff --git a/.vim/UltiSnips/perl.snippets b/.vim/UltiSnips/perl.snippets
index 61d9a83..51589b5 100644
--- a/.vim/UltiSnips/perl.snippets
+++ b/.vim/UltiSnips/perl.snippets
@@ -12,3 +12,153 @@ method new_no_defaults($class: $deps = {}) {
}
endsnippet
+
+snippet mpod
+=head3 ${1:method name}
+
+ my ${4:x} = $${2:class}->$1(${3:params});
+
+$0
+
+=cut
+endsnippet
+
+snippet method
+=head3 ${1:method name}
+
+ my ${4:x} = $${2:class}->$1(${3:params});
+
+$5
+
+=cut
+
+method $1($3) {
+ $0
+}
+endsnippet
+
+snippet pname
+${1:`!v expand('%:p:s?.*lib/??:r:gs?/?::?')`}
+endsnippet
+
+snippet package
+package ${1:`!v expand('%:p:s?.*lib/??:r:gs?/?::?')`};
+use strictures;
+
+use autodie;
+use Function::Parameters;
+use Log::Any qw($log);
+
+=head1 NAME
+
+$1 - ${2:ShortDesc}
+
+=head1 SYNOPSIS
+
+use $1;
+
+${3:# synopsis...}
+
+=head1 DESCRIPTION
+
+${4:# longer description...}
+
+=head1 METHODS
+
+=head2 new
+
+ my $${5:obj} = $1->new();
+
+Returns a new instance.
+
+=cut
+
+method new($class: $deps = {}) {
+ return $class->new_no_defaults($deps);
+}
+
+method new_no_defaults($class: $deps = {}) {
+ my $self = {};
+ bless $self, $class;
+ $self->{deps} = $deps;
+ return $self;
+}
+
+=head2 Public Methods
+
+=cut
+
+$0
+
+1;
+
+__END__
+endsnippet
+
+snippet packagectx
+package ${1:`!v expand('%:p:s?.*lib/??:r:gs?/?::?')`};
+use strictures;
+
+use autodie;
+use Function::Parameters;
+use Log::Any qw($log);
+
+=head1 NAME
+
+$1 - ${2:ShortDesc}
+
+=head1 SYNOPSIS
+
+use $1;
+
+${3:# synopsis...}
+
+=head1 DESCRIPTION
+
+${4:# longer description...}
+
+=head1 METHODS
+
+=head2 new
+
+ my $${5:obj} = $1->new();
+
+Returns a new instance or an existing instance for singleton classes.
+
+=cut
+
+method new($class: $context, $deps = {}) {
+ return $class->new_no_defaults($context, $deps);
+}
+
+method new_no_defaults($class: $context, $deps = {}) {
+ return $context->{$class} if defined $context->{$class};
+
+ my $self = {};
+ bless $self, $class;
+ $self->{deps} = $deps;
+ $context->{$class} = $self;
+ return $self;
+}
+
+=head2 Public Methods
+
+=cut
+
+$0
+
+1;
+
+__END__
+endsnippet
+
+snippet testf
+use strictures 2;
+
+use Log::Any::Adapter ('TAP');
+use Test::More;
+use Test::MockObject;
+use Test::Differences;
+use Test::Exception;
+
+endsnippet
diff --git a/.vim/UltiSnips/tex.snippets b/.vim/UltiSnips/tex.snippets
index 1c29c16..a021cc4 100644
--- a/.vim/UltiSnips/tex.snippets
+++ b/.vim/UltiSnips/tex.snippets
@@ -10,3 +10,14 @@ snippet frame "frame environment" b
\end{frame}
endsnippet
+snippet lst "lstlisting" b
+\begin{lstlisting}[caption={$1},label=lst:$2]
+$0
+\end{lstlisting}
+endsnippet
+
+snippet minipage "minipage" b
+\begin{minipage}{\textwidth}
+$0
+\end{minipage}
+endsnippet