mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -130,6 +130,84 @@ snippet fun
|
||||
{
|
||||
${4}
|
||||
}
|
||||
# function definition with zero parameters
|
||||
snippet fun0
|
||||
${1:void} ${2:function_name}()
|
||||
{
|
||||
${3}
|
||||
}
|
||||
# function definition with Doxygen documentation
|
||||
snippet dfun0
|
||||
/*! \brief ${1:Brief function description here}
|
||||
*
|
||||
* ${2:Detailed description of the function}
|
||||
*
|
||||
* \return ${3:Return parameter description}
|
||||
*/
|
||||
${4:void} ${5:function_name}()
|
||||
{
|
||||
${6}
|
||||
}
|
||||
# function definition with one parameter
|
||||
snippet fun1
|
||||
${1:void} ${2:function_name}(${3:Type} ${4:Parameter})
|
||||
{
|
||||
${5}
|
||||
}
|
||||
# function definition with one parameter with Doxygen documentation
|
||||
snippet dfun1
|
||||
/*! \brief ${1:Brief function description here}
|
||||
*
|
||||
* ${2:Detailed description of the function}
|
||||
*
|
||||
* \param $3 ${4:Parameter description}
|
||||
* \return ${5:Return parameter description}
|
||||
*/
|
||||
${6:void} ${7:function_name}(${8:Type} ${3:Parameter})
|
||||
{
|
||||
${9}
|
||||
}
|
||||
# function definition with two parameters
|
||||
snippet fun2
|
||||
${1:void} ${2:function_name}(${3:Type} ${4:Parameter}, ${5:Type} ${6:Parameter})
|
||||
{
|
||||
${7}
|
||||
}
|
||||
# function definition with two parameters with Doxygen documentation
|
||||
snippet dfun2
|
||||
/*! \brief ${1:Brief function description here}
|
||||
*
|
||||
* ${2:Detailed description of the function}
|
||||
*
|
||||
* \param $3 ${4:Parameter description}
|
||||
* \param $5 ${6:Parameter description}
|
||||
* \return ${7:Return parameter description}
|
||||
*/
|
||||
${8:void} ${9:function_name}(${10:Type} ${3:Parameter}, ${11:Type} ${5:Parameter})
|
||||
{
|
||||
${12}
|
||||
}
|
||||
# function definition with two parameters
|
||||
snippet fun3
|
||||
${1:void} ${2:function_name}(${3:Type} ${4:Parameter}, ${5:Type} ${6:Parameter}, ${7:Type} ${8:Parameter})
|
||||
{
|
||||
${9}
|
||||
}
|
||||
# function definition with two parameters with Doxygen documentation
|
||||
snippet dfun3
|
||||
/*! \brief ${1:Brief function description here}
|
||||
*
|
||||
* ${2:Detailed description of the function}
|
||||
*
|
||||
* \param $3 ${4:Parameter description}
|
||||
* \param $5 ${6:Parameter description}
|
||||
* \param $7 ${8:Parameter description}
|
||||
* \return ${9:Return parameter description}
|
||||
*/
|
||||
${10:void} ${11:function_name}(${12:Type} ${3:Parameter}, ${13:Type} ${5:Parameter}, ${14:Type} ${7:Parameter})
|
||||
{
|
||||
${15}
|
||||
}
|
||||
# function declaration
|
||||
snippet fund
|
||||
${1:void} ${2:function_name}(${3});
|
||||
@ -140,21 +218,39 @@ snippet td
|
||||
typedef ${1:int} ${2:MyCustomType};
|
||||
# struct
|
||||
snippet st
|
||||
/*! \struct $1
|
||||
* \brief ${3:Brief struct description}
|
||||
*
|
||||
* ${4:Detailed description}
|
||||
*/
|
||||
struct ${1:`vim_snippets#Filename('$1_t', 'name')`} {
|
||||
${2:/* data */}
|
||||
}${3: /* optional variable list */};
|
||||
${2:Data} /*!< ${4:Description} */
|
||||
}${5: /* optional variable list */};
|
||||
# typedef struct
|
||||
snippet tds
|
||||
/*! \struct $2
|
||||
* \brief ${5:Brief struct description}
|
||||
*
|
||||
* ${6:Detailed description}
|
||||
*/
|
||||
typedef struct ${2:_$1 }{
|
||||
${3:/* data */}
|
||||
m_${3:Data} /*!< ${4:Description} */
|
||||
} ${1:`vim_snippets#Filename('$1_t', 'name')`};
|
||||
|
||||
snippet enum
|
||||
/*! \enum $1
|
||||
*
|
||||
* ${2:Detailed description}
|
||||
*/
|
||||
enum ${1:name} { ${0} };
|
||||
# typedef enum
|
||||
snippet tde
|
||||
/*! \enum $2
|
||||
*
|
||||
* ${4:Detailed description}
|
||||
*/
|
||||
typedef enum {
|
||||
${1:/* data */}
|
||||
${1:Data} /*!< ${3:Description} */
|
||||
} ${2:foo};
|
||||
##
|
||||
## Input/Output
|
||||
@ -228,6 +324,11 @@ snippet getopt
|
||||
}
|
||||
}
|
||||
##
|
||||
# TODO section
|
||||
snippet todo
|
||||
/*! TODO: ${1:Todo description here}
|
||||
* \todo $1
|
||||
*/
|
||||
## Miscellaneous
|
||||
# This is kind of convenient
|
||||
snippet .
|
||||
|
@ -78,20 +78,61 @@ snippet mu
|
||||
## Class
|
||||
# class
|
||||
snippet cl
|
||||
/*! \class $1
|
||||
* \brief ${3:Brief class description}
|
||||
*
|
||||
* ${4:Detailed description}
|
||||
*/
|
||||
class ${1:`vim_snippets#Filename('$1', 'name')`}
|
||||
{
|
||||
public:
|
||||
$1(${2});
|
||||
~$1();
|
||||
virtual ~$1();
|
||||
|
||||
private:
|
||||
${0:/* data */}
|
||||
protected:
|
||||
m_${5}; /*!< ${6:Member description} */
|
||||
};
|
||||
# member function implementation
|
||||
snippet mfun
|
||||
${4:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {
|
||||
${0}
|
||||
}
|
||||
# member function implementation without parameters
|
||||
snippet dmfun0
|
||||
/*! \brief ${4:Brief function description here}
|
||||
*
|
||||
* ${5:Detailed description}
|
||||
*
|
||||
* \return ${6:Return parameter description}
|
||||
*/
|
||||
${3:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}() {
|
||||
${0}
|
||||
}
|
||||
# member function implementation with one parameter
|
||||
snippet dmfun1
|
||||
/*! \brief ${6:Brief function description here}
|
||||
*
|
||||
* ${7:Detailed description}
|
||||
*
|
||||
* \param $4 ${8:Parameter description}
|
||||
* \return ${9:Return parameter description}
|
||||
*/
|
||||
${5:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}(${3:Type} ${4:Parameter}) {
|
||||
${0}
|
||||
}
|
||||
# member function implementation with two parameter
|
||||
snippet dmfun2
|
||||
/*! \brief ${8:Brief function description here}
|
||||
*
|
||||
* ${9:Detailed description}
|
||||
*
|
||||
* \param $4 ${10:Parameter description}
|
||||
* \param $6 ${11:Parameter description}
|
||||
* \return ${12:Return parameter description}
|
||||
*/
|
||||
${7:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}(${3:Type} ${4:Parameter},${5:Type} ${6:Parameter}) {
|
||||
${0}
|
||||
}
|
||||
# namespace
|
||||
snippet ns
|
||||
namespace ${1:`vim_snippets#Filename('', 'my')`} {
|
||||
@ -152,3 +193,13 @@ snippet lld
|
||||
[${1}](${2}){
|
||||
${3}
|
||||
};
|
||||
# snippets exception
|
||||
snippet try
|
||||
try {
|
||||
|
||||
}catch(${1}) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -28,9 +28,12 @@ snippet doc
|
||||
$0
|
||||
snippet dox
|
||||
!> @brief ${1}
|
||||
!!
|
||||
!> ${2}
|
||||
!> @author `g:snips_author`
|
||||
${0}
|
||||
snippet doxp
|
||||
!> @param[${1}]${0}
|
||||
# Variables definitions
|
||||
# Boolean
|
||||
snippet bool
|
||||
|
@ -78,7 +78,7 @@ snippet spaceless
|
||||
snippet ssi
|
||||
{% ssi ${0} %}
|
||||
snippet trans
|
||||
{% trans "${0:string}" %}
|
||||
{% trans %}${0}{% endtrans %}
|
||||
snippet url
|
||||
{% url ${1} as ${0} %}
|
||||
snippet widthratio
|
||||
|
64
sources_non_forked/vim-snippets/snippets/matlab.snippets
Normal file
64
sources_non_forked/vim-snippets/snippets/matlab.snippets
Normal file
@ -0,0 +1,64 @@
|
||||
snippet if if
|
||||
if ${1}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet ife if ... else
|
||||
if ${1}
|
||||
${2}
|
||||
else
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet el else
|
||||
else
|
||||
${0}
|
||||
|
||||
snippet eif elsif
|
||||
elseif ${1}
|
||||
${0}
|
||||
|
||||
snippet wh while
|
||||
while ${1}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet for for
|
||||
for ${1:i} = ${2:1:n}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet parfor parfor
|
||||
parfor ${1:i} = ${2:1:n}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet fun function
|
||||
function [${3:out}] = ${1:`vim_snippets#Filename("$1", "fun_name")`}(${2})
|
||||
${0}
|
||||
|
||||
snippet try try ... catch
|
||||
try
|
||||
${1}
|
||||
catch ${2:err}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet switch switch
|
||||
switch ${1:n}
|
||||
case ${2:0}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet @ anonymous function
|
||||
@(${1:x}) ${0:x*x}
|
||||
|
||||
snippet cl class
|
||||
classdef ${1:`vim_snippets#Filename("$1", "class_name")`}
|
||||
properties
|
||||
${2}
|
||||
end
|
||||
methods
|
||||
${0}
|
||||
end
|
||||
end
|
@ -94,9 +94,9 @@ snippet E
|
||||
$_ENV['${1:variable}']
|
||||
snippet F
|
||||
$_FILES['${1:variable}']
|
||||
snippet G
|
||||
snippet G "_GET array"
|
||||
$_GET['${1:variable}']
|
||||
snippet P
|
||||
snippet P "_POST array"
|
||||
$_POST['${1:variable}']
|
||||
snippet R
|
||||
$_REQUEST['${1:variable}']
|
||||
|
@ -142,21 +142,6 @@ snippet mod module .. end
|
||||
module ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
${0}
|
||||
end
|
||||
snippet mod module .. ClassMethods .. end
|
||||
module ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
|
||||
module ClassMethods
|
||||
${0}
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
|
||||
end
|
||||
|
||||
def self.included(receiver)
|
||||
receiver.extend ClassMethods
|
||||
receiver.send :include, InstanceMethods
|
||||
end
|
||||
end
|
||||
# attr_reader
|
||||
snippet r
|
||||
attr_reader :${0:attr_names}
|
||||
|
@ -142,7 +142,7 @@ snippet stn "Struct with new constructor"
|
||||
}
|
||||
|
||||
impl $1 {
|
||||
pub fn new(${2}) -> $1 {
|
||||
pub fn new(${2}) -> Self {
|
||||
$1 { ${3} }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,7 @@
|
||||
# snippets for making snippets :)
|
||||
snippet snip
|
||||
snippet ${1:trigger}
|
||||
${0}
|
||||
snippet msnip
|
||||
snippet ${1:trigger} ${2:description}
|
||||
${0}
|
||||
snippet ${1:trigger} "${2:description}"
|
||||
${0:${VISUAL}}
|
||||
snippet v
|
||||
{VISUAL}
|
||||
snippet $
|
||||
|
Reference in New Issue
Block a user