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

Updated plugins. Fixed some issues related to empty space and peaksea. Using Source Code Pro as default font

This commit is contained in:
amix
2013-12-28 18:23:13 +00:00
parent 86f4456be1
commit 08a64d943d
35 changed files with 553 additions and 90 deletions

View File

@ -24,6 +24,14 @@ def textmate_var(var, snip):
endglobal
snippet % "<% ${0} %>"
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)`
endsnippet
snippet = "<%= ${0} %>"
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
endsnippet
###########################################################################
# GENERATED FROM get_tm_snippets.py + REGEX REPLACE #
###########################################################################

View File

@ -1,7 +1,7 @@
# sugguestion? report bugs?
# go to https://github.com/chrisyue/vim-snippets/issues
snippet contr "symfony2 controller" b
snippet contr "Symfony2 controller" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
@ -25,19 +25,19 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
}
endsnippet
snippet act "symfony2 action" b
snippet act "Symfony2 action" b
/**
* @Route("${3}", name="${4}")
* @Method({${5:"POST"}})
* @Template()
*/
public function ${1}Action(${2})
{
${6}
return $this->redirect($this->generateUrl('home', [], false));
}
endsnippet
snippet actt "symfony2 action and template" b
snippet actt "Symfony2 action and template" b
/**
* @Route("${3}", name="${4}")
* @Method({${5:"GET"}})
@ -51,7 +51,7 @@ public function ${1}Action(${2})
abspath = os.path.abspath(path)`
endsnippet
snippet comm "symfony2 command" b
snippet comm "Symfony2 command" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
@ -74,14 +74,12 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
{
protected function configure()
{
$this
->setName('${1}')
$this->setName('${1}')
->setDescription('${2}')
->setDefinition([
new InputArgument('', InputArgument::REQUIRED, ''),
new InputOption('', null, InputOption::VALUE_NONE, ''),
])
;
]);
}
protected function execute(InputInterface $input, OutputInterface $output)
@ -90,7 +88,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
}
endsnippet
snippet subs "symfony2 subscriber" b
snippet subs "Symfony2 subscriber" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
@ -121,7 +119,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
}
endsnippet
snippet transf "symfony2 form data transformer" b
snippet transf "Symfony2 form data transformer" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
@ -155,7 +153,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
}
endsnippet
snippet ent "symfony2 doctrine entity" b
snippet ent "Symfony2 doctrine entity" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
@ -192,7 +190,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
}
endsnippet
snippet form "symfony2 form type" b
snippet form "Symfony2 form type" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
@ -235,3 +233,27 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
}
}
endsnippet
snippet ev "Symfony2 event" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
if m:
snip.rv = m.group().replace('/', '\\')
`;
use Symfony\Component\EventDispatcher\Event;
/**
* ${2:@author `whoami`}
*/
class `!p
snip.rv = re.match(r'.*(?=\.)', fn).group()
` extends Event
{
}
endsnippet
snippet redir "Symfony2 redirect"
$this->redirect($this->generateUrl('${1}', ${2}));
endsnippet

View File

@ -0,0 +1,33 @@
snippet bl "twig block" b
{% block ${1} %}
${2}
{% endblock $1 %}
endsnippet
snippet js "twig javascripts" b
{% javascripts '${1}' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
endsnippet
snippet css "twig stylesheets" b
{% stylesheets '${1}' %}
<link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}
endsnippet
snippet if "twig if" b
{% if ${1} %}
${2}
{% endif %}
endsnippet
snippet for "twig for" b
{% for ${1} in ${2} %}
${3}
{% endfor %}
endsnippet
snippet ext "twig extends" b
{% extends ${1} %}
endsnippet

View File

@ -557,3 +557,44 @@ snippet CSVIterator
snippet is
isset($1{VISUAL})
# phpunit
snippet ase
$this->assertEquals(${1:expected}, ${2:actual});
snippet asne
$this->assertNotEquals(${1:expected}, ${2:actual});
snippet asf
$this->assertFalse(${1:Something});
snippet ast
$this->assertTrue(${1:Something});
snippet asfex
$this->assertFileExists(${1:path/to/file});
snippet asfnex
$this->assertFileNotExists(${1:path/to/file});
snippet ascon
$this->assertContains(${1:Search Value}, ${2:Array or Iterator});
snippet ashk
$this->assertArrayHasKey(${1:key}, ${2:array});
snippet asnhk
this->assertArrayNotHasKey(${1:value}, ${2:array});
snippet ascha
$this->assertClassHasAttribute('${1:Attribute Name}', '${2:ClassName}');
snippet asi
$this->assertInstanceOf(${1:expected}, ${2:actual});
snippet tc
public function test${1:name_of_the_test}()
{
${0:code}
}

View File

@ -223,14 +223,22 @@ snippet define
}
snippet service
service{ "${1:service}":
enable => ${2:true},
ensure => ${0:running},
hasstatus => true,
service { '${1:service}' :
ensure => running,
enable => true,
require => [ Package['${2:package}'], File['${3:file}'], ],
subscribe => [ File['${4:configfile1}'], File['${5:configfile2}'], Package['${6:package}'], ]
}
snippet file
file{ "${1:path}":
${2} => ${0}
file { '${1:filename}' :
ensure => ${2:present},
owner => '${3:root}',
group => '${4:root}',
mode => '${5:0644}',
source => 'puppet:///modules/${6:module}/${7:source}',
content => template('/etc/puppet/templates/${8:template}'),
alias => '${9:alias}',
require => [ Package['${10:package}'], File['${11:file}'], ],
}

View File

@ -174,7 +174,7 @@ snippet ana
accepts_nested_attributes_for :${0:association}
# ivc == instance variable cache
snippet ivc
@${1:variable_name} ||= ${0:chached_value}
@${1:variable_name} ||= ${0:cached_value}
# include Enumerable
snippet Enum
include Enumerable

View File

@ -0,0 +1,64 @@
# Some useful Unicode entities
# ============================
# Non-Breaking Space
snippet nbs
&nbsp;
# ←
snippet left
&#x2190;
# →
snippet right
&#x2192;
# ↑
snippet up
&#x2191;
# ↓
snippet down
&#x2193;
# ↩
snippet return
&#x21A9;
# ⇤
snippet backtab
&#x21E4;
# ⇥
snippet tab
&#x21E5;
# ⇧
snippet shift
&#x21E7;
# ⌃
snippet ctrl
&#x2303;
# ⌅
snippet enter
&#x2305;
# ⌘
snippet cmd
&#x2318;
# ⌥
snippet option
&#x2325;
# ⌦
snippet delete
&#x2326;
# ⌫
snippet backspace
&#x232B;
# ⎋
snippet esc
&#x238B;
# Forms
# =====
snippet fieldset
fieldset
legend ${1}
# Assets
# ======
snippet css
link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}"
snippet script
script src="${1:script.js}" type="text/javascript"