mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -87,10 +87,6 @@ snippet doc
|
||||
"""
|
||||
snippet fn
|
||||
fn ${1:args} -> ${0} end
|
||||
snippet fun
|
||||
function do
|
||||
${0}
|
||||
end
|
||||
snippet mdoc
|
||||
@moduledoc """
|
||||
${0}
|
||||
@ -114,6 +110,12 @@ snippet test
|
||||
end
|
||||
snippet testa
|
||||
test "${1:test_name}", %{${2:arg: arg}} do
|
||||
${0}
|
||||
end
|
||||
snippet exunit
|
||||
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
|
||||
use ExUnit.Case
|
||||
|
||||
${0}
|
||||
end
|
||||
snippet try try .. rescue .. end
|
||||
|
@ -53,26 +53,6 @@ snippet dfr
|
||||
${0}
|
||||
}
|
||||
}()
|
||||
# gpl
|
||||
snippet gpl
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright (C) ${1:Author}, `strftime("%Y")`
|
||||
*/
|
||||
|
||||
${0}
|
||||
# int
|
||||
snippet i
|
||||
int
|
||||
@ -94,6 +74,12 @@ snippet if
|
||||
if ${1:/* condition */} {
|
||||
${2}
|
||||
}
|
||||
snippet ife
|
||||
if ${1:/* condition */} {
|
||||
${2}
|
||||
} else {
|
||||
${0}
|
||||
}
|
||||
# else snippet
|
||||
snippet el
|
||||
else {
|
||||
@ -128,18 +114,21 @@ snippet ie
|
||||
${3}
|
||||
}
|
||||
${0}
|
||||
# for loop
|
||||
snippet fo
|
||||
# for int loop
|
||||
snippet for
|
||||
for ${1}{
|
||||
${0}
|
||||
}
|
||||
# for int loop
|
||||
snippet fori
|
||||
for ${2:i} := 0; $2 < ${1:count}; $2${3:++} {
|
||||
${4}
|
||||
${0}
|
||||
}
|
||||
${0}
|
||||
# for range loop
|
||||
snippet fr
|
||||
for ${1:k}, ${2:v} := range ${3} {
|
||||
${4}
|
||||
snippet forr
|
||||
for ${1:e} := range ${2:collection} {
|
||||
${0}
|
||||
}
|
||||
${0}
|
||||
# function simple
|
||||
snippet fun
|
||||
func ${1:funcName}(${2}) ${3:error} {
|
||||
@ -196,8 +185,6 @@ snippet sl
|
||||
select {
|
||||
case ${1:v1} := <-${2:chan1}
|
||||
${3}
|
||||
case ${4:v2} := <-${5:chan2}
|
||||
${6}
|
||||
default:
|
||||
${0}
|
||||
}
|
||||
@ -228,7 +215,7 @@ snippet t
|
||||
# goroutine named function
|
||||
snippet g
|
||||
go ${1:funcName}(${0})
|
||||
# goroutine anonymous function
|
||||
# goroutine anonymous function
|
||||
snippet ga
|
||||
go func(${1} ${2:type}) {
|
||||
${3:/* code */}
|
||||
|
@ -5,7 +5,7 @@ snippet ex
|
||||
module.exports = ${1};
|
||||
# require
|
||||
snippet re
|
||||
var ${1} = require('${2:module_name}');
|
||||
${1:var} ${2} = require('${3:module_name}');
|
||||
# EventEmitter
|
||||
snippet on
|
||||
on('${1:event_name}', function(${2:stream}) {
|
||||
|
@ -723,3 +723,7 @@ snippet iiexp
|
||||
it { is_expected.to ${0} }
|
||||
snippet iiexpn
|
||||
it { is_expected.not_to ${0} }
|
||||
snippet agg
|
||||
aggregate_failures '${1:message}' do
|
||||
${0}
|
||||
end
|
||||
|
@ -25,7 +25,7 @@ snippet bench "Bench function" b
|
||||
}
|
||||
snippet new "Constructor function"
|
||||
pub fn new(${2}) -> ${1:Name} {
|
||||
$1 { ${3} };
|
||||
$1 { ${3} }
|
||||
}
|
||||
snippet main "Main function"
|
||||
pub fn main() {
|
||||
@ -143,7 +143,7 @@ snippet stn "Struct with new constructor"
|
||||
|
||||
impl $1 {
|
||||
pub fn new(${2}) -> $1 {
|
||||
$1 { ${3} };
|
||||
$1 { ${3} }
|
||||
}
|
||||
}
|
||||
snippet type "Type alias"
|
||||
|
Reference in New Issue
Block a user