mirror of
				https://github.com/amix/vimrc
				synced 2025-10-31 06:33:35 +08:00 
			
		
		
		
	Updated plugins
This commit is contained in:
		| @ -724,7 +724,7 @@ snippet jc:sa | ||||
| snippet jc:se | ||||
| 	justify-content: space-evenly; | ||||
| snippet jc:st | ||||
| 	justify-content: space-evenly; | ||||
| 	justify-content: stretch; | ||||
| snippet jc:l | ||||
| 	justify-content: left; | ||||
| snippet jc:r | ||||
|  | ||||
| @ -1,27 +1,74 @@ | ||||
| extends html | ||||
|  | ||||
| snippet assign | ||||
| 	<#assign ${1} = ${0:${VISUAL}} /> | ||||
|  | ||||
| snippet if | ||||
| 	<#if ${1}> | ||||
| # Freemarker version | ||||
| snippet ver "${.version}" | ||||
| 	\${.version} | ||||
| # Interpolation | ||||
| snippet int "${interpolation}" | ||||
| 	\${${0:interpolation${VISUAL}}\} | ||||
| # Interpolation with default string | ||||
| snippet intd "${interpolation!"default_string"}" | ||||
| 	\${${0:interpolation${VISUAL}}!"${1:default_string}"\} | ||||
| # Comment | ||||
| snippet com "<#-- comment -->" | ||||
| 	<#-- ${0:comment${VISUAL}} --> | ||||
| # Variable assignment on a single line | ||||
| snippet ass "<#assign variable_name = value />" | ||||
| 	<#assign ${1:variable_name} = ${0:value${VISUAL}} /> | ||||
| # Variable assignments on multiple lines | ||||
| snippet assm "<#assign <#-- multiple lines --> />" | ||||
| 	<#assign | ||||
| 		${1:variable_name} = ${0:value${VISUAL}} | ||||
| 	/> | ||||
| # Local variable assignment on a single | ||||
| snippet loc "<#local variable_name = value />" | ||||
| 	<#local ${1:variable_name} = ${0:value${VISUAL}} /> | ||||
| # Local variable assignments on multiple lines | ||||
| snippet locm "<#local <#-- multiple lines --> />" | ||||
| 	<#local | ||||
| 		${1:variable_name} = ${0:value${VISUAL}} | ||||
| 	/> | ||||
| # Include Freemarker file | ||||
| snippet inc "<#include \"file.ftl\" />" | ||||
| 	<#include "${0:file.ftl${VISUAL}}" /> | ||||
| # If statement | ||||
| snippet if "<#if condition>...</#if>" | ||||
| 	<#if ${1:true}> | ||||
| 		${0:${VISUAL}} | ||||
| 	</#if> | ||||
|  | ||||
| snippet ife | ||||
| 	<#if ${1}> | ||||
| 		${2:${VISUAL}} | ||||
| # If/else statement | ||||
| snippet ife "<#if condition>...<#else>...</#if>" | ||||
| 	<#if ${1:true}> | ||||
| 		${0:${VISUAL}} | ||||
| 	<#else> | ||||
| 		${0} | ||||
| 		${2} | ||||
| 	</#if> | ||||
|  | ||||
| snippet list | ||||
| 	<#list ${1} as ${2}> | ||||
| # Iteration over a sequence | ||||
| snippet lis "<#list sequence as element>...</#list>" | ||||
| 	<#list ${1:sequence} as ${2:element}> | ||||
| 		${0:${VISUAL}} | ||||
| 	</#list> | ||||
|  | ||||
| snippet attempt | ||||
| # Iteration over an hashmap | ||||
| snippet lish "<#list hashmap?keys as element>...</#list>" | ||||
| 	<#list ${1:hashmap}?keys as ${2:key}> | ||||
| 		\${$2\}: \${$1[$2]\}${0:${VISUAL}} | ||||
| 	</#list> | ||||
| # Macro statement | ||||
| snippet mac "<#macro macro_name param1>...</#macro>" | ||||
| 	<#macro ${1:macro_name} ${2:param1}> | ||||
| 		${0:${VISUAL}} | ||||
| 	</#macro> | ||||
| # Function statement | ||||
| snippet fun "<#function function_name param1>...</#function>" | ||||
| 	<#function ${1:function_name} ${2:param1}> | ||||
| 		${0:${VISUAL}} | ||||
| 	</#function> | ||||
| # Attempt statement (try-catch to prevent runtime exceptions) | ||||
| snippet att "<#attempt>...<#recover></#attempt>" | ||||
| 	<#attempt> | ||||
| 		${0:${VISUAL}} | ||||
| 	<#recover> | ||||
| 	</#attempt> | ||||
| # Then built-in for booleans | ||||
| snippet ?th "?then(true, false)" | ||||
| 	?then(${1:true}, ${0:false${VISUAL}}) | ||||
|  | ||||
| @ -222,6 +222,23 @@ snippet test "test function" | ||||
| 		${0:${VISUAL}} | ||||
| 	} | ||||
|  | ||||
| snippet testt "table test function" | ||||
| 	func Test${1:name}(t *testing.T) { | ||||
| 		tests := []struct { | ||||
| 			name string | ||||
| 		}{ | ||||
| 			{ | ||||
| 				name: "${2:test name}", | ||||
| 			}, | ||||
| 		} | ||||
|  | ||||
| 		for _, test := range tests { | ||||
| 			t.Run(test.name, func(t *testing.T) { | ||||
| 				${0:${VISUAL}} | ||||
| 			}) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| snippet bench "benchmark function" | ||||
| 	func Benchmark${1:name}(b *testing.B) { | ||||
| 		for i := 0; i < b.N; i++ { | ||||
|  | ||||
| @ -9,7 +9,8 @@ snippet fun "function" | ||||
| 	function ${1:function_name}(${2}) { | ||||
| 		${0:${VISUAL}} | ||||
| 	} | ||||
| snippet fun "async function" | ||||
| # Asynchronous Function | ||||
| snippet asf "async function" | ||||
| 	async function ${1:function_name}(${2}) { | ||||
| 		${0:${VISUAL}} | ||||
| 	} | ||||
| @ -282,6 +283,8 @@ snippet timeout | ||||
| 	setTimeout(function () {${0}}${2}, ${1:10}); | ||||
| snippet const | ||||
| 	const ${1} = ${0}; | ||||
| snippet constn | ||||
| 	const ${1} = new ${0}; | ||||
| snippet let | ||||
| 	let ${1} = ${0}; | ||||
| snippet im "import xyz from 'xyz'" | ||||
|  | ||||
| @ -207,7 +207,7 @@ snippet define | ||||
| 	} | ||||
|  | ||||
| snippet service | ||||
| 	service { "${1:service}" : | ||||
| 	service { "${1:service}": | ||||
| 		ensure    => running, | ||||
| 		enable    => true, | ||||
| 		require   => [ Package["${2:package}"], File["${3:file}"], ], | ||||
| @ -215,7 +215,7 @@ snippet service | ||||
| 	} | ||||
|  | ||||
| snippet file | ||||
| 	file { "${1:filename}" : | ||||
| 	file { "${1:filename}": | ||||
| 		ensure  => ${2:present}, | ||||
| 		owner   => "${3:root}", | ||||
| 		group   => "${4:root}", | ||||
| @ -227,7 +227,7 @@ snippet file | ||||
| 	} | ||||
|  | ||||
| snippet archive | ||||
| 	archive { "${1:filename}" : | ||||
| 	archive { "${1:filename}": | ||||
| 		ensure     => ${2:present}, | ||||
| 		url        => "http://${3:url}", | ||||
| 		extension  => "${4:tgz}", | ||||
| @ -237,7 +237,7 @@ snippet archive | ||||
| 	} | ||||
|  | ||||
| snippet firewall | ||||
| 	firewall { "${1:comment}" : | ||||
| 	firewall { "${1:comment}": | ||||
| 		proto	=> ${2:tcp}, | ||||
| 		action	=> ${3:accept}, | ||||
| 		port	=> ${4}, | ||||
|  | ||||
| @ -19,16 +19,17 @@ snippet - | ||||
| 	${0} | ||||
| #some directive | ||||
| snippet img: | ||||
| 	.. |${0:alias}| image:: ${1:img} | ||||
| 	.. |${1:alias}| image:: ${0:img} | ||||
| snippet fig: | ||||
| 	.. figure:: ${1:img} | ||||
| 		:alt: ${0:alter text} | ||||
| 		:alt: ${2:alter text} | ||||
|  | ||||
| 		$0 | ||||
| snippet con: | ||||
| 	.. contents:: ${1:Table of Contents} | ||||
|  | ||||
| 		$2 | ||||
| snippet cont: | ||||
| 	.. contents:: | ||||
| 		${0:content} | ||||
| snippet code: | ||||
| snippet cod: | ||||
| 	.. code:: ${1:type} | ||||
|  | ||||
| 		${0:write some code} | ||||
| @ -65,34 +66,36 @@ snippet tod: | ||||
| 	.. todo:: | ||||
| 		${0} | ||||
| snippet lis: | ||||
| 	.. list-table:: ${0:Title} | ||||
| 	.. list-table:: ${1:Title} | ||||
| 		:header-rows: 1 | ||||
| 		:stub-columns: 1 | ||||
| 		:stub-columns: 0 | ||||
|  | ||||
| 		* - x1,y1 | ||||
| 		  - x2,y1 | ||||
| 		  - x3,y1 | ||||
| 		* - x1,y2 | ||||
| 		  - x2,y2 | ||||
| 		  - x3,y2 | ||||
| 		* - x1,y3 | ||||
| 		  - x2,y3 | ||||
| 		  - x3,y3 | ||||
| 		* - ${0:R1C1} | ||||
| 		  - R1C2 | ||||
| 		* - R2C1 | ||||
| 		  - R2C2 | ||||
| snippet csv: | ||||
| 	.. csv-table:: ${1:Title} | ||||
| 		:header-rows: 1 | ||||
| 		:stub-columns: 0 | ||||
|  | ||||
| 		${0:R1C1}, R1C2 | ||||
| 		R2C1, R2C2 | ||||
| snippet toc: | ||||
| 	.. toctree:: | ||||
| 		:maxdepth: 2 | ||||
|  | ||||
| 		${0} | ||||
| snippet dow: | ||||
| 	:download:\`${0:text} <${1:path}>\` | ||||
| 	:download:\`${1:text} <${0:path}>\` | ||||
| snippet ref: | ||||
| 	:ref:\`${0:text} <${1:path}>\` | ||||
| 	:ref:\`${1:text} <${0:path}>\` | ||||
| snippet doc: | ||||
| 	:doc:`${0:text} <${1:path}>` | ||||
| 	:doc:\`${1:text} <${0:path}>\` | ||||
| # CJK optimize, CJK has no space between charaters | ||||
| snippet *c | ||||
| 	\ *${1:Emphasis}*\ ${0} | ||||
| snippet **c | ||||
| 	\ **${1:Strong emphasis}**\ ${0} | ||||
|  | ||||
| # vim:set list noet sts=0 sw=4 ts=4: | ||||
|  | ||||
| @ -232,3 +232,7 @@ snippet macro "macro_rules!" b | ||||
| 	} | ||||
| snippet box "Box::new()" | ||||
| 	Box::new(${0:${VISUAL}}) | ||||
| snippet rc "Rc::new()" | ||||
| 	Rc::new(${0:${VISUAL}}) | ||||
| snippet unim "unimplemented!()" | ||||
| 	unimplemented!() | ||||
|  | ||||
| @ -722,7 +722,7 @@ snippet jc:sa | ||||
| snippet jc:se | ||||
| 	justify-content: space-evenly | ||||
| snippet jc:st | ||||
| 	justify-content: space-evenly | ||||
| 	justify-content: stretch | ||||
| snippet jc:l | ||||
| 	justify-content: left | ||||
| snippet jc:r | ||||
|  | ||||
| @ -222,6 +222,10 @@ snippet rm roman font text | ||||
| 	\\textrm{${1:${VISUAL:text}}}${0} | ||||
| snippet tt typewriter (monospace) text | ||||
| 	\\texttt{${1:${VISUAL:text}}}${0} | ||||
| snippet tsub subscripted text | ||||
| 	\\textsubscript{${1:${VISUAL:text}}}${0} | ||||
| snippet tsup superscripted text | ||||
| 	\\textsuperscript{${1:${VISUAL:text}}}${0} | ||||
| #Math font | ||||
| snippet mf mathfrak | ||||
| 	\\mathfrak{${1:${VISUAL:text}}}${0} | ||||
|  | ||||
| @ -1 +1,43 @@ | ||||
| extends javascript | ||||
|  | ||||
| snippet tconst "ts const" | ||||
| 	const ${1}: ${2:any} = ${3}; | ||||
| 	${0} | ||||
| snippet tlet "ts let" | ||||
| 	let ${1}: ${2:any} = ${3}; | ||||
| 	${0} | ||||
| snippet tvar "ts var" | ||||
| 	var ${1}: ${2:any} = ${3}; | ||||
| 	${0} | ||||
| snippet + "var: type" | ||||
| 	${1}: ${0:any} | ||||
| snippet int "interface" | ||||
| 	interface ${1} { | ||||
| 		${2}: ${3:any}; | ||||
| 		${0} | ||||
| 	} | ||||
| snippet intx "interface extends" | ||||
| 	interface ${1} extends ${2} { | ||||
| 		${3}: ${4:any}; | ||||
| 		${0} | ||||
| 	} | ||||
| snippet tfun "ts function" | ||||
| 	function ${1}(${2}): ${3:any} { | ||||
| 		${0} | ||||
| 	} | ||||
| snippet tcla "ts class" | ||||
| 	class ${1} { | ||||
| 		${2} | ||||
| 		constructor(public ${3}: ${4: any}) { | ||||
| 			${5} | ||||
| 		} | ||||
| 		${0} | ||||
| 	} | ||||
| snippet tclax "ts class extends" | ||||
| 	class ${1} extends ${2} { | ||||
| 		${3} | ||||
| 		constructor(public ${4}: ${5: any}) { | ||||
| 			${6} | ||||
| 		} | ||||
| 		${0} | ||||
| 	} | ||||
|  | ||||
| @ -76,3 +76,5 @@ snippet im | ||||
| 	imap ${1} ${2} | ||||
| snippet exe | ||||
| 	execute ${1} | ||||
| snippet filename | ||||
| 	`Filename()` | ||||
|  | ||||
| @ -176,3 +176,14 @@ snippet vstore | ||||
| 			${1:key}: ${2:value} | ||||
| 		} | ||||
| 	}); | ||||
|  | ||||
|  | ||||
| # vue-i18n snippets https://github.com/kazupon/vue-i18n | ||||
|  | ||||
| snippet trans | ||||
| 	$t('$1') | ||||
|  | ||||
| # Translation with parameter | ||||
| snippet transc | ||||
| 	$t('$1', { $2: $3 }) | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Amir Salihefendic
					Amir Salihefendic