mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -74,7 +74,9 @@ Additional snippets can be added to the current buffer with the
|
||||
"snippets" ending. For example, to add the JavaScript Jasmine snippets, run:
|
||||
`:UltiSnipsAddFiletypes javascript-jasmine`. To have this snippet loaded
|
||||
everytime a JavaScript file is opened or created you can add the command to your
|
||||
`.vim/ftplugin/javascript.vim` file.
|
||||
-`.vim/ftplugin/javascript.vim` file. Another way is to add
|
||||
`autocmd FileType js UltiSnipsAddFiletypes javascript-jasmine` in your `.vimrc`.
|
||||
|
||||
|
||||
For more see the UltiSnips docs (`:help UltiSnips`).
|
||||
|
||||
|
@ -185,7 +185,7 @@ ${1:FIELDNAME} = models.DateTimeField($2)
|
||||
endsnippet
|
||||
|
||||
snippet mdecimal "DecimalField" b
|
||||
${1:FIELDNAME} = models.DateTimeField($2)
|
||||
${1:FIELDNAME} = models.DecimalField(max_digits=${2:10}, decimal_places=${3:2})
|
||||
endsnippet
|
||||
|
||||
snippet memail "EmailField" b
|
||||
|
@ -45,25 +45,6 @@ type ${1:Interface} interface {
|
||||
}
|
||||
endsnippet
|
||||
|
||||
# statements
|
||||
snippet for "For loop" b
|
||||
for ${1:condition}${1/(.+)/ /}{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fori "Integer for loop" b
|
||||
for ${1:i} := 0; $1 < ${2:N}; $1++ {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet forr "For range loop" b
|
||||
for ${2:name} := range ${1:collection} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet if "If statement" b
|
||||
if ${1:condition}${1/(.+)/ /}{
|
||||
${0:${VISUAL}}
|
||||
@ -76,22 +57,6 @@ case${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet select "Select statement" b
|
||||
select {
|
||||
case${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet case "Case clause" b
|
||||
case ${1:condition}:
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet default "Default clause" b
|
||||
default:
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
# functions
|
||||
snippet /^main/ "Main function" r
|
||||
func main() {
|
||||
|
@ -58,6 +58,12 @@ ${1:var }${2:function_name} = function $2(${3}) {
|
||||
};
|
||||
endsnippet
|
||||
|
||||
snippet af "Anonymous Function" i
|
||||
function($1) {
|
||||
${VISUAL}$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet iife "Immediately-Invoked Function Expression (iife)"
|
||||
(function(${1:window}) {
|
||||
${VISUAL}$0
|
||||
|
@ -51,11 +51,11 @@ format!("${1}"${2/..*/, /}${2});
|
||||
endsnippet
|
||||
|
||||
snippet macro "macro_rules!" b
|
||||
macro_rules! ${1:name} (
|
||||
macro_rules! ${1:name} {
|
||||
(${2:matcher}) => (
|
||||
${3}
|
||||
)
|
||||
)
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet mod "A module" b
|
||||
@ -88,7 +88,7 @@ pub struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
|
||||
|
||||
impl $1 {
|
||||
pub fn new(${2}) -> $1 {
|
||||
$1 { ${3} };
|
||||
$1 { ${3} }
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
@ -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