1
0
mirror of https://github.com/amix/vimrc synced 2025-07-05 23:44:59 +08:00

Merge remote-tracking branch 'refs/remotes/upstream/master'

Conflicts:
	sources_non_forked/ale/autoload/ale.vim
	sources_non_forked/lightline.vim/doc/lightline.txt
	sources_non_forked/nerdtree/.github/PULL_REQUEST_TEMPLATE.md
	sources_non_forked/nerdtree/autoload/nerdtree.vim
	sources_non_forked/nerdtree/plugin/NERD_tree.vim
	sources_non_forked/vim-fugitive/autoload/fugitive.vim
	sources_non_forked/vim-fugitive/doc/fugitive.txt
This commit is contained in:
geezuslucifer@gmail.com
2021-02-19 08:50:18 -06:00
352 changed files with 11973 additions and 4879 deletions

View File

@ -1,88 +1,70 @@
# cannot use /usr/bin/env because it does not support parameters (as -f)
snippet #! #!/usr/bin/awk -f
#!/usr/bin/awk -f
# @include is a gawk extension
snippet inc @include
@include "${1}"${0}
# @load is a gawk extension
snippet loa @load
@load "${1}"${0}
snippet beg BEGIN { ... }
BEGIN {
${0}
}
# BEGINFILE is a gawk extension
snippet begf BEGINFILE { ... }
BEGINFILE {
${0}
}
snippet end END { ... }
END {
${0}
}
# ENDFILE is a gawk extension
snippet endf ENDFILE { ... }
ENDFILE {
${0}
}
snippet pri print
print ${1:"${2}"}${0}
snippet printf printf
printf("${1:%s}\n", ${2})${0}
snippet ign IGNORECASE
IGNORECASE = ${1:1}
snippet if if {...}
if (${1}) {
${0:${VISUAL}}
}
snippet ife if ... else ...
if (${1}) {
${2:${VISUAL}}
} else {
${0}
}
snippet eif else if ...
else if (${1}) {
${0}
}
snippet el else {...}
else {
${0}
}
snippet wh while
while (${1}) {
${2}
}
snippet do do ... while
do {
${0}
} while (${1})
snippet for for
for (${2:i} = 0; i < ${1:n}; ${3:++i}) {
${0}
}
snippet fore for each
for (${1:i} in ${2:array}) {
${0}
}
# the switch is a gawk extension
snippet sw switch
switch (${1}) {
@ -93,10 +75,8 @@ snippet sw switch
${0}
break
}
# the switch is a gawk extension
snippet case case
case ${1}:
${0}
break

View File

@ -1,7 +1,7 @@
## Main
# main
snippet main
int main(int argc, const char *argv[])
int main(int argc, char *argv[])
{
${0}
return 0;

View File

@ -8,21 +8,21 @@ snippet def
(def ${0})
snippet defm
(defmethod ${1:multifn} "${2:doc-string}" ${3:dispatch-val} [${4:args}]
${0})
${0:code})
snippet defmm
(defmulti ${1:name} "${2:doc-string}" ${0:dispatch-fn})
snippet defma
(defmacro ${1:name} "${2:doc-string}" ${0:dispatch-fn})
snippet defn
(defn ${1:name} "${2:doc-string}" [${3:arg-list}]
${0})
${0:code})
snippet defp
(defprotocol ${1:name}
${0})
${0:code})
snippet defr
(defrecord ${1:name} [${2:fields}]
${3:protocol}
${0})
${0:code})
snippet deft
(deftest ${1:name}
(is (= ${0:assertion})))
@ -31,12 +31,12 @@ snippet is
snippet defty
(deftype ${1:Name} [${2:fields}]
${3:Protocol}
${0})
${0:code})
snippet doseq
(doseq [${1:elem} ${2:coll}]
${0})
${0:code})
snippet fn
(fn [${1:arg-list}] ${0})
(fn [${1:arg-list}] ${0:code})
snippet if
(if ${1:test-expr}
${2:then-expr}
@ -50,24 +50,24 @@ snippet imp
& {:keys [${1:keys}] :or {${0:defaults}}}
snippet let
(let [${1:name} ${2:expr}]
${0})
${0:code})
snippet letfn
(letfn [(${1:name}) [${2:args}]
${0})])
${0:code})])
snippet map
(map ${1:func} ${0:coll})
snippet mapl
(map #(${1:lambda}) ${0:coll})
snippet met
(${1:name} [${2:this} ${3:args}]
${0})
${0:code})
snippet ns
(ns ${0:name})
snippet dotimes
(dotimes [_ 10]
(time
(dotimes [_ ${1:times}]
${0})))
${0:code})))
snippet pmethod
(${1:name} [${2:this} ${0:args}])
snippet refer

View File

