${0} @@ -610,7 +608,7 @@ snippet map# snippet map+ - ${5}${6} + ${5}${6} snippet mark ${0} @@ -627,17 +625,17 @@ snippet menu:t ${0} snippet meta - + snippet meta:s - + snippet meta:d - + snippet meta:compat - + snippet meta:refresh - + snippet meta:utf - + snippet meter ${0} snippet nav @@ -665,13 +663,13 @@ snippet movie - - + + + pluginspage="http://www.apple.com/quicktime/download/" /> snippet ol
    @@ -711,7 +709,7 @@ snippet p. snippet p#

    ${0}

    snippet param - + snippet pre
     		${0}
    @@ -774,7 +772,7 @@ snippet select+
     snippet small
     	${0}
     snippet source
    -	
    +	
     snippet span
     	${0}
     snippet span.
    @@ -853,7 +851,7 @@ snippet tr+
     		td+${0}
     	
     snippet track
    -	
    diff --git a/sources_non_forked/vim-snippets/snippets/java.snippets b/sources_non_forked/vim-snippets/snippets/java.snippets
    index e40bbf52..39cc850a 100644
    --- a/sources_non_forked/vim-snippets/snippets/java.snippets
    +++ b/sources_non_forked/vim-snippets/snippets/java.snippets
    @@ -214,12 +214,20 @@ snippet wh
     	while (${1}) ${0}
     ##
     ## Main method
    +snippet psvm
    +	public static void main (String[] args) {
    +		${0}
    +	}
     snippet main
     	public static void main (String[] args) {
     		${0}
     	}
     ##
     ## Print Methods
    +snippet sout
    +	System.out.println(${0});
    +snippet serr
    +	System.err.println(${0});
     snippet print
     	System.out.print("${0:Message}");
     snippet printf
    diff --git a/sources_non_forked/vim-snippets/snippets/javascript-bemjson.snippets b/sources_non_forked/vim-snippets/snippets/javascript-bemjson.snippets
    new file mode 100644
    index 00000000..7899c22d
    --- /dev/null
    +++ b/sources_non_forked/vim-snippets/snippets/javascript-bemjson.snippets
    @@ -0,0 +1,52 @@
    +# Snippet for bemjson. https://en.bem.info/platform/bemjson/
    +
    +# Blocks
    +snippet b
    +	{
    +		block : '${1:name}',
    +		content : [
    +			'${2:content}'
    +		]
    +	}
    +
    +# btc - BEM block with text content
    +snippet btc
    +	{
    +		 block : '${1:name}',
    +		 content: '${2:content}'
    +	}
    +
    +# bwm - BEM block with modifier.
    +snippet bwm
    +	{
    +		block : '${1:name}',
    +		mods: { ${2:modName}: '${3:modVal}' },
    +		content : [
    +			'${4:content}'
    +		]
    +	}
    +
    +# Elems
    +
    +# e - BEM elem
    +snippet e
    +	{
    +		elem : '${1:name}',
    +		content : [
    +			'${2:content}'
    +		]
    +	}
    +
    +
    +# mo - Mods
    +snippet mo
    +	mods : { ${1:modName} : '${2:modVal}' },
    +
    +# mi - BEM mix mod
    +snippet mi
    +	mix : [ { ${1:block} : '${2:block}' } ],
    +
    +# a - BEM attrs mod
    +snippet a
    +	attrs : { ${1:attr} : '${2:val}' },
    +
    diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript.d3.snippets b/sources_non_forked/vim-snippets/snippets/javascript-d3.snippets
    similarity index 100%
    rename from sources_non_forked/vim-snippets/snippets/javascript/javascript.d3.snippets
    rename to sources_non_forked/vim-snippets/snippets/javascript-d3.snippets
    diff --git a/sources_non_forked/vim-snippets/snippets/javascript-mocha.snippets b/sources_non_forked/vim-snippets/snippets/javascript-mocha.snippets
    new file mode 100644
    index 00000000..cabfd401
    --- /dev/null
    +++ b/sources_non_forked/vim-snippets/snippets/javascript-mocha.snippets
    @@ -0,0 +1,18 @@
    +snippet des "Describe" b
    +	describe('${1:}', () => {
    +		${0}
    +	});
    +snippet it "it" b
    +	it('${1:}', () => {
    +		${0}
    +	});
    +snippet xit "xit" b
    +	xit('${1:}', () => {
    +		${0}
    +	});
    +snippet exp "expect" b
    +	expect(${1:})${0};
    +snippet expe "expect" b
    +	expect(${1:}).to.equal(${0});
    +snippet expd "expect" b
    +	expect(${1:}).to.deep.equal(${0});
    diff --git a/sources_non_forked/vim-snippets/snippets/javascript.es6.react.snippets b/sources_non_forked/vim-snippets/snippets/javascript.es6.react.snippets
    new file mode 100644
    index 00000000..0762eb6b
    --- /dev/null
    +++ b/sources_non_forked/vim-snippets/snippets/javascript.es6.react.snippets
    @@ -0,0 +1,81 @@
    +# Import only React
    +snippet ri1
    +	import React from 'react'
    +
    +# Import both React and Component
    +snippet ri2
    +	import React, { Component, PropTypes } from 'react'
    +
    +# React class
    +snippet rcla
    +	class ${1:MyComponent} extends Component {
    +		render() {
    +			return (
    +				${0:
    } + ) + } + } + +# React constructor +snippet rcon + constructor(props) { + super(props) + + this.state = { + ${1}: ${0}, + } + } + +# Proptypes for React Class +snippet rcpt + static propTypes = { + ${1}: PropTypes.${0}, + } + +# Default props for React Class +snippet rcdp + static defaultProps = { + ${1}: ${0}, + } + +# Presentational component +snippet rcom + (props) => { + return ( + ${0:
    } + ) + } + +# Proptypes for Presentational component +snippet rpt + ${1}.propTypes = { + ${2}: PropTypes.${0}, + } + +# Default props for Presentational component +snippet rdp + ${1}.defaultProps = { + ${2}: ${0}, + } + +# Lifecycle Methods +snippet rcdm + componentDidMount() { + ${0} + } + +# State +snippet rsst + this.setState({ + ${1}: ${0}, + }) + +snippet rtst + this.state.${0} + +# Props +snippet rp + props.${0} + +snippet rtp + this.props.${0} diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript-react.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript-react.snippets new file mode 100644 index 00000000..9deae796 --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript-react.snippets @@ -0,0 +1,83 @@ +snippet ir + import React from 'react'; +snippet ird + import ReactDOM from 'react-dom'; +snippet cdm + componentDidMount() { + ${1} + } +snippet cdup + componentDidUpdate(prevProps, prevState) { + ${1} + } +snippet cwm + componentWillMount() { + ${1} + } +snippet cwr + componentWillReceiveProps(nextProps) { + ${1} + } +snippet cwun + componentWillUnmount() { + ${1} + } +snippet cwu + componentWillUpdate(nextProps, nextState) { + ${1} + } +snippet fup + forceUpdate(${1:callback}); +snippet dp + static defaultProps = { + ${1}: ${2}, + } +snippet st + state = { + ${1}: ${2}, + } +snippet pt + static propTypes = { + ${1}: React.PropTypes.${2:type}, + } +snippet rcc + class ${1:ClassName} extends React.Component { + render() { + return ( + ${0:
    } + ); + } + } +snippet rdr + ReactDOM.render(${1}, ${2}) +snippet ercc + export default class ${1:ClassName} extends React.Component { + render() { + return ( + ${0:
    } + ); + } + } +snippet ctor + constructor() { + super(); + ${1} + } +snippet ren + render() { + return ( + ${1:
    } + ); + } +snippet sst + this.setState({ + ${1}: ${2} + }); +snippet scu + shouldComponentUpdate(nextProps, nextState) { + ${1} + } +snippet prp i + this.props.${1} +snippet ste i + this.state.${1} diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript.es6.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript.es6.snippets index df059a15..a1adedef 100644 --- a/sources_non_forked/vim-snippets/snippets/javascript/javascript.es6.snippets +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript.es6.snippets @@ -2,8 +2,12 @@ snippet const const ${1} = ${0}; snippet let let ${1} = ${0}; -snippet im - import ${1} from '${0}'; +snippet im "import xyz from 'xyz'" + import ${1} from '${2:$1}'; +snippet imas "import * as xyz from 'xyz'" + import * as ${1} from '${2:$1}'; +snippet imm "import { member } from 'xyz'" + import { ${1} } from '${2}'; snippet cla class ${1} { ${0} @@ -12,6 +16,29 @@ snippet clax class ${1} extends ${2} { ${0} } +snippet clac + class ${1} { + constructor(${2}) { + ${0} + } + } +snippet foro "for (const prop of object}) { ... }" + for (const ${1:prop} of ${2:object}) { + ${0:$1} + } +# Generator +snippet fun* + function* ${1:function_name}(${2}) { + ${0} + } +snippet c=> + const ${1:function_name} = (${2}) => { + ${0} + } +snippet caf + const ${1:function_name} = (${2}) => { + ${0} + } snippet => (${1}) => { ${0} diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript.node.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript.node.snippets index 2b5aefb4..489e0abb 100644 --- a/sources_non_forked/vim-snippets/snippets/javascript/javascript.node.snippets +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript.node.snippets @@ -5,7 +5,7 @@ snippet ex module.exports = ${1}; # require snippet re - ${1:var} ${2} = require('${3:module_name}'); + ${1:const} ${2} = require('${3:module_name}'); # EventEmitter snippet on on('${1:event_name}', function(${2:stream}) { diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets index 0d054f4e..0ac0bfb4 100644 --- a/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets @@ -1,5 +1,4 @@ # Functions - # prototype snippet proto ${1:class_name}.prototype.${2:method_name} = function(${3}) { @@ -30,6 +29,11 @@ snippet (f (function(${1}) { ${0} }(${2})); +# Minify safe iife +snippet ;fe + ;(function(${1}) { + ${0} + }(${2})) # self-defining function snippet sdf var ${1:function_name} = function (${2:argument}) { @@ -39,9 +43,7 @@ snippet sdf ${0} }; }; - # Flow control - # if snippet if if (${1:true}) { @@ -95,9 +97,6 @@ snippet terr # return snippet ret return ${0:result}; - -# Loops - # for loop snippet for for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2++) { @@ -123,9 +122,7 @@ snippet fori for (var ${1:prop} in ${2:object}) { ${0:$2[$1]} } - # Objects - # Object Method snippet :f ${1:method_name}: function (${2:attribute}) { @@ -202,9 +199,7 @@ snippet prop configurable : ${0:boolean} } ); - # Documentation - # docstring snippet /** /** @@ -223,9 +218,7 @@ snippet jsonp # JSON.stringify snippet jsons JSON.stringify(${0:object}); - # DOM selectors - # Get elements snippet get getElementsBy${1:TagName}('${0}') @@ -244,7 +237,6 @@ snippet qs # Query selector all snippet qsa ${1:document}.querySelectorAll('${0:CSS selector}') - # Debugging snippet de debugger; @@ -257,6 +249,12 @@ snippet cd # console.error snippet ce console.error(${0}); +# console.warn +snippet cw + console.warn(${0}); +# console.info +snippet ci + console.info(${0}); # console.trace snippet ct console.trace(${0:label}); @@ -269,13 +267,10 @@ snippet ca # console.dir snippet cdir console.dir(${0:obj}); - # Misc - # 'use strict'; snippet us 'use strict'; - # setTimeout function snippet timeout setTimeout(function () {${0}}${2}, ${1:10}); diff --git a/sources_non_forked/vim-snippets/snippets/lfe.snippets b/sources_non_forked/vim-snippets/snippets/lfe.snippets new file mode 100644 index 00000000..b716e6ef --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/lfe.snippets @@ -0,0 +1,18 @@ +snippet defmo + (defmodule ${1:`vim_snippets#Filename()`} + (export ${2:all})) + $0 +snippet def + (defun $1 ($2) + $0) +snippet ltest + (defmodule ${1:`vim_snippets#Filename()`} + (behaviour ltest-unit) + (export all)) + + (include-lib "ltest/include/ltest-macros.lfe") + + $0 +snippet test + (deftest $1 + $0) diff --git a/sources_non_forked/vim-snippets/snippets/make.snippets b/sources_non_forked/vim-snippets/snippets/make.snippets index 68a75e25..332d6fc9 100644 --- a/sources_non_forked/vim-snippets/snippets/make.snippets +++ b/sources_non_forked/vim-snippets/snippets/make.snippets @@ -43,3 +43,8 @@ snippet el # .DEFAULT_GOAL := target snippet default .DEFAULT_GOAL := ${1} +# help target for self-documented Makefile +snippet help + help: ## Prints help for targets with comments + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $\$1, $\$2}' + ${0} diff --git a/sources_non_forked/vim-snippets/snippets/mustache.snippets b/sources_non_forked/vim-snippets/snippets/mustache.snippets new file mode 100644 index 00000000..ad8723ed --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/mustache.snippets @@ -0,0 +1,15 @@ +snippet if # {{#value}} ... {{/value}} + {{#${1:value}}} + ${0} + {{/$1}} +snippet ifn # {{^value}} ... {{/value}} + {{^${1:value}}} + ${0} + {{/$1}} +snippet ife # {{#value}} ... {{/value}} {{^value}} ... {{/value}} + {{#${1:value}}} + ${2} + {{/$1}} + {{^$1}} + ${3} + {{/$1}} diff --git a/sources_non_forked/vim-snippets/snippets/perl.snippets b/sources_non_forked/vim-snippets/snippets/perl.snippets index 65120a25..2ed2932a 100644 --- a/sources_non_forked/vim-snippets/snippets/perl.snippets +++ b/sources_non_forked/vim-snippets/snippets/perl.snippets @@ -84,7 +84,9 @@ snippet fore ${1:expression} foreach @${2:array}; # Package snippet package - package ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}; + package ${1:`expand('%:p:s?.*lib/??:r:gs?/?::?')`}; + use strict; + use warnings; ${0} @@ -93,7 +95,9 @@ snippet package __END__ # Package syntax perl >= 5.14 snippet packagev514 - package ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99}; + package ${1:`expand('%:p:s?.*lib/??:r:gs?/?::?')`} ${2:0.99}; + use v5.14; + use warnings; ${0} diff --git a/sources_non_forked/vim-snippets/snippets/php.snippets b/sources_non_forked/vim-snippets/snippets/php.snippets index f611c7c1..2d9f5152 100644 --- a/sources_non_forked/vim-snippets/snippets/php.snippets +++ b/sources_non_forked/vim-snippets/snippets/php.snippets @@ -2,6 +2,8 @@ snippet ${8:$1} = $$1; + return $this; } -# getter method -snippet gm +snippet gm "PHP Class Getter Setter" /** * Gets the value of ${1:foo} * - * @return ${2:$1} + * @return ${2:string} */ - ${3:public} function get${4:$2}() + ${3:public} function get${4:$1}() { return $this->${5:$1}; } @@ -81,13 +79,14 @@ snippet $s #getter snippet $g ${1:$foo}->get${0:Bar}(); - # Tertiary conditional snippet =?: $${1:foo} = ${2:true} ? ${3:a} : ${0}; snippet ?: ${1:true} ? ${2:a} : ${0} - +snippet t "$retVal = (condition) ? a : b" + $${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b}; +# Predefined variables snippet C $_COOKIE['${1:variable}'] snippet E @@ -104,7 +103,12 @@ snippet S $_SERVER['${1:variable}'] snippet SS $_SESSION['${1:variable}'] - +snippet get "get" + $_GET['${1}'] +snippet post "post" + $_POST['${1}'] +snippet session "session" + $_SESSION['${1}'] # the following are old ones snippet inc include '${1:file}'; @@ -205,7 +209,19 @@ snippet doc_h * @copyright ${4:$2}, `strftime('%d %B, %Y')` * @package ${0:default} */ - +snippet doc_i "interface someClass {}" + /** + * $1 + * @package ${2:default} + * @author ${3:`!v g:snips_author`} + **/ + interface ${1:someClass} + {${4} + } +snippet inheritdoc "@inheritdoc docblock" + /** + * {@inheritdoc} + */ # Interface snippet interface /** @@ -254,55 +270,54 @@ snippet nc ${0} } # define(...) -snippet def - define('${1}'${2}); +snippet def "define('VARIABLE_NAME', 'definition')" + define('${1:VARIABLE_NAME}', ${2:'definition'}); # defined(...) snippet def? ${1}defined('${2}') -snippet wh +snippet wh "while (condition) { ... }" while (${1:/* condition */}) { ${0} } -# do ... while -snippet do +snippet do "do { ... } while (condition)" do { ${0} - } while (${1:/* condition */}); -snippet if - if (${1:/* condition */}) { + } while (${1}); +snippet if "if (condition) { ... }" + if (${1}) { ${0} } -snippet ifn - if (!${1:/* condition */}) { +snippet ifn "if (!condition) { ... }" + if (!${1}) { ${2} } -snippet ifil - +snippet ifil " ... " + ${0} -snippet ife - if (${1:/* condition */}) { +snippet ife "if (cond) { ... } else { ... }" + if (${1}) { ${2} } else { ${3} } ${0} -snippet ifeil - - ${2:} +snippet ifeil " ... ... " + + ${2} - ${3:} + ${3} ${0} -snippet el +snippet el "else { ... }" else { ${0} } -snippet eif +snippet eif "elseif(condition) { ... }" elseif (${1}) { ${0} } -snippet switch +snippet switch "switch($var) { case 'xyz': ... default: .... }" switch ($${1:variable}) { case '${2:value}': ${3} @@ -312,34 +327,33 @@ snippet switch ${4} break; } -snippet case +snippet case "case 'value': ... break" case '${1:value}': ${2} break; -snippet for +snippet for "for ($i = 0; $i < $count; $i++) { ... }" for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { ${0} } -snippet foreach +snippet foreach "foreach ($var as $value) { .. }" foreach ($${1:variable} as $${2:value}) { ${0} } -snippet foreachil +snippet foreachil " ... " - ${0:} + ${0} -snippet foreachk +snippet foreachk "foreach ($var as $key => $value) { .. }" foreach ($${1:variable} as $${2:key} => $${3:value}) { ${0} } -snippet foreachkil +snippet foreachkil " $value): ?> ... " $${3:value}): ?> ${0:} -# $... = array (...) -snippet array b - $${1:arrayName} = array('${2}' => ${3}); -snippet try +snippet array "$... = ['' => ]" + $${1:arrayName} = ['${2}' => ${3}]; +snippet try "try { ... } catch (Exception $e) { ... }" try { ${0} } catch (${1:Exception} $e) { @@ -369,14 +383,22 @@ snippet http_redirect header ("HTTP/1.1 301 Moved Permanently"); header ("Location: ".URL); exit(); +snippet log "error_log(var_export($var, true));" + error_log(var_export(${1}, true)); +snippet var "var_export($var)" + var_export(${1}); +snippet ve "Dumb debug helper in HTML" + echo '
    ' . var_export(${1}, 1) . '
    '; +snippet pc "Dumb debug helper in cli" + var_export($1);$0 # Getters & Setters -snippet gs +snippet gs "PHP Class Getter Setter" /** * Gets the value of ${1:foo} * - * @return ${2:$1} + * @return ${2:string} */ - public function get${3:$2}() + public function get${3:$1}() { return $this->${4:$1}; } @@ -425,14 +447,12 @@ snippet aw array_walk($${1:foo}, function(&$${2:v}, $${3:k}) { $$2 = ${0}; }); - # static var assign once snippet static_var static $${1} = null; if (is_null($$1)){ $$1 = ${2}; } - snippet CSVWriter fputcsv_args = array($this->f, null, $sep, $quot); + $this->fputcsv_args = [$this->f, null, $sep, $quot]; if (!$this->f) throw new Exception('bad file descriptor'); } @@ -467,7 +487,6 @@ snippet CSVWriter } } - snippet CSVIterator // http://snipplr.com/view.php?codeview&id=1986 // modified @@ -483,7 +502,7 @@ snippet CSVIterator * enclosure * delimiter */ - public function __construct( $file_or_handle, $opts = array(4096, ',') ) + public function __construct( $file_or_handle, $opts = [4096, ','] ) { $d = function($n) use(&$opts){ return isset($opts[$n]) ? $opts[$n] : false; }; @@ -496,13 +515,13 @@ snippet CSVIterator ? fopen( $file_or_handle, 'r' ) : $file_or_handle; if (!$this->f) throw new Exception('bad file descriptor'); - $this->fgetcsv_args = array( + $this->fgetcsv_args = [ $this->f, isset($opts['row_size']) ? $opts['row_size'] : 4096, isset($opts['delimiter']) ? $opts['delimiter'] : ',', isset($opts['enclosure']) ? $opts['enclosure'] : '"', isset($opts['escape']) ? $opts['escape'] : '\\', - ); + ]; $this->start(); } @@ -570,72 +589,75 @@ snippet CSVIterator } } // end class - -snippet is - isset($1{VISUAL}) - -# phpunit -snippet ase +# phpunit +snippet ase "$this->assertEquals()" $this->assertEquals(${1:expected}, ${2:actual}); - -snippet asne +snippet asne "$this->assertNotEquals()" $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 +snippet asf "$this->assertFalse()" + $this->assertFalse(${1}); +snippet ast "$this->assertTrue()" + $this->assertTrue(${1}); +snippet asfex "$this->assertFileExists()" + $this->assertFileExists(${1:'path/to/file'}); +snippet asfnex "$this->assertFileNotExists()" + $this->assertFileNotExists(${1:'path/to/file'}); +snippet ascon "$this->assertContains()" + $this->assertContains(${1:$needle}, ${2:$haystack}); +snippet ashk "$this->assertArrayHasKey()" + $this->assertArrayHasKey(${1:$key}, ${2:$array}); +snippet asnhk "$this->assertArrayNotHasKey()" + this->assertArrayNotHasKey(${1:$key}, ${2:$array}); +snippet ascha "$this->assertClassHasAttribute()" + $this->assertClassHasAttribute(${1:$attributeName}, '${2:$className}'); +snippet asi "$this->assertInstanceOf(...)" $this->assertInstanceOf(${1:expected}, ${2:actual}); - -snippet tc - public function test${1:name_of_the_test}() +snippet test "public function testXYZ() { ... }" + public function test${1}() { - ${0:code} + ${0} } -snippet te +snippet setup "protected function setUp() { ... }" + protected function setUp() + { + ${0} + } +snippet teardown "protected function tearDown() { ... }" + protected function tearDown() + { + ${0} + } +snippet exp "phpunit expects" + expects($this->${1:once}()) + ->method('${2}') + ->with($this->equalTo(${3})${4}) + ->will($this->returnValue(${5})); +snippet testcmt "phpunit comment with group" + /** + * @group ${1} + */ +snippet fail "$this->fail()" + $this->fail(${1}); +snippet marki "$this->markTestIncomplete()" + $this->markTestIncomplete(${1}); +snippet marks "$this->markTestSkipped()" + $this->markTestSkipped(${1}); +# end of phpunit snippets +snippet te "throw new Exception()" throw new ${1:Exception}("${2:Error Processing Request}"); - snippet fpc "file_put_contents" b file_put_contents(${1:file}, ${2:content}${3:, FILE_APPEND});$0 - snippet sr "str_replace" str_replace(${1:search}, ${2:replace}, ${3:subject})$0 - snippet ia "in_array" in_array(${1:needle}, ${2:haystack})$0 - snippet is "isset" isset(${1:var})$0 - snippet isa "isset array" isset($${1:array}[${2:key}])$0 - snippet in "is_null" is_null($${1:var})$0 - snippet fe "file_exists" file_exists(${1:file})$0 - snippet id "is_dir" is_dir(${1:path})$0 diff --git a/sources_non_forked/vim-snippets/snippets/ps1.snippets b/sources_non_forked/vim-snippets/snippets/ps1.snippets new file mode 100644 index 00000000..acab10cc --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/ps1.snippets @@ -0,0 +1,58 @@ +# Snippets for +# Authored by Trevor Sullivan + +# PowerShell Class +snippet class + class { + [string] ${0:FirstName} + } + +# PowerShell Advanced Function +snippet function + function {0:name} { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [string] $Param1 + ) + + begin { + } + + process { + } + + end { + } + } + +# PowerShell Splatting +snippet splatting + $Params = @{ + ${0:Param1} = 'Value1' + ${1:Param2} = 'Value2' + } + ${3:CommandName} + +# PowerShell Enumeration +snippet enum + enum ${0:name} { + ${1:item1} + ${2:item2} + } + +# PowerShell if..then +snippet if + if (${0:condition}) { + ${1:statement} + } + +# PowerShell While Loop +snippet while + while (${0:condition}) { + ${1:statement} + } + +# PowerShell Filter..Sort +snippet filtersort + ${0:command} | Where-Object -FilterScript { $PSItem.${1:property} -${2:operator} '${3:expression}' } | Sort-Object -Property ${4:sortproperty} diff --git a/sources_non_forked/vim-snippets/snippets/purescript.snippets b/sources_non_forked/vim-snippets/snippets/purescript.snippets new file mode 100644 index 00000000..06d6b34a --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/purescript.snippets @@ -0,0 +1,52 @@ +snippet mod + module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` + ( + ) where + + import Prelude + + ${0} +snippet imp + import ${0:Data.List} +snippet impq + import ${1:Data.List} as ${0:List} +snippet fn0 + ${1:name} :: ${2:a} + $1 = ${0:undefined} +snippet fn + ${1:fn} :: ${2:a} -> ${3:a} + $1 ${4}= ${0} +snippet fn1 + ${1:fn} :: ${2:a} -> ${3:a} + $1 ${4}= ${0} +snippet fn2 + ${1:fn} :: ${2:a} -> ${3:a} -> ${4:a} + $1 ${5}= ${0} +snippet fn3 + ${1:fn} :: ${2:a} -> ${3:a} -> ${4:a} -> ${5:a} + $1 ${6}= ${0} +snippet case + case ${1} of + ${2} -> ${0} +snippet let + let + ${1} = ${2} + in + ${3} +snippet where + where + ${1} = ${0} +snippet testunit + module Test.Main where + + import Prelude + import Test.Unit (suite, test) + import Test.Unit.Main (runTest) + import Test.Unit.Assert as Assert + + main = runTest do + suite "${1}" do + test "${2:the tests run}" do + Assert.equal + "Hello, world!" + "Hello, sailor!" diff --git a/sources_non_forked/vim-snippets/snippets/rails.snippets b/sources_non_forked/vim-snippets/snippets/rails.snippets index e8342222..6a5c5ff0 100644 --- a/sources_non_forked/vim-snippets/snippets/rails.snippets +++ b/sources_non_forked/vim-snippets/snippets/rails.snippets @@ -325,7 +325,7 @@ snippet xpost snippet xput xhr :put, :${1:update}, id: ${2:1}, ${3:object}: ${4:object} snippet test - test 'should ${1:do something}' do + test '${1:should do something}' do ${0} end ########################### diff --git a/sources_non_forked/vim-snippets/snippets/ruby.snippets b/sources_non_forked/vim-snippets/snippets/ruby.snippets index a6340e46..772f4644 100644 --- a/sources_non_forked/vim-snippets/snippets/ruby.snippets +++ b/sources_non_forked/vim-snippets/snippets/ruby.snippets @@ -1,5 +1,7 @@ snippet enc # encoding: utf-8 +snippet frozen + # frozen_string_literal: true snippet #! #!/usr/bin/env ruby # New Block diff --git a/sources_non_forked/vim-snippets/snippets/sass.snippets b/sources_non_forked/vim-snippets/snippets/sass.snippets new file mode 100644 index 00000000..7207360c --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/sass.snippets @@ -0,0 +1,36 @@ +extends css + +snippet $ + $${1:variable}: ${0:value} +snippet imp + @import '${0}' +snippet mix + @mixin ${1:name}(${2}) + ${0} +snippet inc + @include ${1:mixin}(${2}) +snippet ext + @extend ${0} +snippet fun + @function ${1:name}(${2:args}) + ${0} +snippet if + @if ${1:condition} + ${0} +snippet ife + @if ${1:condition} + ${2} + @else + ${0} +snippet eif + @else if ${1:condition} + ${0} +snippet for + @for ${1:$i} from ${2:1} through ${3:3} + ${0} +snippet each + @each ${1:$item} in ${2:items} + ${0} +snippet while + @while ${1:$i} ${2:>} ${3:0} + ${0} diff --git a/sources_non_forked/vim-snippets/snippets/stylus.snippets b/sources_non_forked/vim-snippets/snippets/stylus.snippets index 205f8479..3ce35c26 100644 --- a/sources_non_forked/vim-snippets/snippets/stylus.snippets +++ b/sources_non_forked/vim-snippets/snippets/stylus.snippets @@ -379,6 +379,8 @@ snippet d:mis display -moz-inline-stack snippet d:b display block +snippet d:f + display flex snippet d:cp display compact snippet d:ib @@ -991,3 +993,7 @@ snippet for for ${1:i} in ${0} snippet keyf @keyframes ${0} +snippet jc:c + justify-content center +snippet jc + justify-content diff --git a/sources_non_forked/vim-snippets/snippets/tex.snippets b/sources_non_forked/vim-snippets/snippets/tex.snippets index a618ceb1..05ec852c 100644 --- a/sources_non_forked/vim-snippets/snippets/tex.snippets +++ b/sources_non_forked/vim-snippets/snippets/tex.snippets @@ -1,317 +1,327 @@ +#version 1 #PREAMBLE #newcommand snippet nc \newcommand - \newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0} + \\newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0} #usepackage snippet up \usepackage - \usepackage[${1:options}]{${2:package}} ${0} + \\usepackage[${1:options}]{${2:package}} ${0} #newunicodechar snippet nuc \newunicodechar - \newunicodechar{${1}}{${2:\ensuremath}${3:tex-substitute}}} ${0} + \\newunicodechar{${1}}{${2:\\ensuremath}${3:tex-substitute}}} ${0} #DeclareMathOperator snippet dmo \DeclareMathOperator - \DeclareMathOperator{${1}}{${2}} ${0} + \\DeclareMathOperator{${1}}{${2}} ${0} #DOCUMENT # \begin{}...\end{} snippet begin \begin{} ... \end{} block - \begin{${1:env}} - ${0} - \end{$1} + \\begin{${1:env}} + ${0:${VISUAL}} + \\end{$1} # Tabular snippet tab tabular (or arbitrary) environment - \begin{${1:tabular}}{${2:c}} - ${0} - \end{$1} + \\begin{${1:tabular}}{${2:c}} + ${0:${VISUAL}} + \\end{$1} snippet thm thm (or arbitrary) environment with optional argument - \begin[${1:author}]{${2:thm}} - ${0} - \end{$2} + \\begin[${1:author}]{${2:thm}} + ${0:${VISUAL}} + \\end{$2} snippet center center environment - \begin{center} - ${0} - \end{center} + \\begin{center} + ${0:${VISUAL}} + \\end{center} # Align(ed) snippet ali align(ed) environment - \begin{align${1:ed}} - \label{eq:${2}} - ${0} - \end{align$1} + \\begin{align${1:ed}} + \\label{eq:${2}} + ${0:${VISUAL}} + \\end{align$1} # Gather(ed) snippet gat gather(ed) environment - \begin{gather${1:ed}} - ${0} - \end{gather$1} + \\begin{gather${1:ed}} + ${0:${VISUAL}} + \\end{gather$1} # Equation snippet eq equation environment - \begin{equation} - ${0} - \end{equation} + \\begin{equation} + ${0:${VISUAL}} + \\end{equation} # Equation snippet eql Labeled equation environment - \begin{equation} - \label{eq:${2}} - ${0} - \end{equation} + \\begin{equation} + \\label{eq:${2}} + ${0:${VISUAL}} + \\end{equation} # Equation snippet eq* unnumbered equation environment - \begin{equation*} - ${0} - \end{equation*} + \\begin{equation*} + ${0:${VISUAL}} + \\end{equation*} # Unnumbered Equation snippet \ unnumbered equation: \[ ... \] - \[ - ${0} - \] + \\[ + ${0:${VISUAL}} + \\] # Equation array snippet eqnarray eqnarray environment - \begin{eqnarray} - ${0} - \end{eqnarray} + \\begin{eqnarray} + ${0:${VISUAL}} + \\end{eqnarray} # Label snippet lab \label - \label{${1:eq:}${2:fig:}${3:tab:}${0}} + \\label{${1:eq:}${2:fig:}${3:tab:}${0}} # Enumerate snippet enum enumerate environment - \begin{enumerate} - \item ${0} - \end{enumerate} + \\begin{enumerate} + \\item ${0} + \\end{enumerate} snippet enuma enumerate environment - \begin{enumerate}[(a)] - \item ${0} - \end{enumerate} + \\begin{enumerate}[(a)] + \\item ${0} + \\end{enumerate} snippet enumi enumerate environment - \begin{enumerate}[(i)] - \item ${0} - \end{enumerate} + \\begin{enumerate}[(i)] + \\item ${0} + \\end{enumerate} # Itemize snippet itemize itemize environment - \begin{itemize} - \item ${0} - \end{itemize} + \\begin{itemize} + \\item ${0} + \\end{itemize} snippet item \item - \item ${1} + \\item ${1:${VISUAL}} # Description snippet desc description environment - \begin{description} - \item[${1}] ${0} - \end{description} + \\begin{description} + \\item[${1}] ${0} + \\end{description} # Endless new item snippet ]i \item (recursive) - \item ${1} + \\item ${1} ${0:]i} # Matrix snippet mat smart matrix environment - \begin{${1:p/b/v/V/B/small}matrix} - ${0} - \end{$1matrix} + \\begin{${1:p/b/v/V/B/small}matrix} + ${0:${VISUAL}} + \\end{$1matrix} # Cases snippet cas cases environment - \begin{cases} - ${1:equation}, &\text{ if }${2:case}\\ - ${0} - \end{cases} + \\begin{cases} + ${1:equation}, &\\text{ if }${2:case}\\ + ${0:${VISUAL}} + \\end{cases} # Split snippet spl split environment - \begin{split} - ${0} - \end{split} + \\begin{split} + ${0:${VISUAL}} + \\end{split} # Part snippet part document \part - \part{${1:part name}} % (fold) - \label{prt:${2:$1}} + \\part{${1:part name}} % (fold) + \\label{prt:${2:$1}} ${0} % part $2 (end) # Chapter snippet cha \chapter - \chapter{${1:chapter name}} - \label{cha:${2:$1}} + \\chapter{${1:chapter name}} + \\label{cha:${2:$1}} ${0} # Section snippet sec \section - \section{${1:section name}} - \label{sec:${2:$1}} + \\section{${1:section name}} + \\label{sec:${2:$1}} ${0} # Section without number snippet sec* \section* - \section*{${1:section name}} - \label{sec:${2:$1}} + \\section*{${1:section name}} + \\label{sec:${2:$1}} ${0} # Sub Section snippet sub \subsection - \subsection{${1:subsection name}} - \label{sub:${2:$1}} + \\subsection{${1:subsection name}} + \\label{sub:${2:$1}} ${0} # Sub Section without number snippet sub* \subsection* - \subsection*{${1:subsection name}} - \label{sub:${2:$1}} + \\subsection*{${1:subsection name}} + \\label{sub:${2:$1}} ${0} # Sub Sub Section snippet subs \subsubsection - \subsubsection{${1:subsubsection name}} - \label{ssub:${2:$1}} + \\subsubsection{${1:subsubsection name}} + \\label{ssub:${2:$1}} ${0} # Sub Sub Section without number snippet subs* \subsubsection* - \subsubsection*{${1:subsubsection name}} - \label{ssub:${2:$1}} + \\subsubsection*{${1:subsubsection name}} + \\label{ssub:${2:$1}} ${0} # Paragraph snippet par \paragraph - \paragraph{${1:paragraph name}} - \label{par:${2:$1}} + \\paragraph{${1:paragraph name}} + \\label{par:${2:$1}} ${0} # Sub Paragraph snippet subp \subparagraph - \subparagraph{${1:subparagraph name}} - \label{subp:${2:$1}} + \\subparagraph{${1:subparagraph name}} + \\label{subp:${2:$1}} ${0} snippet ni \noindent - \noindent + \\noindent ${0} #References snippet itd description \item - \item[${1:description}] ${0:item} + \\item[${1:description}] ${0:item} snippet figure reference to a figure - ${1:Figure}~\ref{${2:fig:}} + ${1:Figure}~\\ref{${2:fig:}} snippet table reference to a table - ${1:Table}~\ref{${2:tab:}} + ${1:Table}~\\ref{${2:tab:}} snippet listing reference to a listing - ${1:Listing}~\ref{${2:list}} + ${1:Listing}~\\ref{${2:list}} snippet section reference to a section - ${1:Section}~\ref{sec:${2}} ${0} + ${1:Section}~\\ref{sec:${2}} ${0} snippet page reference to a page - ${1:page}~\pageref{${2}} ${0} + ${1:page}~\\pageref{${2}} ${0} snippet index \index - \index{${1:index}} ${0} + \\index{${1:index}} ${0} #Citations snippet citen \citen - \citen{${1}} ${0} + \\citen{${1}} ${0} # natbib citations snippet citep \citep - \citep{${1}} ${0} + \\citep{${1}} ${0} snippet citet \citet - \citet{${1}} ${0} + \\citet{${1}} ${0} snippet cite \cite[]{} - \cite[${1}]{${2}} ${0} + \\cite[${1}]{${2}} ${0} snippet citea \citeauthor - \citeauthor{${1}} ${0} + \\citeauthor{${1}} ${0} snippet citey \citeyear - \citeyear{${1}} ${0} + \\citeyear{${1}} ${0} snippet fcite \footcite[]{} - \footcite[${1}]{${2}}${0} + \\footcite[${1}]{${2}}${0} #Formating text: italic, bold, underline, small capital, emphase .. snippet it italic text - \textit{${0:text}} + \\textit{${0:${VISUAL:text}}} snippet bf bold face text - \textbf{${0:text}} + \\textbf{${0:${VISUAL:text}}} snippet under underline text - \underline{${0:text}} + \\underline{${0:${VISUAL:text}}} snippet emp emphasize text - \emph{${0:text}} + \\emph{${0:${VISUAL:text}}} snippet sc small caps text - \textsc{${0:text}} + \\textsc{${0:${VISUAL:text}}} #Choosing font snippet sf sans serife text - \textsf{${0:text}} + \\textsf{${0:${VISUAL:text}}} snippet rm roman font text - \textrm{${0:text}} + \\textrm{${0:${VISUAL:text}}} snippet tt typewriter (monospace) text - \texttt{${0:text}} + \\texttt{${0:${VISUAL:text}}} #Math font snippet mf mathfrak - \mathfrak{${0:text}} + \\mathfrak{${0:${VISUAL:text}}} snippet mc mathcal - \mathcal{${0:text}} + \\mathcal{${0:${VISUAL:text}}} snippet ms mathscr - \mathscr{${0:text}} + \\mathscr{${0:${VISUAL:text}}} #misc snippet ft \footnote - \footnote{${0:text}} + \\footnote{${0:${VISUAL:text}}} snippet fig figure environment (includegraphics) - \begin{figure} - \begin{center} - \includegraphics[scale=${1}]{Figures/${2}} - \end{center} - \caption{${3}} - \label{fig:${4}} - \end{figure} + \\begin{figure} + \\begin{center} + \\includegraphics[scale=${1}]{Figures/${2}} + \\end{center} + \\caption{${3}} + \\label{fig:${4}} + \\end{figure} ${0} snippet tikz figure environment (tikzpicture) - \begin{figure} - \begin{center} - \begin{tikzpicture}[scale=${1:1}] + \\begin{figure}[htpb] + \\begin{center} + \\begin{tikzpicture}[scale=${1:1}, transform shape] ${2} - \end{tikzpicture} - \end{center} - \caption{${3}} - \label{fig:${4}} - \end{figure} + \\end{tikzpicture} + \\end{center} + \\caption{${3}} + \\label{fig:${4}} + \\end{figure} + ${0} +snippet subfig subfigure environment + \\begin{subfigure}[${1}]{${2:\\textwidth}} + \\begin{center} + ${3} + \\end{center} + \\caption{${4}} + \\label{fig:${5}} + \\end{subfigure} ${0} #math snippet stackrel \stackrel{}{} - \stackrel{${1:above}}{${2:below}} ${0} + \\stackrel{${1:above}}{${2:below}} ${0} snippet frac \frac{}{} - \frac{${1:num}}{${2:denom}} ${0} + \\frac{${1:num}}{${2:denom}} ${0} snippet sum \sum^{}_{} - \sum^{${1:n}}_{${2:i=1}} ${0} + \\sum^{${1:n}}_{${2:i=1}} ${0} snippet lim \lim_{} - \lim_{${1:n \to \infty}} ${0} + \\lim_{${1:n \\to \\infty}} ${0} snippet frame frame environment - \begin{frame}[${1:t}]{${2:title}} - ${0} - \end{frame} + \\begin{frame}[${1:t}]{${2:title}} + ${0:${VISUAL}} + \\end{frame} snippet block block environment - \begin{block}{${1:title}} - ${0} - \end{block} + \\begin{block}{${1:title}} + ${0:${VISUAL}} + \\end{block} snippet alert alertblock environment - \begin{alertblock}{${1:title}} - ${0} - \end{alertblock} + \\begin{alertblock}{${1:title}} + ${0:${VISUAL}} + \\end{alertblock} snippet example exampleblock environment - \begin{exampleblock}{${1:title}} - ${0} - \end{exampleblock} + \\begin{exampleblock}{${1:title}} + ${0:${VISUAL}} + \\end{exampleblock} snippet col2 two-column environment - \begin{columns} - \begin{column}{0.5\textwidth} + \\begin{columns} + \\begin{column}{0.5\\textwidth} ${1} - \end{column} - \begin{column}{0.5\textwidth} + \\end{column} + \\begin{column}{0.5\\textwidth} ${0} - \end{column} - \end{columns} + \\end{column} + \\end{columns} snippet \{ \{ \} \\{ ${0} \\} #delimiter snippet lr left right - \left${1} ${0} \right$1 -snippet lr( left( right) - \left( ${0} \right) -snippet lr| left| right| - \left| ${0} \right| -snippet lr{ left\{ right\} - \left\\{ ${0} \right\\} -snippet lr[ left[ right] - \left[ ${0} \right] -snippet lra langle rangle - \langle ${0} \rangle + \\left${1} ${0} \\right$1 +snippet lr( left( right) + \\left( ${0} \\right) +snippet lr| left| right| + \\left| ${0} \\right| +snippet lr{ left\{ right\} + \\left\\{ ${0} \\right\\} +snippet lr[ left[ right] + \\left[ ${0} \\right] +snippet lra langle rangle + \\langle ${0} \\rangle # Code listings snippet lst - \begin{listing}[language=${1:language}] - ${0} - \end{listing} + \\begin{listing}[language=${1:language}] + ${0:${VISUAL}} + \\end{listing} snippet lsi - \lstinline|${1}| ${0} + \\lstinline|${1}| ${0} # Hyperlinks snippet url - \url{${1}} ${0} + \\url{${1}} ${0} snippet href - \href{${1}}{${2}} ${0} + \\href{${1}}{${2}} ${0} # URL from Clipboard. snippet urlc - \url{`@+`} ${0} + \\url{`@+`} ${0} snippet hrefc - \href{`@+`}{${1}} ${0} + \\href{`@+`}{${1}} ${0} diff --git a/sources_non_forked/vim-snippets/snippets/twig.snippets b/sources_non_forked/vim-snippets/snippets/twig.snippets index 50ae8232..47997c3b 100644 --- a/sources_non_forked/vim-snippets/snippets/twig.snippets +++ b/sources_non_forked/vim-snippets/snippets/twig.snippets @@ -1,43 +1,34 @@ -# twig block -snippet bl +snippet bl "{% block xyz %} .. {% endblock xyz %}" {% block ${1} %} ${2} {% endblock $1 %} -# twig javascripts -snippet js +snippet js "{% javascripts 'xyz' %} .. {% endjavascripts %}" {% javascripts '${1}' %} {% endjavascripts %} -# twig stylesheets -snippet css +snippet css "{% stylesheets 'xyz' %} .. {% endstylesheets %}" {% stylesheets '${1}' %} {% endstylesheets %} -# twig if -snippet if +snippet if "{% if %} .. {% endif %}" {% if ${1} %} ${2} {% endif %} -# twig if ... else -snippet ife +snippet ife "{% if %} .. {% else %} .. {% endif %}" {% if ${1} %} ${2} {% else %} ${0} {% endif %} -# twig else -snippet el +snippet el "{% else %}" {% else %} ${0} -# twig elseif -snippet eif +snippet eif "{% elseif %}" {% elseif ${1} %} ${0} -# twig for -snippet for +snippet for "{% for x in y %} .. {% endfor %}" {% for ${1} in ${2} %} ${3} {% endfor %} -# twig extends -snippet ext +snippet ext "{% extends xyz %}" {% extends ${1} %} diff --git a/sources_non_forked/vim-snippets/snippets/vhdl.snippets b/sources_non_forked/vim-snippets/snippets/vhdl.snippets new file mode 100644 index 00000000..f13f5bf9 --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/vhdl.snippets @@ -0,0 +1,127 @@ +# +## Libraries + +snippet lib + library ${1} + use ${1}.${2} + +# Standard Libraries +snippet libs + library IEEE; + use IEEE.std_logic_1164.ALL; + use IEEE.numeric_std.ALL; + +# Xilinx Library +snippet libx + library UNISIM; + use UNISIM.VCOMPONENTS.ALL; + +## Entity Declaration +snippet ent + entity ${1:`vim_snippets#Filename()`} is + generic ( + ${2} + ); + port ( + ${3} + ); + end entity $1; + +## Architecture +snippet arc + architecture ${1:behav} of ${2:`vim_snippets#Filename()`} is + + ${3} + + begin + + + end $1; + +## Declarations +# std_logic +snippet st + signal ${1} : std_logic; +# std_logic_vector +snippet sv + signal ${1} : std_logic_vector (${2} downto 0); +# std_logic in +snippet ist + ${1} : in std_logic; +# std_logic_vector in +snippet isv + ${1} : in std_logic_vector (${2} downto 0); +# std_logic out +snippet ost + ${1} : out std_logic; +# std_logic_vector out +snippet osv + ${1} : out std_logic_vector (${2} downto 0); +# unsigned +snippet un + signal ${1} : unsigned (${2} downto 0); +## Process Statements +# process +snippet pr + process (${1}) + begin + ${2} + end process; +# process with clock +snippet prc + process (${1:clk}) + begin + if rising_edge ($1) then + ${2} + end if; + end process; +# process all +snippet pra + process (${1:all}) + begin + ${2} + end process; +## Control Statements +# if +snippet if + if ${1} then + ${2} + end if; +# if +snippet ife + if ${1} then + ${2} + else + ${3} + end if; +# else +snippet el + else + ${1} +# if +snippet eif + elsif ${1} then + ${2} +# case +snippet ca + case ${1} is + ${2} + end case; +# when +snippet wh + when ${1} => + ${2} +# for +snippet for + for ${1:i} in ${2} ${3:to} ${4} loop + ${5} + end loop; +# while +snippet wh + while ${1} loop + ${2} + end loop; +## Misc +# others +snippet oth + (others => '${1:0}'); diff --git a/sources_non_forked/vim-surround/plugin/surround.vim b/sources_non_forked/vim-surround/plugin/surround.vim index 6a986e89..46f32529 100644 --- a/sources_non_forked/vim-surround/plugin/surround.vim +++ b/sources_non_forked/vim-surround/plugin/surround.vim @@ -92,7 +92,7 @@ function! s:process(string) let m = matchstr(a:string,nr2char(i).'.\{-\}\ze'.nr2char(i)) if m != '' let m = substitute(strpart(m,1),'\r.*','','') - let repl_{i} = input(substitute(m,':\s*$','','').': ') + let repl_{i} = input(match(m,'\w\+$') >= 0 ? m.': ' : m) endif endfor let s = "" diff --git a/temp_dirs/undodir/.gitignore b/temp_dirs/undodir/.gitignore new file mode 100644 index 00000000..47e856eb --- /dev/null +++ b/temp_dirs/undodir/.gitignore @@ -0,0 +1,2 @@ +# http://stackoverflow.com/a/932982 +!.gitignore diff --git a/temp_dirs/undodir/README.md b/temp_dirs/undodir/README.md new file mode 100644 index 00000000..37f6debe --- /dev/null +++ b/temp_dirs/undodir/README.md @@ -0,0 +1 @@ +Undo dir for VIM diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index e6e232ea..6c1d423c 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -84,9 +84,9 @@ set wildmenu " Ignore compiled files set wildignore=*.o,*~,*.pyc if has("win16") || has("win32") - set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store -else set wildignore+=.git\*,.hg\*,.svn\* +else + set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store endif "Always show current position @@ -131,6 +131,12 @@ set novisualbell set t_vb= set tm=500 +" Properly disable sound on errors on MacVim +if has("gui_macvim") + autocmd GUIEnter * set vb t_vb= +endif + + " Add a bit extra margin to the left set foldcolumn=1 @@ -141,6 +147,11 @@ set foldcolumn=1 " Enable syntax highlighting syntax enable +" Enable 256 colors palette in Gnome Terminal +if $COLORTERM == 'gnome-terminal' + set t_Co=256 +endif + try colorscheme desert catch @@ -206,10 +217,6 @@ vnoremap # :call VisualSelection('', '')?=@/ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Moving around, tabs, windows and buffers """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Treat long lines as break lines (useful when moving around in them) -map j gj -map k gk - " Map to / (search) and Ctrl- to ? (backwards search) map / map ? @@ -376,11 +383,11 @@ function! VisualSelection(direction, extra_filter) range let l:saved_reg = @" execute "normal! vgvy" - let l:pattern = escape(@", '\\/.*$^~[]') + let l:pattern = escape(@", "\\/.*'$^~[]") let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'gv' - call CmdLine("Ag \"" . l:pattern . "\" " ) + call CmdLine("Ag '" . l:pattern . "' " ) elseif a:direction == 'replace' call CmdLine("%s" . '/'. l:pattern . '/') endif diff --git a/vimrcs/extended.vim b/vimrcs/extended.vim index 649ed083..499959a2 100644 --- a/vimrcs/extended.vim +++ b/vimrcs/extended.vim @@ -21,12 +21,6 @@ elseif has("unix") set gfn=Monospace\ 11 endif -" Open MacVim in fullscreen mode -if has("gui_macvim") - set fuoptions=maxvert,maxhorz - au GUIEnter * set fullscreen -endif - " Disable scrollbars (real hackers don't use scrollbars for navigation!) set guioptions-=r set guioptions-=R diff --git a/vimrcs/filetypes.vim b/vimrcs/filetypes.vim index 164454eb..8c4eb9db 100644 --- a/vimrcs/filetypes.vim +++ b/vimrcs/filetypes.vim @@ -17,6 +17,9 @@ au FileType python map 1 /class au FileType python map 2 /def au FileType python map C ?class au FileType python map D ?def +au FileType python set cindent +au FileType python set cinkeys-=0# +au FileType python set indentkeys-=0# """""""""""""""""""""""""""""" @@ -54,3 +57,11 @@ endfunction au FileType coffee call CoffeeScriptFold() au FileType gitcommit call setpos('.', [0, 1, 1, 0]) + + +"""""""""""""""""""""""""""""" +" => Shell section +"""""""""""""""""""""""""""""" +if exists('$TMUX') + set term=screen-256color +endif diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index 5d2ef45d..44d761cb 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -159,7 +159,7 @@ func! SyntasticCheckCoffeescript() execute "SyntasticCheck" execute "Errors" endfunc -nnoremap l :call SyntasticCheckCoffeescript() +nnoremap c :call SyntasticCheckCoffeescript() """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""