mirror of
				https://github.com/amix/vimrc
				synced 2025-10-31 06:33:35 +08:00 
			
		
		
		
	Updated plugins
This commit is contained in:
		| @ -20,12 +20,12 @@ Snippet engines supporting vim-snippets | ||||
| There are different forks of snippet engines which allow the user to insert | ||||
| snippets by typing the name of a snippet hitting the expansion mapping. | ||||
|  | ||||
| - [github.com/SirVer/ultisnips](https://github.com/SirVer/ultisnips):    | ||||
| - [github.com/SirVer/ultisnips][7]: | ||||
|   python, supports all snippets in this repo. | ||||
| - [github.com/garbas/vim-snipmate](https://github.com/garbas/vim-snipmate):    | ||||
| - [github.com/garbas/vim-snipmate](https://github.com/garbas/vim-snipmate): | ||||
|   VimL, snipmate-snippets, engine sometimes behaves strange. Supports | ||||
|   snippets/* | ||||
| - [github.com/Shougo/neosnippet](https://github.com/Shougo/neosnippet.vim):    | ||||
| - [github.com/Shougo/neosnippet](https://github.com/Shougo/neosnippet.vim): | ||||
|   VimL, supports snippets/* with some configuration. | ||||
| - [github.com/drmingdrmer/xptemplate](https://github.com/drmingdrmer/xptemplate): | ||||
|   Totally different syntax, does not read snippets contained in this file, but | ||||
| @ -39,17 +39,16 @@ UltiSnips has additional features such as high speed, nesting snippets, | ||||
| expanding snippets in snippets and offers powerful transformations on text in | ||||
| snippets (like visual selections or placeholder texts). | ||||
|  | ||||
| Which one to use? If you have python give | ||||
| [SirVer/ultisnips](https://github.com/SirVer/ultisnips) a try because its fast | ||||
| and has the most features. | ||||
| Which one to use? If you have python give [SirVer/ultisnips][7] a try because | ||||
| its fast and has the most features. | ||||
|  | ||||
| If you have VimL only (vim without python support) your best option is using | ||||
| [garbas/vim-snipmate](https://github.com/garbas/vim-snipmate) and cope with the | ||||
| minor bugs found in the engine. | ||||
|  | ||||
| Q: Should "snipMate be deprecated in favour of UltiSnips"? | ||||
| **Q**: Should snipMate be deprecated in favour of UltiSnips? | ||||
|  | ||||
| A: No, because snipMate is VimL, and UltiSnips requires Python. | ||||
| **A**: No, because snipMate is VimL, and UltiSnips requires Python. | ||||
| Some people want to use snippets without having to install Vim with Python | ||||
| support. Yes - this sucks. | ||||
|  | ||||
| @ -83,15 +82,15 @@ For more see the UltiSnips docs (`:help UltiSnips`). | ||||
| Installation | ||||
| ------------ | ||||
|  | ||||
| First be aware that there are many options, see "Snippet engines" above. | ||||
| Second be aware than there are [tons of plugin managers](http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html) | ||||
| which is why Marc Weber thinks that it doesn't make sense to repeat the same | ||||
| repetitive information everywhere. | ||||
| First be aware that there are many options, see "Snippet engines" above.  Second | ||||
| be aware than there are [tons of plugin managers][8] which is why Marc Weber | ||||
| thinks that it doesn't make sense to repeat the same repetitive information | ||||
| everywhere. | ||||
|  | ||||
| *Recommended way:* | ||||
| [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) (because Marc Weber wrote it for exactly | ||||
| this reason, it supports simple dependency management). E.g. you're done by this | ||||
| line in your `.vimrc`: | ||||
| The recommended way to install these snippets is by using | ||||
| [vim-addon-manager][9].  Marc Weber wrote it for exactly this reason, it | ||||
| supports simple dependency management. E.g. all you need is this line in your | ||||
| `.vimrc`: | ||||
|  | ||||
| ```vim | ||||
| " assuming you want to use snipmate snippet engine | ||||
| @ -101,20 +100,18 @@ ActivateAddons vim-snippets snipmate | ||||
| [vim-pi](https://bitbucket.org/vimcommunity/vim-pi/issue/90/we-really-need-a-web-interface) | ||||
| Is the place to discuss plugin managers and repository resources. | ||||
|  | ||||
| About how to install snipMate see [snipmate@garbas](https://github.com/garbas/vim-snipmate) | ||||
| For snipMate installation instructions, please see [snipmate@garbas][1]. | ||||
|  | ||||
| (Bundle, Pathogen, git clone - keywords to make people find this link by ctrl-f search) | ||||
| I know that I should be reading the docs of the snippet engine, just let me copy paste into my `.vimrc`: | ||||
| [See this pull request](https://github.com/honza/vim-snippets/pull/307/files). | ||||
| Pull requests adding installation instructions for Pathogen, Bundle, git clone, | ||||
| etc. are welcome and much appreciated. | ||||
|  | ||||
| TROUBLE | ||||
| ======= | ||||
| Getting help | ||||
| ------------ | ||||
|  | ||||
| If you still have trouble getting this to work create a GitHub ticket, ask on | ||||
| IRC or the mailing list. | ||||
| If you still have trouble getting this to work, please create a GitHub issue. | ||||
|  | ||||
| Policies / for contributors | ||||
| --------------------------- | ||||
| Things to consider when contributing | ||||
| ------------------------------------ | ||||
|  | ||||
| Some snippets are useful for almost all languages, so let's try to have the same | ||||
| triggers for them: | ||||
| @ -177,7 +174,7 @@ so that all users can benefit from them.  People can list their snippet reposito | ||||
|  | ||||
| Installation using VAM: https://github.com/MarcWeber/vim-addon-manager | ||||
|  | ||||
| Future - ideas - examples | ||||
| Future ideas and examples | ||||
| ------------------------- | ||||
|  | ||||
| [overview snippet engines](http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html) | ||||
| @ -252,3 +249,5 @@ terms of the MIT license. | ||||
| [3]: http://github.com/garbas | ||||
| [4]: http://github.com/garbas/vim-snipmate | ||||
| [7]: http://github.com/SirVer/ultisnips | ||||
| [8]: http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html | ||||
| [9]: https://github.com/MarcWeber/vim-addon-manager | ||||
|  | ||||
| @ -224,10 +224,10 @@ endsnippet | ||||
|  | ||||
| snippet construct "__construct()" b | ||||
| /** | ||||
|  * @param $2mixed ${1/, /\n     * \@param mixed /g} | ||||
|  * @param$2 ${1/, /\n     * \@param /g} | ||||
|  */ | ||||
| public function __construct(${1:$dependencies}) | ||||
| {${1/\$(\w+)(, )*/\n        $this->$1 = $$1;/g} | ||||
| {${1/\w* ?\$(\w+)(, )*/\n        $this->$1 = $$1;/g} | ||||
| } | ||||
| $0 | ||||
| endsnippet | ||||
|  | ||||
| @ -58,6 +58,14 @@ snippet queue | ||||
| snippet pqueue | ||||
| 	std::priority_queue<${1:T}> ${2}; | ||||
| ## | ||||
| ## STL smart pointers | ||||
| # std::shared_ptr | ||||
| snippet msp | ||||
| 	std::shared_ptr<${1:T}> ${2} = std::make_shared<$1>(${3}); | ||||
| # std::unique_ptr | ||||
| snippet mup | ||||
| 	std::unique_ptr<${1:T}> ${2} = std::make_unique<$1>(${3}); | ||||
| ## | ||||
| ## Access Modifiers | ||||
| # private | ||||
| snippet pri | ||||
|  | ||||
| @ -58,7 +58,7 @@ snippet doc | ||||
| 	-} | ||||
| snippet p | ||||
| 	|> ${0} | ||||
| snippet program | ||||
| snippet program Elm 0.18 program | ||||
| 	import Html exposing (Html) | ||||
|  | ||||
|  | ||||
| @ -100,3 +100,57 @@ snippet program | ||||
| 	view : Model -> Html Msg | ||||
| 	view model = | ||||
| 		Html.text "Hello, sailor!" | ||||
| snippet element | ||||
| 	module Main exposing (Model, Msg(..), init, main, subscriptions, update, view) | ||||
|  | ||||
| 	import Browser | ||||
| 	import Html exposing (..) | ||||
| 	import Json.Encode | ||||
|  | ||||
|  | ||||
| 	main : Program Flags Model Msg | ||||
| 	main = | ||||
| 		Browser.element | ||||
| 			{ init = init | ||||
| 			, update = update | ||||
| 			, subscriptions = subscriptions | ||||
| 			, view = view | ||||
| 			} | ||||
|  | ||||
|  | ||||
| 	type alias Model = | ||||
| 		{} | ||||
|  | ||||
|  | ||||
| 	type alias Flags = | ||||
| 		Json.Encode.Value | ||||
|  | ||||
|  | ||||
| 	init : Flags -> ( Model, Cmd Msg ) | ||||
| 	init flags_ = | ||||
| 		( {} | ||||
| 		, Cmd.none | ||||
| 		) | ||||
|  | ||||
|  | ||||
| 	type Msg | ||||
| 		= Noop | ||||
|  | ||||
|  | ||||
| 	update : Msg -> Model -> ( Model, Cmd Msg ) | ||||
| 	update msg model = | ||||
| 		case msg of | ||||
| 			Noop -> | ||||
| 				( model | ||||
| 				, Cmd.none | ||||
| 				) | ||||
|  | ||||
|  | ||||
| 	subscriptions : Model -> Sub Msg | ||||
| 	subscriptions model = | ||||
| 		Sub.none | ||||
|  | ||||
|  | ||||
| 	view : Model -> Html Msg | ||||
| 	view model = | ||||
| 		h1 [] [ text "Hello, world!" ] | ||||
|  | ||||
							
								
								
									
										27
									
								
								sources_non_forked/vim-snippets/snippets/freemarker.snippets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								sources_non_forked/vim-snippets/snippets/freemarker.snippets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | ||||
| extends html | ||||
|  | ||||
| snippet assign | ||||
| 	<#assign ${1} = ${0:${VISUAL}} /> | ||||
|  | ||||
| snippet if | ||||
| 	<#if ${1}> | ||||
| 		${0:${VISUAL}} | ||||
| 	</#if> | ||||
|  | ||||
| snippet ife | ||||
| 	<#if ${1}> | ||||
| 		${2:${VISUAL}} | ||||
| 	<#else> | ||||
| 		${0} | ||||
| 	</#if> | ||||
|  | ||||
| snippet list | ||||
| 	<#list ${1} as ${2}> | ||||
| 		${0:${VISUAL}} | ||||
| 	</#list> | ||||
|  | ||||
| snippet attempt | ||||
| 	<#attempt> | ||||
| 		${0:${VISUAL}} | ||||
| 	<#recover> | ||||
| 	</#attempt> | ||||
| @ -257,3 +257,8 @@ snippet ja | ||||
| 	func (p *$1) MarshalJSON() ([]byte, error) { | ||||
| 		return json.Marshal(&struct{ *$1Alias }{(*$1Alias)(p)}) | ||||
| 	} | ||||
|  | ||||
| snippet errwr # Error handling with errors.Wrap | ||||
| 	if ${1}err != nil { | ||||
| 		return errors.Wrap(err, "${2}") | ||||
| 	} | ||||
|  | ||||
							
								
								
									
										39
									
								
								sources_non_forked/vim-snippets/snippets/ocaml.snippets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								sources_non_forked/vim-snippets/snippets/ocaml.snippets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,39 @@ | ||||
| snippet doc | ||||
| 	(* | ||||
| 		${0} | ||||
| 	 *) | ||||
| snippet let | ||||
| 	let ${1} = ${2} in | ||||
| 	${0} | ||||
| snippet fn | ||||
| 	let ${1} = | ||||
| 		${0} | ||||
| snippet fun | ||||
| 	type ${1} = ${0} | ||||
| snippet mod | ||||
| 	module ${1} = struct | ||||
| 		${0} | ||||
| 	end | ||||
| snippet modty | ||||
| 	module type ${1} = sig | ||||
| 		${0} | ||||
| 	end | ||||
| snippet sw | ||||
| 	match ${1} with | ||||
| 	| ${2} -> ${0} | ||||
| snippet | | ||||
| 	| ${1} -> ${0} | ||||
| snippet p | ||||
| 	|> ${0} | ||||
| snippet if | ||||
| 	if ${1} then | ||||
| 		${2} | ||||
| 	else | ||||
| 		${0} | ||||
| snippet fnr | ||||
| 	let rec ${1} = | ||||
| 		${0} | ||||
| snippet try | ||||
| 	try | ||||
| 		${1} | ||||
| 	with ${0} | ||||
							
								
								
									
										72
									
								
								sources_non_forked/vim-snippets/snippets/racket.snippets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								sources_non_forked/vim-snippets/snippets/racket.snippets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,72 @@ | ||||
| snippet #r | ||||
| 	#lang racket | ||||
| snippet #tr | ||||
| 	#lang typed/racket | ||||
| snippet #rg | ||||
| 	#lang racket/gui | ||||
| snippet #sb | ||||
| 	#lang scribble/base | ||||
| snippet #d | ||||
| 	#lang datalog | ||||
| snippet #wi | ||||
| 	#lang web-server/insta | ||||
| snippet def | ||||
| 	(define ${1} ${0}) | ||||
| snippet defun | ||||
| 	(define (${1}) | ||||
| 		${0}) | ||||
| snippet if | ||||
| 	(if ${1} ${2} ${0}) | ||||
| snippet ifn | ||||
| 	(if (not ${1}) ${2} {0}) | ||||
| snippet ifl | ||||
| 	(if ${1} | ||||
| 		(let () | ||||
| 			${2}) | ||||
| 		${0}) | ||||
| snippet ifnl | ||||
| 	(if (not ${1}) | ||||
| 		(let () | ||||
| 			${2}) | ||||
| 		${0}) | ||||
| snippet when | ||||
| 	(when ${1} | ||||
| 		${0}) | ||||
| snippet cond | ||||
| 	(cond | ||||
| 		[(${1}) | ||||
| 			${0}]) | ||||
| snippet case | ||||
| 	(case ${1} | ||||
| 		[(${2}) | ||||
| 			${0}]) | ||||
| snippet match | ||||
| 	(match ${1} | ||||
| 		[(${2}) | ||||
| 			${0}]) | ||||
| snippet letcc | ||||
| 	(let/cc here (set! ${1} here) ${0}) | ||||
| snippet for | ||||
| 	(for ([${1} ${2}]) | ||||
| 		${0}) | ||||
| snippet req | ||||
| 	(require ${0}) | ||||
| snippet unless | ||||
| 	(unless ${1} ${2} ${0}) | ||||
| snippet let | ||||
| 	(let ([${1}]) ${0}) | ||||
| snippet begin | ||||
| 	(begin | ||||
| 		${0}) | ||||
| snippet lambda | ||||
| 	(lambda (${1}) ${0}) | ||||
| snippet ifb | ||||
| 	(if ${1} | ||||
| 		(begin | ||||
| 			${2}) | ||||
| 		${0}) | ||||
| snippet ifnb | ||||
| 	(if (not ${1}) | ||||
| 		(begin | ||||
| 			${2}) | ||||
| 		${0}) | ||||
| @ -1,17 +1,17 @@ | ||||
| snippet + | ||||
| 	(+	${1} | ||||
| 	(+ ${1} | ||||
| 		${0}) | ||||
|  | ||||
| snippet - | ||||
| 	(-	${1} | ||||
| 	(- ${1} | ||||
| 		${0}) | ||||
|  | ||||
| snippet / | ||||
| 	(/	${1} | ||||
| 	(/ ${1} | ||||
| 		${0}) | ||||
|  | ||||
| snippet * | ||||
| 	(*	${1} | ||||
| 	(* ${1} | ||||
| 		${0}) | ||||
|  | ||||
| # Definition | ||||
| @ -22,12 +22,12 @@ snippet def | ||||
| # Definition with lambda | ||||
| snippet defl | ||||
| 	(define ${1:name} | ||||
| 			(lambda (x)(${0:definition}))) | ||||
| 		(lambda (x)(${0:definition}))) | ||||
|  | ||||
| # Condition | ||||
| snippet cond | ||||
| 	(cond	((${1:predicate}) (${2:action})) | ||||
| 			((${3:predicate}) (${0:action}))) | ||||
| 	(cond ((${1:predicate}) (${2:action})) | ||||
| 		((${3:predicate}) (${0:action}))) | ||||
|  | ||||
| # If statement | ||||
| snippet if | ||||
|  | ||||
| @ -119,53 +119,53 @@ snippet spl split environment | ||||
| 	\\end{split} | ||||
| # Part | ||||
| snippet part document \part | ||||
| 	\\part{${1:part name}} % (fold) | ||||
| 	\\part{${1:part name}} % (fold)% | ||||
| 	\\label{prt:${2:$1}} | ||||
| 	${0} | ||||
| 	% part $2 (end) | ||||
| # Chapter | ||||
| snippet cha \chapter | ||||
| 	\\chapter{${1:chapter name}} | ||||
| 	\\chapter{${1:chapter name}}% | ||||
| 	\\label{cha:${2:$1}} | ||||
| 	${0} | ||||
| # Section | ||||
| snippet sec \section | ||||
| 	\\section{${1:section name}} | ||||
| 	\\section{${1:section name}}% | ||||
| 	\\label{sec:${2:$1}} | ||||
| 	${0} | ||||
| # Section without number | ||||
| snippet sec* \section* | ||||
| 	\\section*{${1:section name}} | ||||
| 	\\section*{${1:section name}}% | ||||
| 	\\label{sec:${2:$1}} | ||||
| 	${0} | ||||
| # Sub Section | ||||
| snippet sub \subsection | ||||
| 	\\subsection{${1:subsection name}} | ||||
| 	\\subsection{${1:subsection name}}% | ||||
| 	\\label{sub:${2:$1}} | ||||
| 	${0} | ||||
| # Sub Section without number | ||||
| snippet sub* \subsection* | ||||
| 	\\subsection*{${1:subsection name}} | ||||
| 	\\subsection*{${1:subsection name}}% | ||||
| 	\\label{sub:${2:$1}} | ||||
| 	${0} | ||||
| # Sub Sub Section | ||||
| snippet ssub \subsubsection | ||||
| 	\\subsubsection{${1:subsubsection name}} | ||||
| 	\\subsubsection{${1:subsubsection name}}% | ||||
| 	\\label{ssub:${2:$1}} | ||||
| 	${0} | ||||
| # Sub Sub Section without number | ||||
| snippet ssub* \subsubsection* | ||||
| 	\\subsubsection*{${1:subsubsection name}} | ||||
| 	\\subsubsection*{${1:subsubsection name}}% | ||||
| 	\\label{ssub:${2:$1}} | ||||
| 	${0} | ||||
| # Paragraph | ||||
| snippet par \paragraph | ||||
| 	\\paragraph{${1:paragraph name}} | ||||
| 	\\paragraph{${1:paragraph name}}% | ||||
| 	\\label{par:${2:$1}} | ||||
| 	${0} | ||||
| # Sub Paragraph | ||||
| snippet subp \subparagraph | ||||
| 	\\subparagraph{${1:subparagraph name}} | ||||
| 	\\subparagraph{${1:subparagraph name}}% | ||||
| 	\\label{subp:${2:$1}} | ||||
| 	${0} | ||||
| snippet ni \noindent | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Amir Salihefendic
					Amir Salihefendic