@ -0,0 +1,59 @@
# Snippets for dart in flutter project, to use add the following to your .vimrc
# `autocmd BufRead,BufNewFile,BufEnter *.dart UltiSnipsAddFiletypes dart-flutter`
# Flutter stateless widget
snippet stless
class $1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
$2
);
}
}
# Flutter stateful widget
snippet stful
class $1 extends StatefulWidget {
@override
_$1State createState() => _$1State();
}
class _$1State extends State<$1> {
@override
Widget build(BuildContext context) {
return Container(
$2
);
}
}
# Flutter widget with AnimationController
snippet stanim
class $1 extends StatefulWidget {
@override
_$1State createState() => _$1State();
}
class _$1State extends State<$1>
with SingleTickerProviderStateMixin {
AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(vsync: this);
}
@override
void dispose() {
super.dispose();
_controller.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
$2
);
}
}

View File

@ -81,6 +81,8 @@ snippet cb
@callback ${1:name}(${2:args}) :: ${3:returns}
snippet df
def ${1:name}, do: ${2}
snippet dfw
def ${1:name}(${2:args}) when ${3:guard}, do:
snippet def
def ${1:name} do
${0}
@ -92,12 +94,21 @@ snippet defd
def ${2:name} do
${0}
end
snippet defs
@spec ${1:name}(${2:arg types}) :: ${3:no_return}
def $1(${4:args}) do
${0}
end
snippet defsd
@doc """
${1:doc string}
"""
@spec ${2:name} :: ${3:no_return}
def ${2} do
@spec ${2:name}(${3:arg types}) :: ${4:no_return}
def $2(${5:args}) do
${0}
end
snippet defw
def ${1:name}(${2:args}) when ${3:guard} do
${0}
end
snippet defim
@ -112,12 +123,24 @@ snippet defmo
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
${0}
end
snippet %M
%__MODULE__{
${1:key_name}: ${2:value}
}
snippet enfk
@enforce_keys [:${1:key_name}]
snippet dfp
defp ${1:name}, do: ${2}
snippet dfpw
defp ${1:name}(${2:args}) when ${3:guard}, do: ${4}
snippet defp
defp ${1:name} do
${0}
end
snippet defpw
defp ${1:name}(${2:args}) when ${3:guard} do
${0}
end
snippet defpr
defprotocol ${1:name}, [${0:function}]
snippet defr
@ -173,12 +196,28 @@ snippet des
describe "${1:test group subject}" do
${0}
end
snippet destag
@describetag :${1:describe tag}
snippet mtag
@moduletag :${1:module tag}
snippet dt
doctest ${1:filename}
snippet tp
@tag :pending
snippet exunit
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
use ExUnit.Case, async: true
${0}
end
snippet setup
setup do
${1}
end
snippet setupa
setup_all do
${1}
end
snippet try try .. rescue .. end
try do
${1:${VISUAL}}

View File

@ -46,8 +46,9 @@ snippet conf
<% content_for :${1:head} do %>
${0}
<% end %>
snippet cs
<%= collection_select <+object+>, <+method+>, <+collection+>, <+value_method+>, <+text_method+><+, <+[options]+>, <+[html_options]+>+> %>
snippet cs
<%= collection_select(:${1:object}, :${2:method}, ${3:collection}, :${4:value_method}, :${5:text_method}, options = {${0:prompt: true}}) %>
snippet ct
<%= content_tag '${1:DIV}', ${2:content}${0:,options} %>
snippet ff
@ -80,6 +81,8 @@ snippet ffta
<%= ${1:f}.text_area :${0:attribute} %>
snippet fftf
<%= ${1:f}.text_field :${0:attribute} %>
snippet fcs
<%= ${1:f}.collection_select(:${2:method}, ${3:collection}, :${4:value_method}, :${5:text_method}, options = {${0:prompt: true}}) %>
snippet fields
<%= fields_for :${1:model}, @$1 do |${2:f}| %>
${0}

View File

@ -0,0 +1,2 @@
snippet co
Co-authored-by: ${1} <${2}>

View File

@ -129,7 +129,7 @@ snippet fum "method"
}
${0}
snippet fumh "http handler function on reciever"
snippet fumh "http handler function on receiver"
func (${1:receiver} ${2:type}) ${3:funcName}(${4:w} http.ResponseWriter, ${5:r} *http.Request) {
${0:${VISUAL}}
}

View File

@ -21,9 +21,9 @@ snippet info
snippet imp
import ${0:Data.Text}
snippet import
import ${0:Data.Text}
import ${0:Data.Text}
snippet import2
import ${1:Data.Text} (${0:head})
import ${1:Data.Text} (${0:head})
snippet impq
import qualified ${1:Data.Text} as ${0:T}
snippet importq

View File

@ -175,7 +175,7 @@ snippet aside#
${0}
</aside>
snippet audio
<audio src="${1}>${0}</audio>
<audio src="${1}">${0}</audio>
snippet b
<b>${0}</b>
snippet base
@ -709,7 +709,7 @@ snippet samp
${0}
</samp>
snippet script
<script charset="utf-8">
<script>
${0}
</script>
snippet scripts

View File

