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

Updated plugins

This commit is contained in:
Amir
2021-05-05 10:25:00 +02:00
parent 8e54cbc92e
commit a7a471a207
265 changed files with 7773 additions and 1880 deletions

View File

@ -344,3 +344,10 @@ snippet todo
# This is kind of convenient
snippet .
[${1}]
snippet asm
__asm__ __volatile__(
"${0}\n\t"
:
:
);

View File

@ -1 +1,59 @@
extends cpp
snippet kern "Kernel definition"
__global__ void ${1:kernel}(${2:void}) {
${0:// TODO: Implement}
}
snippet dev "Device function definition"
__device__ ${1:int} ${2:foo}(${3:void}) {
${0:// TODO: Implement}
return 0;
}
snippet call "Kernel call"
${1:kernel}<<<${2:args}>>>(${3});${0}
snippet sync "Synchonize threads"
__syncthreads();
snippet tid "Thread Index"
threadIdx.${0}
snippet bid "Block Index"
blockIdx.${0}
snippet bdim "Block Dimension"
blockDim.${0}
snippet ii "Get current index (1D)"
int ${1:index} = threadIdx.${2:x} + blockIdx.$2 * blockDim.$2;
snippet ix "Get current X index (1D)"
int ${1:x} = threadIdx.x + blockIdx.x * blockDim.x;
snippet iy "Get current Y index (1D)"
int ${1:y} = threadIdx.y + blockIdx.y * blockDim.y;
snippet iz "Get current Z index (1D)"
int ${1:z} = threadIdx.z + blockIdx.z * blockDim.z;
snippet ixy "Get current X,Y index (2D)"
int ${1:x} = threadIdx.x + blockIdx.x * blockDim.x;
int ${2:y} = threadIdx.y + blockIdx.y * blockDim.y;
snippet ixz "Get current X,Z index (2D)"
int ${1:x} = threadIdx.x + blockIdx.x * blockDim.x;
int ${3:z} = threadIdx.z + blockIdx.z * blockDim.z;
snippet iyz "Get current Y,Z index (2D)"
int ${2:y} = threadIdx.y + blockIdx.y * blockDim.y;
int ${3:z} = threadIdx.z + blockIdx.z * blockDim.z;
snippet ixyz "Get current X,Y,Z index (3D)"
int ${1:x} = threadIdx.x + blockIdx.x * blockDim.x;
int ${2:y} = threadIdx.y + blockIdx.y * blockDim.y;
int ${3:z} = threadIdx.z + blockIdx.z * blockDim.z;
snippet share "Shared memory declaration"
__shared__ ${1:int} ${2:memo}[${3:SIZE}];${0}

View File

@ -38,6 +38,17 @@ snippet ft form_tag
<%= form_tag(${1:"/users"}, method: ${2::post}) %>
${0}
</form>
snippet sl select
<%= select ${1:f}, :${2:field}, ${3:[{"key", "value"}]}, prompt: ${4:"Prompt"} %>
snippet sb submit
<%= submit ${1:"Submit"} %>
snippet rb radio_button
<%= radio_button ${1:f}, :${2:field}, ${3:"value"} %>
snippet et error_tag
<%= error_tag ${1:f}, :${2:field} %>
snippet ti text_input

View File

@ -0,0 +1,80 @@
snippet doc
/// ${0}
snippet comment
// ${0}
snippet let
let ${1} = ${0}
snippet lit
[<Literal>]
let ${1} = ${0}
snippet rec
type ${1} = { ${0} }
snippet arec
{| ${0} |}
snippet fn
let ${1} =
${0}
snippet fnr
let rec ${1} =
${0}
snippet lam
(fun ${1} -> ${0})
snippet mod
module ${1} =
${0}
snippet for
for ${1} in ${2} do
${0}
snippet if
if ${1} then
${2}
snippet ife
if ${1} then
${2}
else
${0}
snippet ifee
if ${1} then
${2}
elif ${3} then
${4}
else
${0}
snippet eif
elif ${1} then
${0}
snippet el
else
${0}
snippet try
try
${1}
with ${0}
snippet match
match ${1} with
| ${2} -> ${0}
snippet |
| ${1} -> ${0}
snippet p
|> ${0}
snippet pr
printfn "${1}" ${0}
snippet pri
printfn \$"${0}"
snippet amap
|> Array.map (fun ${1} -> ${0})
snippet lmap
|> List.map (fun ${1} -> ${0})
snippet smap
|> Seq.map (fun ${1} -> ${0})
snippet atap
|> Array.map (fun x -> printfn "%A" x; x) // tap
snippet ltap
|> List.map (fun x -> printfn "%A" x; x) // tap
snippet stap
|> Seq.map (fun x -> printfn "%A" x; x) // tap
snippet main
[<EntryPoint>]
let main argv =
${0}
0

View File

@ -449,7 +449,7 @@ snippet html5
</html>
snippet html5l
<!DOCTYPE html>
<html lang="${1:es}">
<html lang="${1:en}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">

View File

@ -99,11 +99,11 @@ snippet terr
snippet ret
return ${0:result};
snippet for "for (...) {...}"
for (var ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) {
for (let ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) {
${0:${VISUAL}}
}
snippet forr "reversed for (...) {...}"
for (var ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) {
for (let ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) {
${0:${VISUAL}}
}
snippet wh "(condition) { ... }"
@ -116,7 +116,7 @@ snippet do "do { ... } while (condition)"
} while (${1:/* condition */});
# For in loop
snippet fori
for (var ${1:prop} in ${2:object}) {
for (let ${1:prop} in ${2:object}) {
${0:$2[$1]}
}
# Objects
@ -275,6 +275,8 @@ snippet cprof "console.profile"
console.profileEnd();
snippet ctable "console.table"
console.table(${1:"${2:value}"});
snippet clstr "console.log stringified"
console.log(JSON.stringify(${0}, null, 2));
# Misc
snippet us
'use strict';

View File

@ -28,7 +28,7 @@ snippet case
{% endcase %}
snippet when
{% when ${1:condition} %}
${0}
${0:${VISUAL}}
snippet cycle
{% cycle '${1:odd}', '${2:even}' %}
snippet cyclegroup
@ -100,7 +100,7 @@ snippet javascript
${0}
{% endjavascript %}
snippet comment-
{%- comment -%}${0}{%- endcomment -%}
{%- comment -%}${0:${VISUAL}}{%- endcomment -%}
snippet if-
{%- if ${1:condition} -%}
${0:${VISUAL}}
@ -128,7 +128,7 @@ snippet case-
{%- endcase -%}
snippet when-
{%- when ${1:condition} -%}
${0}
${0:${VISUAL}}
snippet cycle-
{%- cycle '${1:odd}', '${2:even}' -%}
snippet cyclegroup-
@ -151,6 +151,22 @@ 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 layout-
{%- layout '${1:layout}' -%}
snippet layoutnone-
{%- layout none -%}
snippet paginate-
{%- paginate ${1:collection.products} by ${2:12} -%}
{%- for ${3:product} in $1 -%}
${0}
{%- endfor -%}
{%- endpaginate -%}
snippet join
| join: '${1:, }'
snippet first
@ -265,3 +281,192 @@ snippet asset_img_url
| asset_img_url: '${1:medium}'
snippet img_url
| img_url: '${1:medium}'
snippet _schema
{% schema %}
{
"name": "${1}",
"class": "${2}",
"settings": [
${0}
]
}
{% endschema %}
snippet _blocks
"blocks": [
{
"type": "${1}",
"name": "${2}",
"settings": [
${0}
]
}
]
snippet _text
{
"type": "text",
"id": "${1}",
"label": "${2}",
"default": "${3}",
"info": "${4}",
"placeholder": "${0}"
}
snippet _textarea
{
"type": "textarea",
"id": "${1}",
"label": "${2}",
"default": "${3}",
"info": "${4}",
"placeholder": "${0}"
}
snippet _image_picker
{
"type": "image_picker",
"id": "${1}",
"label": "${0}"
}
snippet _radio
{
"type": "radio",
"id": "${1}",
"label": "${2}",
"options": [
{ "value": "${5}", "label": "${0}" }
],
"default": "${3}",
"info": "${4}"
}
snippet _select
{
"type": "select",
"id": "${1}",
"label": "${2}",
"options": [
{
"group": "${5}",
"value": "${6}",
"label": "${0}"
}
],
"default": "${3}",
"info": "${4}"
}
snippet _checkbox
{
"type": "checkbox",
"id": "${1}",
"label": "${2}",
"default": ${3:true},
"info": "${0}"
}
snippet _range
{
"type": "range",
"id": "${1}",
"min": ${2},
"max": ${3},
"step": ${4},
"unit": "${5}",
"label": "${6}",
"default": ${0}
}
snippet _color
{
"type": "color",
"id": "${1}",
"label": "${2}",
"default": "${3}",
"info": "${0}"
}
snippet _font
{
"type": "font_picker",
"id": "${1}",
"label": "${2}",
"info": "${3}",
"default": "${0:helvetica_n4}"
}
snippet _collection
{
"type": "collection",
"id": "${1}",
"label": "${2}",
"info": "${0}"
}
snippet _product
{
"type": "product",
"id": "${1}",
"label": "${2}",
"info": "${0}"
}
snippet _blog
{
"type": "blog",
"id": "${1}",
"label": "${2}",
"info": "${0}"
}
snippet _page
{
"type": "page",
"id": "${1}",
"label": "${2}",
"info": "${0}"
}
snippet _link_list
{
"type": "link_list",
"id": "${1}",
"label": "${2}",
"info": "${0}"
}
snippet _url
{
"type": "url",
"id": "${1}",
"label": "${2}",
"info": "${0}"
}
snippet _video
{
"type": "video_url",
"id": "${1}",
"label": "${2}",
"accept": ["youtube", "vimeo"${0}],
"default": "${3}",
"info": "${4}",
"placeholder": "${5}"
}
snippet _richtext
{
"type": "richtext",
"id": "${1}",
"label": "${2}",
"default": "<p>${0}</p>"
}
snippet _html
{
"type": "html",
"id": "${1}",
"label": "${2}",
"default": "<div>${0}</div>"
}
snippet _article
{
"type": "article",
"id": "${1}",
"label": "${2}",
"info": "${0}"
}
snippet _header
{
"type": "header",
"content": "${1}",
"info": "${0}"
}
snippet _paragraph
{
"type": "paragraph",
"content": "${0}"
}

View File

@ -0,0 +1,190 @@
##
## Preprocessor
# #include <...>
snippet inc
#include <${1:stdio}.h>
# #include "..."
snippet Inc
#include "${1:`vim_snippets#Filename("$1.h")`}"
# ifndef...define...endif
snippet ndef
#ifndef $1
#define ${1:SYMBOL} ${2:value}
#endif /* ifndef $1 */
# define
snippet def
#define
# ifdef...endif
snippet ifdef
#ifdef ${1:FOO}
${2:#define }
#endif
# if
snippet #if
#if ${1:FOO}
${0:${VISUAL}}
#endif
# header include guard
snippet once
#ifndef ${1:`toupper(vim_snippets#Filename('$1_H', 'UNTITLED_H'))`}
#define $1
${0}
#endif /* end of include guard: $1 */
##
## Control Statements
# if
snippet if
if(${1:true})
{
${0:${VISUAL}}
}
snippet ife
if(${1:true})
{
${2:${VISUAL}}
}
else
{
${0}
}
# else
snippet el
else
{
${0:${VISUAL}}
}
# else if
snippet elif
else if(${1:true})
{
${0:${VISUAL}}
}
# ifi
snippet ifi
if(${1:true}) ${0};
# ternary
snippet t
${1:/* condition */} ? ${2:a} : ${3:b}
# switch
snippet switch
switch(${1:/* variable */})
{
case ${2:/* variable case */}:
${3}
${4:break;}${5}
default:
${6}
}
# switch without default
snippet switchndef
switch(${1:/* variable */})
{
case ${2:/* variable case */}:
${3}
${4:break;}${5}
}
# case
snippet case
case ${1:/* variable case */}:
${2}
${3:break;}
snippet ret
return ${0};
##
## Loops
#foreach
snippet fore
foreach(${1:mixed} ${2:ele} in ${3:arr})
{
${4}
}
# for
snippet for
for(int ${2:i} = 0; $2 < ${1:count}; $2${3:++})
{
${4}
}
# for (custom)
snippet forr
for(int ${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++})
{
${5}
}
# while
snippet wh
while(${1:/* condition */})
{
${0:${VISUAL}}
}
# do... while
snippet do
do{
${0:${VISUAL}}
}while (${1:/* condition */});
##
## Functions
# function definition
snippet fnc
${1:void} ${2:function_name}(${3})
{
${4}
}
# function definition with zero parameters
snippet defun0
${1:void} ${2:function_name}()
{
${3}
}
# function definition with one parameter
snippet defun1
${1:void} ${2:function_name}(${3:Type} ${4:Parameter})
{
${5}
}
# function definition with two parameters
snippet defun2
${1:void} ${2:function_name}(${3:Type} ${4:Parameter}, ${5:Type} ${6:Parameter})
{
${7}
}
# function definition with three parameters
snippet defun3
${1:void} ${2:function_name}(${3:Type} ${4:Parameter}, ${5:Type} ${6:Parameter}, ${7:Type} ${8:Parameter})
{
${9}
}
# function declaration
snippet fund
${1:void} ${2:function_name}(${3});
##
## Input/Output
# printf
snippet pr
printf("${1:%s}\n"${2});
# fprintf (again, this isn't as nice as TextMate's version, but it works)
snippet fpr
fprintf(${1:stderr}, "${2:%s}\n"${3});
snippet prd
printf("${1:} = %d\n", $1);
snippet prf
printf("${1:} = %f\n", $1);
snippet prx
printf("${1:} = %${2}\n", $1);
##
# TODO section
snippet todo
/*! TODO: ${1:Todo description here} */
## Miscellaneous
# This is kind of convenient
snippet .
[${1}]
##
## MHXY
snippet head
// code for ${1} by `$USER` create at `strftime("%Y-%m-%d %H:%M:%S")`

View File

@ -24,7 +24,7 @@ snippet rb
snippet beg
begin
${0}
rescue ${1:Exception} => ${2:e}
rescue ${1:StandardError} => ${2:e}
end
snippet req require
require '${1}'
@ -485,22 +485,22 @@ snippet asnm
snippet aso
assert_operator ${1:left}, :${2:operator}, ${3:right}
snippet asr
assert_raise ${1:Exception} { ${0} }
assert_raises(${1:StandardError}) { ${0} }
snippet asrd
assert_raise ${1:Exception} do
assert_raises ${1:StandardError} do
${0}
end
snippet asnr
assert_nothing_raised ${1:Exception} { ${0} }
assert_nothing_raised(${1:StandardError}) { ${0} }
snippet asnrd
assert_nothing_raised ${1:Exception} do
assert_nothing_raised ${1:StandardError} do
${0}
end
snippet asrt
assert_respond_to ${1:object}, :${2:method}
snippet ass assert_same(..)
assert_same ${1:expected}, ${2:actual}
snippet ass assert_send(..)
snippet asss assert_send(..)
assert_send [${1:object}, :${2:message}, ${3:args}]
snippet asns
assert_not_same ${1:unexpected}, ${2:actual}
@ -518,6 +518,24 @@ snippet asntd
end
snippet fl
flunk '${1:Failure message.}'
snippet rf
refute ${1:test}, '${2:Failure message.}'
snippet rfe
refute_equal ${1:unexpected}, ${2:actual}
snippet rfko
refute_kind_of ${1:UnexpectedKind}, ${2:actual_instance}
snippet rfn
refute_nil ${1:instance}
snippet rfo
refute_operator ${1:left}, :${2:operator}, ${3:right}
snippet rfi
refute_includes ${1:collection}, ${2:object}
snippet rfid
refute_in_delta ${1:unexpected_float}, ${2:actual_float}, ${3:2**-20}
snippet rfio
refute_instance_of ${1:UnexpectedClass}, ${2:actual_instance}
snippet rfs
refute_same ${1:unexpected}, ${2:actual}
# Benchmark.bmbm do .. end
snippet bm-
TESTS = ${1:10_000}
@ -568,7 +586,7 @@ snippet b
snippet begin
begin
fail 'A test exception.'
rescue Exception => e
rescue StandardError => e
puts e.message
puts e.backtrace.inspect
else
@ -640,7 +658,7 @@ snippet wm
snippet mout
-> { ${1} }.must_output '${0}'
snippet mra
-> { ${1} }.must_raise ${0:Exception}
-> { ${1} }.must_raise ${0:StandardError}
snippet mrt
must_respond_to :${0:method}
snippet wrt

View File

@ -1,5 +1,11 @@
#version 1
#PREAMBLE
#documentclass without options
snippet dcl \documentclass{}
\\documentclass{${1:class}} ${0}
#documentclass with options
snippet dclo \documentclass[]{}
\\documentclass[${1:options}]{${2:class}} ${0}
#newcommand
snippet nc \newcommand
\\newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0}
@ -19,6 +25,11 @@ snippet begin \begin{} ... \end{} block
\\begin{${1:env}}
${0:${VISUAL}}
\\end{$1}
# Maketitle
snippet mkt maketitle
\\maketitle
# Tabular
snippet tab tabular (or arbitrary) environment
\\begin{${1:tabular}}{${2:c}}

View File

@ -58,7 +58,7 @@ snippet al
end
# Module block
snippet mod
module ${1:module_name} (${2});
module ${1:`vim_snippets#Filename('$1', 'name')`} (${2});
${0}
endmodule
# For
@ -81,3 +81,19 @@ snippet task
task ${1:name}(${2});
${0}
endtask: $1
# Initial
snippet ini
initial begin
${0}
end
# typedef struct packed
snippet tdsp
typedef struct packed {
int ${2:data};
} ${1:`vim_snippets#Filename('$1_t', 'name')`};
# typedef eum
snippet tde
typedef enum ${2:logic[15:0]}
{
${3:REG = 16'h0000}
} ${1:my_dest_t};

View File

@ -43,8 +43,14 @@ snippet ife if ... else statement
endif
snippet au augroup ... autocmd block
augroup ${1:AU_NAME}
autocmd!
autocmd ${2:BufRead,BufNewFile} ${3:*.ext,*.ext3|<buffer[=N]>} ${0}
augroup end
augroup END
snippet auv augroupvisual ... autocmd block with visual placeholder
augroup ${1:AU_NAME}
autocmd!
${0:${VISUAL}}
augroup END
snippet bun Vundle.vim Plugin definition
Plugin '${0}'
snippet plug vim-plug Plugin definition