1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated all the plugins. Removed powerline. Added vim-airline (replacement for powerline). Added vim-fugitive.

This commit is contained in:
amix
2013-11-16 19:45:48 +00:00
parent 351979d3e0
commit 86f4456be1
239 changed files with 14942 additions and 8068 deletions

View File

@ -8,12 +8,12 @@ snippet .
# Function
snippet sub
sub ${1:function_name} {
${2}
${0}
}
# Conditional
snippet if
if (${1}) {
${2}
${0}
}
# Conditional if..else
snippet ife
@ -21,7 +21,7 @@ snippet ife
${2}
}
else {
${3}
${0}
}
# Conditional if..elsif..else
snippet ifee
@ -32,23 +32,23 @@ snippet ifee
${4:# elsif...}
}
else {
${5}
${0}
}
snippet eif
elsif (${1}) {
${2}
${0}
}
# Conditional One-line
snippet xif
${1:expression} if ${2:condition};${3}
${1:expression} if ${2:condition};
# Unless conditional
snippet unless
unless (${1}) {
${2}
${0}
}
# Unless conditional One-line
snippet xunless
${1:expression} unless ${2:condition};${3}
${1:expression} unless ${2:condition};
# Try/Except
snippet eval
local $@;
@ -56,37 +56,37 @@ snippet eval
${1:# do something risky...}
};
if (my $e = $@) {
${2:# handle failure...}
${0:# handle failure...}
}
# While Loop
snippet wh
while (${1}) {
${2}
${0}
}
# While Loop One-line
snippet xwh
${1:expression} while ${2:condition};${3}
${1:expression} while ${2:condition};
# C-style For Loop
snippet cfor
for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) {
${4}
${0}
}
# For loop one-line
snippet xfor
${1:expression} for @${2:array};${3}
${1:expression} for @${2:array};
# Foreach Loop
snippet for
foreach my $${1:x} (@${2:array}) {
${3}
${0}
}
# Foreach Loop One-line
snippet fore
${1:expression} foreach @${2:array};${3}
${1:expression} foreach @${2:array};
# Package
snippet package
package ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`};
${2}
${0}
1;
@ -95,7 +95,7 @@ snippet package
snippet packagev514
package ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99};
${3}
${0}
1;
@ -106,14 +106,14 @@ snippet moose
use namespace::autoclean;
${1:#}BEGIN {extends '${2:ParentClass}'};
${3}
${0}
# parent
snippet parent
use parent qw(${1:Parent Class});
use parent qw(${0:Parent Class});
# Read File
snippet slurp
my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> };
${3}
${0}
# strict warnings
snippet strwar
use strict;
@ -121,7 +121,7 @@ snippet strwar
# older versioning with perlcritic bypass
snippet vers
## no critic
our $VERSION = '${1:version}';
our $VERSION = '${0:version}';
eval $VERSION;
## use critic
# new 'switch' like feature
@ -131,7 +131,7 @@ snippet switch
# Anonymous subroutine
snippet asub
sub {
${1}
${0}
}
@ -139,56 +139,56 @@ snippet asub
# Begin block
snippet begin
BEGIN {
${1}
${0}
}
# call package function with some parameter
snippet pkgmv
__PACKAGE__->${1:package_method}(${2:var})
__PACKAGE__->${1:package_method}(${0:var})
# call package function without a parameter
snippet pkgm
__PACKAGE__->${1:package_method}()
__PACKAGE__->${0:package_method}()
# call package "get_" function without a parameter
snippet pkget
__PACKAGE__->get_${1:package_method}()
__PACKAGE__->get_${0:package_method}()
# call package function with a parameter
snippet pkgetv
__PACKAGE__->get_${1:package_method}(${2:var})
__PACKAGE__->get_${1:package_method}(${0:var})
# complex regex
snippet qrx
qr/
${1:regex}
${0:regex}
/xms
#simpler regex
snippet qr/
qr/${1:regex}/x
qr/${0:regex}/x
#given
snippet given
given ($${1:var}) {
${2:# cases}
${3:# default}
${0:# default}
}
# switch-like case
snippet when
when (${1:case}) {
${2}
${0}
}
# hash slice
snippet hslice
@{ ${1:hash} }{ ${2:array} }
@{ ${1:hash} }{ ${0:array} }
# map
snippet map
map { ${2: body } } ${1: @array } ;
map { ${0: body } } ${1: @array } ;
@ -206,7 +206,7 @@ snippet ppod
=head1 DESCRIPTION
${4:# longer description...}
${0:# longer description...}
=head1 INTERFACE
@ -222,13 +222,13 @@ snippet ppod
snippet psub
=head2 ${1:MethodName}
${2:Summary....}
${0:Summary....}
# Heading for inline subroutine pod
snippet psubi
=head2 ${1:MethodName}
${2:Summary...}
${0:Summary...}
=cut
@ -241,7 +241,7 @@ snippet subpod
=cut
sub ${1:subroutine_name} {
${2}
${0}
}
# Subroutine signature
snippet parg
@ -269,7 +269,7 @@ snippet parg
=item
C<${3:...return data}>
C<${0:...return data}>
=back
@ -287,7 +287,7 @@ snippet has
default => sub {
${4:defaultvalue}
},
${5:# other attributes}
${0:# other attributes}
);
@ -295,7 +295,7 @@ snippet has
snippet override
override ${1:attribute} => sub {
${2:# my $self = shift;};
${3:# my ($self, $args) = @_;};
${0:# my ($self, $args) = @_;};
};
@ -311,18 +311,18 @@ snippet tlib
#test methods
snippet tmeths
$ENV{TEST_METHOD} = '${1:regex}';
$ENV{TEST_METHOD} = '${0:regex}';
# runtestclass
snippet trunner
use ${1:test_class};
use ${0:test_class};
$1->runtests();
# Test::Class-style test
snippet tsub
sub t${1:number}_${2:test_case} :Test(${3:num_of_tests}) {
my $self = shift;
${4}
${0}
}
@ -330,14 +330,14 @@ snippet tsub
snippet trsub
test ${1:test_name} => { description => '${2:Description of test.}'} => sub {
my ($self) = @_;
${3}
${0}
};
#prep test method
snippet tprep
sub prep${1:number}_${2:test_case} :Test(startup) {
my $self = shift;
${4}
${0}
}
# cause failures to print stack trace