1
0
mirror of https://github.com/amix/vimrc synced 2025-07-13 06:35:01 +08:00

Merge branch 'Linux' of https://github.com/Geezus42/vimrc into Linux

This commit is contained in:
geezus
2021-06-30 13:19:18 -05:00
235 changed files with 6246 additions and 1351 deletions

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

@ -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

View File

@ -241,7 +241,7 @@ snippet addsp
snippet addarg
parser.add_argument("${0:short_arg}", "${1:long_arg}", default=${2:None}, help="${3:Help text}")
snippet addnarg
parser.add_argument("${0:arg}", nargs="${1:*}", default"${2:None}, help="${3:Help text}")
parser.add_argument("${0:arg}", nargs="${1:*}", default=${2:None}, help="${3:Help text}")
snippet addaarg
parser.add_argument("${0:arg}", "${1:long_arg}", action="${2:store_true}", default=${3:False}, help="${4:Help text}")
snippet pargs

View File

@ -101,7 +101,7 @@ snippet crate "Define create meta attributes"
// Crate name
#![crate_name = "${1:crate_name}"]
// Additional metadata attributes
#![desc = "${2:Descrption.}"]
#![desc = "${2:Description.}"]
#![license = "${3:BSD}"]
#![comment = "${4:Comment.}"]
// Specify the output type

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,17 @@ 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
<<<<<<< HEAD
=======
snippet auv augroupvisual ... autocmd block with visual placeholder
augroup ${1:AU_NAME}
autocmd!
${0:${VISUAL}}
augroup END
>>>>>>> 1cca3b1df2973096bb9526a0d79c7b93c04e66b3
snippet bun Vundle.vim Plugin definition
Plugin '${0}'
snippet plug vim-plug Plugin definition

View File

@ -118,7 +118,7 @@ snippet vfilter
snippet vfor
<div v-for="${1:item} in ${2:items}" :key="$1.id">
{{ $1 }}
</div
</div>
snippet vgetters
getters: {