@ -175,9 +175,9 @@ snippet tryf
##
## Find Methods
snippet findall
List<${1:listName}> ${2:items} = ${1}.findAll();
List<${1:listName}> ${2:items} = $1.findAll();
snippet findbyid
${1:var} ${2:item} = ${1}.findById(${3});
${1:var} ${2:item} = $1.findById(${3});
##
## Javadocs
snippet /**

View File

@ -1,82 +0,0 @@
# Import only React
snippet ri1
import React from 'react'
# Import both React and Component
snippet ri2
import React, { Component } from 'react'
import PropTypes from 'prop-types'
# React class
snippet rcla
class ${1:MyComponent} extends Component {
render() {
return (
${0:<div></div>}
)
}
}
# 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:<div></div>}
)
}
# 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:${VISUAL}}
}
# State
snippet rsst
this.setState({
${1}: ${0},
})
snippet rtst
this.state.${0}
# Props
snippet rp
props.${0}
snippet rtp
this.props.${0}

View File

@ -1,98 +1,190 @@
snippet ir
# Import
snippet ir import React
import React from 'react';
snippet irc
snippet irc import React and Component
import React, { Component } from 'react';
snippet ird
snippet irh import React hooks
import { use$1 } from 'react';
snippet ird import ReactDOM
import ReactDOM from 'react-dom';
snippet cdm
snippet irp import PropTypes
import PropTypes from 'prop-types';
# Lifecycle Methods
snippet cdm componentDidMount
componentDidMount() {
${1}
}
snippet cdup
};
snippet cdup componentDidUpdate
componentDidUpdate(prevProps, prevState) {
${1}
}
snippet cwm
};
snippet cwm componentWillMount
componentWillMount() {
${1}
}
snippet cwr
};
snippet cwr componentWillReceiveProps
componentWillReceiveProps(nextProps) {
${1}
}
snippet cwun
};
snippet cwun componentWillUnmount
componentWillUnmount() {
${1}
}
snippet cwu
};
snippet cwu componentWillUpdate
componentWillUpdate(nextProps, nextState) {
${1}
};
snippet scu shouldComponentUpdate
shouldComponentUpdate(nextProps, nextState) {
${1}
}
snippet fup
forceUpdate(${1:callback});
snippet dp
# Props
snippet spt static propTypes
static propTypes = {
${1}: PropTypes.${2}
};
snippet pt propTypes
${1}.propTypes = {
${2}: PropTypes.${2}
};
snippet sdp static defaultProps
static defaultProps = {
${1}: ${2},
}
${1}: ${2}
};
snippet dp defaultProps
${1}.defaultProps = {
${2}: ${3}
};
snippet pp props
props.${1};
snippet tp this props
this.props.${1};
# State
snippet st
state = {
${1}: ${2},
}
snippet pt
static propTypes = {
${1}: React.PropTypes.${2:type},
}
snippet rfc
const ${1:ComponentName} = (${2:props}) => {
return (
<div>
$1
</div>
);
}
snippet rcc
class ${1:ClassName} extends React.Component {
state = {
};
}
render() {
return (
<div>
$1
</div>
);
}
}
snippet rdr
ReactDOM.render(${1}, ${2})
snippet ercc
export default class ${1:ClassName} extends React.Component {
render() {
return (
${0:<div />}
);
}
}
snippet ctor
constructor() {
super();
${1}
}
snippet ren
render() {
return (
${1:<div />}
);
}
snippet sst
this.setState({
${1}: ${2}
});
snippet scu
shouldComponentUpdate(nextProps, nextState) {
${1}
snippet tst
this.state.${1};
# Component
snippet raf
const ${1:ComponentName} = (${2:props}) => {
${3:state}
return (
<>
${4}
</>
);
};
snippet rcla
class ${1:ClassName} extends Component {
render() {
return (
<>
${2}
</>
);
}
}
snippet prp i
this.props.${1}
snippet ste i
this.state.${1}
snippet ercla
export default class ${1:ClassName} extends Component {
render() {
return (
<>
${2}
</>
);
};
};
snippet ctor
constructor() {
super();
${1:state}
}
snippet ren
render() {
return (
<>
${2}
</>
);
}
snippet fup
forceUpdate(${1:callback});
# Hooks
snippet uses useState
const [${1:state}, set${2}] = useState(${3:initialState});
snippet usee useEffect
useEffect(() => {
${1}
});
snippet userd useReducer
const [${1:state}, ${2:dispatch}] = useReducer(${3:reducer});
snippet userf useRef
const ${1:refContainer} = useRef(${2:initialValue});
snippet usect useContext
const ${1:value} = useContext(${2:MyContext});
snippet usecb useCallback
const ${1:memoizedCallback} = useCallback(
() => {
${2}(${3})
},
[$3]
);
snippet usem useMemo
const ${1:memoizedCallback} = useMemo(() => ${2}(${3}), [$3]);
snippet usei useImperativeHandle
useImperativeHandle(${1:ref}, ${2:createHandle});
snippet used useDebugValue
useDebugValue(${1:value});
# ReactDOM methods
snippet rdr ReactDOM.render
ReactDOM.render(${1}, ${2});
snippet rdh ReactDOM.hydrate
ReactDOM.hydrate(${1:element}, ${2:container}[, ${3:callback}]);
snippet rdcp ReactDOM.createPortal
ReactDOM.createPortal(${1:child}, ${2:container});

View File

@ -318,6 +318,10 @@ snippet foro "for (const prop of object}) { ... }"
for (const ${1:prop} of ${2:object}) {
${0:$1}
}
snippet forl "for (let prop of object}) { ... }"
for (let ${1:prop} of ${2:object}) {
${0:$1}
}
snippet fun*
function* ${1:function_name}(${2}) {
${0:${VISUAL}}
@ -326,15 +330,25 @@ snippet c=>
const ${1:function_name} = (${2}) => {
${0:${VISUAL}}
}
snippet ca=>
const ${1:function_name} = async (${2}) => {
${0:${VISUAL}}
}
snippet caf
const ${1:function_name} = (${2}) => {
${0:${VISUAL}}
}
snippet casf
const ${1:function_name} = async (${2}) => {
${0:${VISUAL}}
}
snippet =>
(${1}) => {
${0:${VISUAL}}
}
snippet af
snippet af "() =>"
(${1}) => ${0:${VISUAL}}
snippet afb "() => {}"
(${1}) => {
${0:${VISUAL}}
}
@ -344,5 +358,7 @@ snippet ed
export default ${0}
snippet ${
${${1}}${0}
snippet as "async"
async ${0}
snippet aw "await"
await ${0:${VISUAL}}

View File

@ -89,14 +89,26 @@ snippet thr throw
${0}
# Messages
snippet in
info("${1}")
${0}
snippet @i
@info "${1}" ${0}
snippet wa
warn("${1}")
${0}
snippet @w
@warn "${1}" ${0}
snippet err
error("${1}")
${0}
snippet @e
@error "${1}" ${0}
snippet @d
@debug "${1}" ${0}
snippet @t @testset with @test
@testset "${1}" begin
${2}
@test ${0}
end
snippet @tt @testset with @test_throws
@testset "${1}" begin
${2}
@test_throws ${0}
end

View File

@ -63,6 +63,10 @@ snippet include
{% include '${0:snippet}' %}
snippet includewith
{% include '${1:snippet}', ${2:variable}: ${0:value} %}
snippet render
{% render '${0:snippet}' %}
snippet renderwith
{% render '${1:snippet}', ${2:variable}: ${0:value} %}
snippet section
{% section '${1:snippet}' %}
snippet raw

View File

@ -5,19 +5,19 @@
# The suffix `c` stands for "Clipboard".
snippet [
[${1:text}](http://${2:address})
[${1:text}](https://${2:address})
snippet [*
[${1:link}](${2:`@*`})
snippet [c
[${1:link}](${2:`@+`})
snippet ["
[${1:text}](http://${2:address} "${3:title}")
[${1:text}](https://${2:address} "${3:title}")
snippet ["*
[${1:link}](${2:`@*`} "${3:title}")
snippet ["c
[${1:link}](${2:`@+`} "${3:title}")
snippet [:
[${1:id}]: http://${2:url}
[${1:id}]: https://${2:url}
snippet [:*
[${1:id}]: ${2:`@*`}
@ -26,7 +26,7 @@ snippet [:c
[${1:id}]: ${2:`@+`}
snippet [:"
[${1:id}]: http://${2:url} "${3:title}"
[${1:id}]: https://${2:url} "${3:title}"
snippet [:"*
[${1:id}]: ${2:`@*`} "${3:title}"
@ -129,6 +129,12 @@ snippet img
snippet youtube
{% youtube ${0:video_id} %}
snippet tb
| ${0:factors} | ${1:a} | ${2:b} |
| ------------- |------------- | ------- |
| ${3:f1} | Y | N |
| ${4:f2} | Y | N |
# The quote should appear only once in the text. It is inherently part of it.
# See http://octopress.org/docs/plugins/pullquote/ for more info.

View File

@ -1,7 +1,7 @@
snippet doc
(*
${0}
*)
(** ${0} *)
snippet comment
(* ${0} *)
snippet let
let ${1} = ${2} in
${0}

View File

@ -357,6 +357,10 @@ snippet dump
use Data::Dump qw(dump);
warn dump ${1:variable}
snippet ddp
use DDP;
p ${1:variable}
snippet subtest
subtest '${1: test_name}' => sub {
${2}

View File

@ -29,8 +29,8 @@ snippet function
# PowerShell Splatting
snippet splatting
$Params = @{
${1:Param1} = '{2:Value1}'
${3:Param2} = '{4:Value2}'
${1:Param1} = '${2:Value1}'
${3:Param2} = '${4:Value2}'
}
${5:CommandName} @Params
@ -99,4 +99,3 @@ snippet switch
${2:condition1} { ${3:action} }
${4:condition2} { ${5:action} }
default { ${6:action} }

View File

@ -123,6 +123,8 @@ snippet ret
return ${0}
snippet .
self.
snippet sa self.attribute = attribute
self.${1:attribute} = $1
snippet try Try/Except
try:
${1:${VISUAL}}
@ -182,6 +184,10 @@ snippet ptpython
# python console debugger (pudb)
snippet pudb
__import__('pudb').set_trace()
# python console debugger remote (pudb)
snippet pudbr
from pudb.remote import set_trace
set_trace()
# pdb in nosetests
snippet nosetrace
__import__('nose').tools.set_trace()

View File

@ -32,6 +32,10 @@ snippet for
for (${1:item} in ${2:list}) {
${3}
}
snippet foreach
foreach (${1:item} = ${2:list}) {
${3}
}
# functions
snippet fun

View File

@ -1,3 +1,4 @@
# Languages
snippet #r
#lang racket
snippet #tr
@ -10,56 +11,38 @@ snippet #d
#lang datalog
snippet #wi
#lang web-server/insta
# Defines
snippet def
(define ${1} ${0})
snippet defun
(define (${1})
${0})
snippet defv "define-values"
(define-values (${1}) (${0}))
snippet defm "define/match"
(define/match (${1})
[(${2}) ${3}]
${0})
snippet defs "define-syntax"
(define-syntax (${1})
${0})
# Conditionals
snippet if
(if ${1} ${2} ${0})
snippet ifn
(if (not ${1}) ${2} {0})
(if (not ${1}) ${2} ${0})
snippet ifl
(if ${1}
(let ()
${2})
(let (${2})
${3})
${0})
snippet ifnl
(if (not ${1})
(let ()
${2})
(let (${2})
${3})
${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
@ -70,3 +53,79 @@ snippet ifnb
(begin
${2})
${0})
snippet when
(when ${1}
${0})
snippet unless
(unless ${1} ${2} ${0})
snippet cond
(cond
[(${1}) ${0}])
snippet conde
(cond
[(${1}) ${2}]
[else ${0}])
snippet case
(case ${1}
[(${2}) ${0}])
snippet match
(match ${1}
[(${2}) ${0}])
# For iterations
snippet for
(for ([${1}])
${0})
snippet forl "for/list"
(for/list ([${1}])
${0})
snippet forf "for/fold"
(for/fold
([${1}])
([${2}])
${0})
snippet forfr "for/foldr"
(for/foldr
([${1}])
([${2}])
${0})
snippet fora "for/and"
(for/and ([${1}])
${0})
snippet foro "for/or"
(for/or ([${1}])
${0})
snippet fors "for/sum"
(for/sum ([${1}])
${0})
snippet forp "for/product"
(for/product ([${1}])
${0})
snippet forfi "for/first"
(for/first ([${1}])
${0})
snippet forla "for/last"
(for/last ([${1}])
${0})
snippet lambda
(lambda (${1}) ${0})
snippet apply
(apply ${1} ${0})
snippet map
(map ${1} ${0})
snippet filter
(filter ${1} ${0})
snippet req
(require ${0})
snippet prov
(provide ${0})
snippet let
(let ([${1}]) ${0})
snippet letcc
(let/cc here (set! ${1} here) ${0})
snippet begin
(begin
${0})

View File

@ -0,0 +1,205 @@
#
# Snipmate Snippets for Pandoc Markdown
#
# Many snippets have starred versions, i.e., versions
# that end with an asterisk (`*`). These snippets use
# vim's `"*` register---i.e., the contents of the
# system clipboard---to insert text.
# Insert Title Block
snippet %%
% ${1:`Filename('', 'title')`}
% ${2:`g:snips_author`}
% ${3:`strftime("%d %B %Y")`}
${4}
snippet %%*
% ${1:`Filename('', @*)`}
% ${2:`g:snips_author`}
% ${3:`strftime("%d %b %Y")`}
${4}
# Insert Definition List
snippet ::
${1:term}
~ ${2:definition}
# Underline with `=`s or `-`s
snippet ===
`repeat('=', strlen(getline(line(".") - 1)))`
${1}
snippet ---
`repeat('-', strlen(getline(line(".") - 1)))`
${1}
# Links and their kin
# -------------------
#
# (These don't play very well with delimitMate)
#
snippet [
[${1:link}](http://${2:url} "${3:title}")${4}
snippet [*
[${1:link}](${2:`@*`} "${3:title}")${4}
snippet [:
[${1:id}]: http://${2:url} "${3:title}"
snippet [:*
[${1:id}]: ${2:`@*`} "${3:title}"
snippet [@
[${1:link}](mailto:${2:email})${3}
snippet [@*
[${1:link}](mailto:${2:`@*`})${3}
snippet [:@
[${1:id}]: mailto:${2:email} "${3:title}"
snippet [:@*
[${1:id}]: mailto:${2:`@*`} "${3:title}"
snippet ![
![${1:alt}](${2:url} "${3:title}")${4}
snippet ![*
![${1:alt}](${2:`@*`} "${3:title}")${4}
snippet ![:
![${1:id}]: ${2:url} "${3:title}"
snippet ![:*
![${1:id}]: ${2:`@*`} "${3:title}"
snippet [^:
[^${1:id}]: ${2:note}
snippet [^:*
[^${1:id}]: ${2:`@*`}
#
# library()
snippet req
require(${1:}, quietly = TRUE)
# If Condition
snippet if
if ( ${1:condition} )
{
${2:}
}
snippet el
else
{
${1:}
}
# Function
snippet fun
${1:funname} <- # ${2:}
function
(
${3:}
)
{
${4:}
}
# repeat
snippet re
repeat{
${2:}
if(${1:condition}) break
}
# matrix
snippet ma
matrix(NA, nrow = ${1:}, ncol = ${2:})
# data frame
snippet df
data.frame(${1:}, header = TRUE)
snippet cmdarg
args <- commandArgs(TRUE)
if (length(args) == 0)
stop("Please give ${1:}!")
if (!all(file.exists(args)))
stop("Couln't find input files!")
snippet getopt
require('getopt', quietly = TRUE)
opt_spec <- matrix(c(
'help', 'h', 0, "logical", "Getting help",
'file', 'f', 1, "character","File to process"
), ncol = 5, byrow = TRUE)
opt <- getopt(spec = opt_spec)
if ( !is.null(opt$help) || is.null(commandArgs()) ) {
cat(getopt(spec = opt_spec, usage = TRUE, command = "yourCmd"))
q(status=0)
}
# some inital value
if ( is.null(opt$???) ) { opt$??? <- ??? }
snippet optparse
require("optparse", quietly = TRUE)
option_list <-
list(make_option(c("-n", "--add_numbers"), action="store_true", default=FALSE,
help="Print line number at the beginning of each line [default]")
)
parser <- OptionParser(usage = "%prog [options] file", option_list=option_list)
arguments <- parse_args(parser, positional_arguments = TRUE)
opt <- arguments$options
if(length(arguments$args) != 1) {
cat("Incorrect number of required positional arguments\n\n")
print_help(parser)
stop()
} else {
file <- arguments$args
}
if( file.access(file) == -1) {
stop(sprintf("Specified file ( %s ) does not exist", file))
} else {
file_text <- readLines(file)
}
snippet #!
#!/usr/bin/env Rscript
snippet debug
# Development & Debugging, don't forget to uncomment afterwards!
#--------------------------------------------------------------------------------
#setwd("~/Projekte/${1:}")
#opt <- list(${2:}
# )
#--------------------------------------------------------------------------------
# Took from pandoc-plugin <<<<
# Underline with `=`s or `-`s
snippet #===
#`repeat('=', strlen(getline(line(".") - 1)))`
${1}
snippet #---
#`repeat('-', strlen(getline(line(".") - 1)))`
${1}
# >>>>
snippet r
\`\`\`{r ${1:chung_tag}, echo = FALSE ${2:options}}
${3:}
\`\`\`
snippet ri
\`{r ${1:}}\`
snippet copt
\`\`\` {r setup, echo = FALSE}
opts_chunk$set(fig.path='../figures/${1:}', cache.path='../cache/-'
, fig.align='center', fig.show='hold', par=TRUE)
#opts_knit$set(upload.fun = imgur_upload) # upload images
\`\`\`
# End of File ===================================================================
# vim: set noexpandtab:

View File

@ -11,6 +11,14 @@ snippet pfn "Function definition"
pub fn ${1:function_name}(${2})${3} {
${0}
}
snippet afn "Async function definition"
async fn ${1:function_name}(${2})${3} {
${0}
}
snippet pafn "Async function definition"
pub async fn ${1:function_name}(${2})${3} {
${0}
}
snippet bench "Bench function" b
#[bench]
fn ${1:bench_function_name}(b: &mut test::Bencher) {
@ -102,7 +110,7 @@ snippet crate "Define create meta attributes"
snippet opt "Option<T>"
Option<${1:i32}>
snippet res "Result<T, E>"
Result<${1:~str}, ${2:()}>
Result<${1:&str}, ${2:()}>
# Control structures
snippet if
if ${1} {
@ -114,6 +122,10 @@ snippet ife "if / else"
} else {
${0}
}
snippet ifl "if let (...)"
if let ${1:Some($2)} = $3 {
${0:${VISUAL}}
}
snippet el "else"
else {
${0:${VISUAL}}
@ -138,6 +150,10 @@ snippet wh "while loop"
while ${1:condition} {
${0:${VISUAL}}
}
snippet whl "while let (...)"
while let ${1:Some($2)} = $3 {
${0:${VISUAL}}
}
snippet for "for ... in ... loop"
for ${1:i} in ${2} {
${0}
@ -153,7 +169,7 @@ snippet st "Struct definition"
${0}
}
snippet impl "Struct/Trait implementation"
impl ${1:Type/Trait}${2: for ${3:Type}} {
impl ${1:Type/Trait}${2: for $3} {
${0}
}
snippet stn "Struct with new constructor"
@ -161,9 +177,9 @@ snippet stn "Struct with new constructor"
${0}
}
impl $1 {
pub fn new(${2}) -> Self {
$1 { ${3} }
impl$2 $1$2 {
pub fn new(${4}) -> Self {
$1 { ${5} }
}
}
snippet ty "Type alias"
@ -182,7 +198,7 @@ snippet trait "Trait definition"
${0}
}
snippet drop "Drop trait implementation (destructor)"
impl Drop for ${1:Name} {
impl Drop for $1 {
fn drop(&mut self) {
${0}
}
@ -193,10 +209,6 @@ snippet ss "static string declaration"
snippet stat "static item declaration"
static ${1}: ${2:usize} = ${0};
# Concurrency
snippet scoped "spawn a scoped thread"
thread::scoped(${1:move }|| {
${0}
});
snippet spawn "spawn a thread"
thread::spawn(${1:move }|| {
${0}
@ -230,9 +242,11 @@ snippet macro "macro_rules!" b
$3
)
}
snippet box "Box::new()"
snippet boxp "Box::new()"
Box::new(${0:${VISUAL}})
snippet rc "Rc::new()"
Rc::new(${0:${VISUAL}})
snippet unim "unimplemented!()"
unimplemented!()
snippet use "use ...;" b
use ${1:std::$2};

View File

@ -0,0 +1 @@
extends html, javascript, css

View File

@ -289,7 +289,9 @@ snippet sum \sum^{}_{}
snippet lim \lim_{}
\\lim_{${1:n \\to \\infty}} ${0}
snippet frame frame environment
\\begin{frame}[${1:t}]{${2:title}}
\\begin{frame}[${1:t}]
\frametitle{${2:title}}
\framesubtitle{${3:subtitle}}
${0:${VISUAL}}
\\end{frame}
snippet block block environment
@ -356,3 +358,59 @@ snippet hrefc
# enquote from package csquotes
snippet enq enquote
\\enquote{${1:${VISUAL:text}}} ${0}
# Time derivative
snippet ddt time derivative
\\frac{d}{dt} {$1} {$0}
# Limit
snippet lim limit
\\lim_{{$1}} {{$2}} {$0}
# Partial derivative
snippet pdv partial derivation
\\frac{\\partial {$1}}{\partial {$2}} {$0}
# Second order partial derivative
snippet ppdv second partial derivation
\\frac{\partial^2 {$1}}{\partial {$2} \partial {$3}} {$0}
# Ordinary derivative
snippet dv derivative
\\frac{d {$1}}{d {$2}} {$0}
# Summation
snippet summ summation
\\sum_{{$1}} {$0}
# Shorthand for time derivative
snippet dot dot
\\dot{{$1}} {$0}
# Shorthand for second order time derivative
snippet ddot ddot
\\ddot{{$1}} {$0}
# Vector
snippet vec vector
\\vec{{$1}} {$0}
# Cross product
snippet \x cross product
\\times {$0}
# Dot product
snippet . dot product
\\cdot {$0}
# Integral
snippet int integral
\\int_{{$1}}^{{$2}} {$3} \: d{$4} {$5}
# Right arrow
snippet ra rightarrow
\\rightarrow {$0}
# Long right arrow
snippet lra longrightarrow
\\longrightarrow {$0}

View File

@ -1,34 +1,177 @@
snippet bl "{% block xyz %} .. {% endblock xyz %}"
# Tags
snippet apply "twig apply"
{% apply ${1} %}
${0}
{% endapply %}
snippet autoescape "twig autoescape"
{% autoescape %}
${0}
{% endautoescape %}
snippet endautoescape "twig endautoescape"
{% endautoescape %}${0}
snippet bl "twig block"
{% block ${1} %}
${2:${VISUAL}}
{% endblock $1 %}
snippet js "{% javascripts 'xyz' %} .. {% endjavascripts %}"
{% javascripts '${1}' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
snippet css "{% stylesheets 'xyz' %} .. {% endstylesheets %}"
{% stylesheets '${1}' %}
<link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}
snippet if "{% if %} .. {% endif %}"
{% if ${1} %}
${2:${VISUAL}}
{% endif %}
snippet ife "{% if %} .. {% else %} .. {% endif %}"
{% if ${1} %}
${2:${VISUAL}}
{% else %}
${0}
{% endif %}
snippet el "{% else %}"
{% else %}
${0:${VISUAL}}
snippet eif "{% elseif %}"
{% elseif ${1} %}
${0}
snippet for "{% for x in y %} .. {% endfor %}"
${0}
{% endblock %}
snippet block "twig block"
{% block ${1} %}
${0}
{% endblock %}
snippet endblock "twig endblock"
{% endblock %}${0}
snippet cache "twig cache"
{% cache %}
${0}
{% endcache %}
snippet endcache "twig endcache"
{% endcache %}${0}
snippet css "twig css"
{% css %}
${0}
{% endcss %}
snippet endcss "twig endcss"
{% endcss %}${0}
snippet dd "twig dd"
{% dd ${1} %}${0}
snippet do "twig do"
{% do ${1} %}${0}
snippet embed "twig embed"
{% embed "${1}" %}
${0}
{% endembed %}
snippet endembed "twig endembed"
{% endembed %}${0}
snippet exit "twig exit"
{% exit ${1} %}
snippet extends "twig extends"
{% extends "${1}" %}${0}
snippet ext "twig extends"
{% extends "${1}" %}${0}
snippet for "twig for"
{% for ${1} in ${2} %}
${3}
${0}
{% endfor %}
snippet ext "{% extends xyz %}"
{% extends ${1} %}
snippet fore "twig for else"
{% for ${1} in ${2} %}
${3}
{% else %}
${0}
{% endfor %}
snippet endfor "twig endfor"
{% endfor %}${0}
snippet from "twig from"
{% from "${1}" import ${2} %}${0}
snippet header "twig header"
{% header "${1}" %}${0}
snippet hook "twig hook"
{% hook "${1}" %}${0}
snippet html "twig html"
{% html %}
${0}
{% endhtml %}
snippet endhtml "twig endhtml"
{% endhtml %}${0}
snippet if "twig if"
{% if ${1} %}
${0}
{% endif %}
snippet ife "twig if else"
{% if ${1} %}
${2}
{% else %}
${0}
{% endif %}
snippet el "twig else"
{% else %}
snippet eif "twig elseif"
{% elseif ${1} %}
${0}
snippet endif "twig endif"
{% endif %}${0}
snippet import "twig import"
{% import "${1}" as ${2} %}${0}
snippet include "twig include"
{% include "${1}" %}${0}
snippet includewith "twig include with parameters"
{% include "${1}" with ${2} %}${0}
snippet js "twig js"
{% js %}
${0}
{% endjs %}
snippet endjs "twig endjs"
{% endjs %}${0}
snippet macro "twig macro"
{% macro ${1}(${2}) %}
${0}
{% endmacro %}
snippet endmacro "twig endmacro"
{% endmacro %}${0}
snippet namespace "twig namespace"
{% namespace "${1}" %}
${0}
{% endnamespace %}
snippet endnamespace "twig endnamespace"
{% endnamespace %}${0}
snippet nav "twig nav"
{% nav ${1} in ${2} %}
${0}
{% endnav %}
snippet endnav "twig endnav"
{% endnav %}${0}
snippet paginate "twig paginate"
{% paginate ${1} as ${2} %}${0}
snippet redirect "twig redirect"
{% redirect "${1}" %}${0}
snippet requireguest "twig requireguest"
{% requireGuest %}${0}
snippet requirelogin "twig requirelogin"
{% requireLogin %}${0}
snippet requirepermission "twig requirepermission"
{% requirePermission "${1}" %}${0}
snippet set "twig set"
{% set ${1} = ${2} %}${0}
snippet setb "twig set block"
{% set ${1} %}
${0}
{% endset %}
snippet endset "twig endset"
{% endset %}${0}
snippet switch "twig switch"
{% switch ${1} %}
{% case "${2}" %}
${0}
{% default %}
{% endswitch %}
snippet case "twig switch case"
{% case "${1}" %}
${0}
snippet default "twig switch default"
{% default %}
${0}
snippet endswitch "twig endswitch"
{% endswitch %}${0}
snippet use "twig use"
{% use "${1}" %}${0}
snippet verbatim "twig verbatim"
{% verbatim %}
${0}
{% endverbatim %}
snippet endverbatim "twig endverbatim"
{% endverbatim %}${0}
snippet with "twig with"
{% with %}
${0}
{% endwith %}
snippet endwith "twig endwith"
{% endwith %}${0}
# Functions
snippet dump "twig dump"
<pre>
{{ dump(${1}) }}
</pre>
# Filters
snippet translate "twig translate"
{{ "${1}"|t }}${0}

View File

@ -9,8 +9,16 @@ snippet tlet "ts let"
snippet tvar "ts var"
var ${1}: ${2:any} = ${3};
${0}
snippet + "var: type"
snippet + "ts create field"
${1}: ${0:any}
snippet #+ "ts create private field using #"
#${1}: ${0:any}
snippet tpfi "ts create public field"
public ${1}: ${0:any}
snippet tprfi "ts create private field"
private ${1}: ${0:any}
snippet tprofi "ts create protected field"
protected ${1}: ${0:any}
snippet int "interface"
interface ${1} {
${2}: ${3:any};
@ -25,6 +33,22 @@ snippet tfun "ts function"
function ${1}(${2}): ${3:any} {
${0}
}
snippet tpmet "ts public method"
public ${1}(${2}): ${3:any} {
${0}
}
snippet tpsmet "ts public static method"
public static ${1}(${2}): ${3:any} {
${0}
}
snippet tprmet "ts private method"
private ${1}(${2}): ${3:any} {
${0}
}
snippet tpromet "ts protected method"
protected ${1}(${2}): ${3:any} {
${0}
}
snippet tcla "ts class"
class ${1} {
${2}

View File

@ -9,7 +9,7 @@ snippet ife
${2}
end
else begin
${1}
${3}
end
# Else if statement
snippet eif

View File

@ -3,7 +3,7 @@
snippet lib
library ${1}
use ${1}.${2}
use $1.${2}
# Standard Libraries
snippet libs
@ -75,6 +75,16 @@ snippet prc
${2}
end if;
end process;
# process with clock and reset
snippet prcr
process (${1:clk}, ${2:nrst})
begin
if ($2 = '${3:0}') then
${4}
elsif rising_edge($1) then
${5}
end if;
end process;
# process all
snippet pra
process (${1:all})

View File

@ -43,7 +43,6 @@ snippet ife if ... else statement
endif
snippet au augroup ... autocmd block
augroup ${1:AU_NAME}
" this one is which you're most likely to use?
autocmd ${2:BufRead,BufNewFile} ${3:*.ext,*.ext3|<buffer[=N]>} ${0}
augroup end
snippet bun Vundle.vim Plugin definition