mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -5,12 +5,12 @@
|
||||
priority -50
|
||||
|
||||
snippet pat "Case:Receive:Try Clause"
|
||||
${1:pattern}${2: when ${3:guard}} ->;
|
||||
${1:pattern}${2: when ${3:guard}} ->
|
||||
${4:body}
|
||||
endsnippet
|
||||
|
||||
snippet beh "Behaviour Directive"
|
||||
-behaviour (${1:behaviour}).
|
||||
snippet beh "Behaviour Directive" b
|
||||
-behaviour(${1:behaviour}).
|
||||
endsnippet
|
||||
|
||||
snippet case "Case Expression"
|
||||
@ -20,12 +20,12 @@ case ${1:expression} of
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet def "Define Directive"
|
||||
-define (${1:macro}${2: (${3:param})}, ${4:body}).
|
||||
snippet def "Define Directive" b
|
||||
-define(${1:macro}${2: (${3:param})}, ${4:body}).
|
||||
endsnippet
|
||||
|
||||
snippet exp "Export Directive"
|
||||
-export ([${1:function}/${2:arity}]).
|
||||
snippet exp "Export Directive" b
|
||||
-export([${1:function}/${2:arity}]).
|
||||
endsnippet
|
||||
|
||||
snippet fun "Fun Expression"
|
||||
@ -36,7 +36,7 @@ end
|
||||
endsnippet
|
||||
|
||||
snippet fu "Function"
|
||||
${1:function} (${2:param})${3: when ${4:guard}} ->
|
||||
${1:function}(${2:param})${3: when ${4:guard}} ->
|
||||
${5:body}
|
||||
endsnippet
|
||||
|
||||
@ -47,24 +47,24 @@ if
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet ifdef "Ifdef Directive"
|
||||
-ifdef (${1:macro}).
|
||||
snippet ifdef "Ifdef Directive" b
|
||||
-ifdef(${1:macro}).
|
||||
endsnippet
|
||||
|
||||
snippet ifndef "Ifndef Directive"
|
||||
-ifndef (${1:macro}).
|
||||
snippet ifndef "Ifndef Directive" b
|
||||
-ifndef(${1:macro}).
|
||||
endsnippet
|
||||
|
||||
snippet imp "Import Directive"
|
||||
-import (${1:module}, [${2:function}/${3:arity}]).
|
||||
snippet imp "Import Directive" b
|
||||
-import(${1:module}, [${2:function}/${3:arity}]).
|
||||
endsnippet
|
||||
|
||||
snippet inc "Include Directive"
|
||||
-include ("${1:file}").
|
||||
snippet inc "Include Directive" b
|
||||
-include("${1:file}").
|
||||
endsnippet
|
||||
|
||||
snippet mod "Module Directive"
|
||||
-module (${1:`!p snip.rv = snip.basename or "module"`}).
|
||||
snippet mod "Module Directive" b
|
||||
-module(${1:`!p snip.rv = snip.basename or "module"`}).
|
||||
endsnippet
|
||||
|
||||
snippet rcv "Receive Expression"
|
||||
@ -77,8 +77,8 @@ ${6:after
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet rec "Record Directive"
|
||||
-record (${1:record}, {${2:field}${3: = ${4:value}}}).
|
||||
snippet rec "Record Directive" b
|
||||
-record(${1:record}, {${2:field}${3: = ${4:value}}}).
|
||||
endsnippet
|
||||
|
||||
snippet try "Try Expression"
|
||||
@ -93,8 +93,16 @@ ${13:after
|
||||
end
|
||||
endsnippet
|
||||
|
||||
snippet undef "Undef Directive"
|
||||
-undef (${1:macro}).
|
||||
snippet undef "Undef Directive" b
|
||||
-undef(${1:macro}).
|
||||
endsnippet
|
||||
|
||||
snippet || "List Comprehension"
|
||||
[${1:X} || ${2:X} <- ${3:List}${4:, gen}]
|
||||
endsnippet
|
||||
|
||||
snippet gen "Generator Expression"
|
||||
${1:X} <- ${2:List}${3:, gen}
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
||||
|
@ -17,7 +17,7 @@ snippet label_and_input
|
||||
endsnippet
|
||||
|
||||
snippet input
|
||||
<input type="${1:text}" value="${2}" name="${3}"${4: id="${5:$3}}/>${7}
|
||||
<input type="${1:text}" value="${2}" name="${3}"${4: id="${5:$3}"}/>${7}
|
||||
endsnippet
|
||||
|
||||
snippet submit
|
||||
|
@ -102,44 +102,54 @@ var_export(${1});${2}
|
||||
endsnippet
|
||||
|
||||
snippet getter "PHP Class Getter" b
|
||||
/*
|
||||
/**
|
||||
* Getter for $1
|
||||
*
|
||||
* ${2:return string}
|
||||
*/
|
||||
public function get${1/\w+\s*/\u$0/}()
|
||||
{
|
||||
return $this->$1;$2
|
||||
return $this->$1;$3
|
||||
}
|
||||
$4
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet setter "PHP Class Setter" b
|
||||
/*
|
||||
/**
|
||||
* Setter for $1
|
||||
*
|
||||
* @param ${2:string} $$1
|
||||
* @return ${3:`!p snip.rv=snip.basename`}
|
||||
*/
|
||||
public function set${1/\w+\s*/\u$0/}($$1)
|
||||
public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
|
||||
{
|
||||
$this->$1 = $$1;$3
|
||||
${4:return $this;}
|
||||
$this->$1 = $$1;$5
|
||||
${6:return $this;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet gs "PHP Class Getter Setter" b
|
||||
/*
|
||||
/**
|
||||
* Getter for $1
|
||||
*
|
||||
* return ${2:string}
|
||||
*/
|
||||
public function get${1/\w+\s*/\u$0/}()
|
||||
{
|
||||
return $this->$1;$2
|
||||
return $this->$1;$3
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Setter for $1
|
||||
*
|
||||
* @param $2 $$1
|
||||
* @return ${4:`!p snip.rv=snip.basename`}
|
||||
*/
|
||||
public function set${1/\w+\s*/\u$0/}($$1)
|
||||
public function set${1/\w+\s*/\u$0/}(${5:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
|
||||
{
|
||||
$this->$1 = $$1;$3
|
||||
${4:return $this;}
|
||||
$this->$1 = $$1;$6
|
||||
${7:return $this;}
|
||||
}
|
||||
$0
|
||||
endsnippet
|
||||
|
@ -7,33 +7,30 @@ snippet l_rsc "Laravel resource controller" b
|
||||
* \date `!v strftime('%d-%m-%y')`
|
||||
*/
|
||||
|
||||
class $1 {
|
||||
public function index() {
|
||||
${3}
|
||||
}
|
||||
|
||||
public function create() {
|
||||
class $1 extends ${3: BaseController} {
|
||||
function __construct() {
|
||||
${4}
|
||||
}
|
||||
|
||||
public function index() {
|
||||
}
|
||||
|
||||
public function create() {
|
||||
}
|
||||
|
||||
public function store($id) {
|
||||
${5}
|
||||
}
|
||||
|
||||
public function show($id) {
|
||||
${6}
|
||||
}
|
||||
|
||||
public function edit($id) {
|
||||
${7}
|
||||
}
|
||||
|
||||
public function update($id) {
|
||||
${8}
|
||||
}
|
||||
|
||||
public function destroy($id) {
|
||||
${9}
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
@ -117,7 +114,7 @@ namespace $1;
|
||||
class $2 extends \Eloquent {
|
||||
protected $table = '${4:`!p snip.rv = t[2].lower()`}';
|
||||
|
||||
public $timestamps = '${5:false}';
|
||||
public $timestamps = ${5:false};
|
||||
|
||||
protected $hidden = array(${6});
|
||||
|
||||
@ -196,7 +193,7 @@ snippet l_r "Laravel Repository" b
|
||||
/*!
|
||||
* \namespace ${1:Repositories\\${2}}
|
||||
* \class ${3:`!v expand('%:t:r')`}
|
||||
* \implements ${4:BaseRepositoryInterface}
|
||||
* \implements ${4:$3RepositoryInterface}
|
||||
*
|
||||
* \author ${5:`!v g:snips_author`}
|
||||
* \date `!v strftime('%d-%m-%y')`
|
||||
@ -204,8 +201,8 @@ snippet l_r "Laravel Repository" b
|
||||
|
||||
namespace $1;
|
||||
|
||||
class $3 extends \\$1 implements $4 {
|
||||
${6}
|
||||
class $3 extends \\${6} implements $4 {
|
||||
${7}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
@ -29,7 +29,6 @@ snippet GPL2
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet LGPL2
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
@ -47,7 +46,6 @@ snippet LGPL2
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet GPL3
|
||||
${1:one line to give the program's name and a brief description.}
|
||||
@ -65,7 +63,6 @@ snippet GPL3
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet LGPL3
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
@ -83,7 +80,6 @@ snippet LGPL3
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet AGPL3
|
||||
${1:one line to give the program's name and a brief description.}
|
||||
@ -101,7 +97,6 @@ snippet AGPL3
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${0}
|
||||
snippet GMGPL linking exception
|
||||
As a special exception, if other files instantiate generics from
|
||||
@ -140,7 +135,6 @@ snippet BSD2
|
||||
The views and conclusions contained in the software and documentation
|
||||
are those of the authors and should not be interpreted as representing
|
||||
official policies, either expressedor implied, of $2.
|
||||
|
||||
${0}
|
||||
snippet BSD3
|
||||
${1:one line to give the program's name and a brief description}
|
||||
@ -168,7 +162,6 @@ snippet BSD3
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
${0}
|
||||
snippet BSD4
|
||||
${1:one line to give the program's name and a brief description}
|
||||
@ -199,7 +192,6 @@ snippet BSD4
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
${0}
|
||||
snippet MIT
|
||||
${1:one line to give the program's name and a brief description}
|
||||
@ -222,7 +214,6 @@ snippet MIT
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
${0}
|
||||
snippet APACHE
|
||||
${1:one line to give the program's name and a brief description}
|
||||
@ -239,7 +230,6 @@ snippet APACHE
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
${0}
|
||||
snippet BEERWARE
|
||||
${1:one line to give the program's name and a brief description}
|
||||
@ -249,7 +239,6 @@ snippet BEERWARE
|
||||
$2 wrote this file. As long as you retain this notice you
|
||||
can do whatever you want with this stuff. If we meet some day, and you think
|
||||
this stuff is worth it, you can buy me a beer or coffee in return
|
||||
|
||||
${0}
|
||||
snippet WTFPL
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
@ -271,5 +260,4 @@ snippet MPL2
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
${0}
|
||||
|
@ -75,6 +75,8 @@ snippet ===
|
||||
`repeat('=', strlen(getline(line(".") - 1)) - strlen(getline('.')))`
|
||||
|
||||
${0}
|
||||
snippet -
|
||||
- ${0}
|
||||
snippet ---
|
||||
`repeat('-', strlen(getline(line(".") - 1)) - strlen(getline('.')))`
|
||||
|
||||
|
@ -90,7 +90,7 @@ snippet class
|
||||
${0}
|
||||
}
|
||||
snippet node
|
||||
node '${1:`vim_snippets#Filename('', 'fqdn')`}' {
|
||||
node "${1:`vim_snippets#Filename('', 'fqdn')`}" {
|
||||
${0}
|
||||
}
|
||||
snippet case
|
||||
@ -107,13 +107,21 @@ snippet if
|
||||
if $${1:variable} {
|
||||
${0}
|
||||
}
|
||||
snippet ifd
|
||||
if defined(${1:Resource}["${2:name}"]) {
|
||||
${0}
|
||||
}
|
||||
snippet ifnd
|
||||
if !defined(${1:Resource}["${2:name}"]) {
|
||||
${0}
|
||||
}
|
||||
snippet el
|
||||
else {
|
||||
${0}
|
||||
}
|
||||
snippet ?
|
||||
? {
|
||||
'${1}' => ${0}
|
||||
"${1}" => ${0}
|
||||
}
|
||||
#
|
||||
# blocks etc and general syntax sugar
|
||||
@ -122,98 +130,98 @@ snippet [
|
||||
snippet >
|
||||
${1} => ${0}
|
||||
snippet p:
|
||||
'puppet://puppet/${1:module name}/${0:file name}'
|
||||
"puppet://puppet/${1:module name}/${0:file name}"
|
||||
#
|
||||
# Functions
|
||||
snippet alert
|
||||
alert('${1:message}')
|
||||
alert("${1:message}")
|
||||
snippet crit
|
||||
crit('${1:message}')
|
||||
crit("${1:message}")
|
||||
snippet debug
|
||||
debug('${1:message}')
|
||||
debug("${1:message}")
|
||||
snippet defined
|
||||
defined(${1:Resource}['${2:name}'])
|
||||
defined(${1:Resource}["${2:name}"])
|
||||
snippet emerg
|
||||
emerg('${1:message}')
|
||||
emerg("${1:message}")
|
||||
snippet extlookup Simple extlookup
|
||||
extlookup('${1:variable}')
|
||||
extlookup("${1:variable}")
|
||||
snippet extlookup Extlookup with defaults
|
||||
extlookup('${1:variable}', '${2:default}')
|
||||
extlookup("${1:variable}", "${2:default}")
|
||||
snippet extlookup Extlookup with defaults and custom data file
|
||||
extlookup('${1:variable}', '${2:default}', '${3:data source}')
|
||||
extlookup("${1:variable}", "${2:default}", "${3:data source}")
|
||||
snippet fail
|
||||
fail('${1:message}')
|
||||
fail("${1:message}")
|
||||
snippet info
|
||||
info('${1:message}')
|
||||
info("${1:message}")
|
||||
snippet inline_template
|
||||
inline_template('<%= ${1} %>')
|
||||
inline_template("<%= ${1} %>")
|
||||
snippet notice
|
||||
notice('${1:message}')
|
||||
notice("${1:message}")
|
||||
snippet realize
|
||||
realize(${1:Resource}[${2:name}])
|
||||
snippet regsubst
|
||||
regsubst(${1:hay stack}, ${2:needle}, '${3:replacement}')
|
||||
regsubst(${1:hay stack}, ${2:needle}, "${3:replacement}")
|
||||
snippet inc
|
||||
include ${1:classname}
|
||||
snippet split
|
||||
split(${1:hay stack}, '${2:patten}')
|
||||
split(${1:hay stack}, "${2:patten}")
|
||||
snippet versioncmp
|
||||
versioncmp('${1:version}', '${2:version}')
|
||||
versioncmp("${1:version}", "${2:version}")
|
||||
snippet warning
|
||||
warning('${1:message}')
|
||||
warning("${1:message}")
|
||||
#
|
||||
# Types
|
||||
snippet cron
|
||||
cron { '${1:name}':
|
||||
command => '${2}',
|
||||
user => '${3:root}',
|
||||
cron { "${1:name}":
|
||||
command => "${2}",
|
||||
user => "${3:root}",
|
||||
${4} => ${0},
|
||||
}
|
||||
|
||||
snippet exec
|
||||
exec { '${1:name}':
|
||||
command => '${2:$1}',
|
||||
user => '${3:root}',
|
||||
exec { "${1:name}":
|
||||
command => "${2:$1}",
|
||||
user => "${3:root}",
|
||||
${4} => ${0},
|
||||
}
|
||||
|
||||
snippet user
|
||||
user { '${1:user}':
|
||||
user { "${1:user}":
|
||||
ensure => present,
|
||||
comment => '${2:$1}',
|
||||
comment => "${2:$1}",
|
||||
managehome => true,
|
||||
home => '${0:/home/$1}',
|
||||
home => "${0:/home/$1}",
|
||||
}
|
||||
|
||||
snippet group
|
||||
group { '${1:group}':
|
||||
group { "${1:group}":
|
||||
ensure => ${0:present},
|
||||
}
|
||||
|
||||
snippet host
|
||||
host { '${1:hostname}':
|
||||
host { "${1:hostname}":
|
||||
ip => ${0:127.0.0.1},
|
||||
}
|
||||
|
||||
snippet mailalias
|
||||
mailalias { '${1:localpart}':
|
||||
recipient => '${0:recipient}',
|
||||
mailalias { "${1:localpart}":
|
||||
recipient => "${0:recipient}",
|
||||
}
|
||||
|
||||
snippet mount
|
||||
mount { '${1:destination path}':
|
||||
mount { "${1:destination path}":
|
||||
ensure => ${2:mounted},
|
||||
device => '${0:device name or path}',
|
||||
device => "${0:device name or path}",
|
||||
}
|
||||
|
||||
snippet package
|
||||
package { '${1:package name}':
|
||||
package { "${1:package name}":
|
||||
ensure => ${0:present},
|
||||
}
|
||||
|
||||
snippet yumrepo
|
||||
yumrepo { '${1:repo name}':
|
||||
Descr => '${2:$1}',
|
||||
yumrepo { "${1:repo name}":
|
||||
Descr => "${2:$1}",
|
||||
enabled => ${0:1},
|
||||
}
|
||||
|
||||
@ -223,22 +231,39 @@ snippet define
|
||||
}
|
||||
|
||||
snippet service
|
||||
service { '${1:service}' :
|
||||
service { "${1:service}" :
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => [ Package['${2:package}'], File['${3:file}'], ],
|
||||
subscribe => [ File['${4:configfile1}'], File['${5:configfile2}'], Package['${6:package}'], ],
|
||||
require => [ Package["${2:package}"], File["${3:file}"], ],
|
||||
subscribe => [ File["${4:configfile1}"], File["${5:configfile2}"], Package["${6:package}"], ],
|
||||
}
|
||||
|
||||
snippet file
|
||||
file { '${1:filename}' :
|
||||
file { "${1:filename}" :
|
||||
ensure => ${2:present},
|
||||
owner => '${3:root}',
|
||||
group => '${4:root}',
|
||||
mode => '${5:0644}',
|
||||
source => 'puppet:///modules/${6:module}/${7:source}',
|
||||
content => template('/etc/puppet/templates/${8:template}'),
|
||||
alias => '${9:alias}',
|
||||
require => [ Package['${10:package}'], File['${11:file}'], ],
|
||||
owner => "${3:root}",
|
||||
group => "${4:root}",
|
||||
mode => "${5:0644}",
|
||||
source => "puppet:///modules/${6:module}/${7:source}",
|
||||
content => template("${8:module}/${9:template}"),
|
||||
alias => "${10:alias}",
|
||||
require => [ Package["${11:package}"], File["${12:file}"], ],
|
||||
}
|
||||
|
||||
snippet archive
|
||||
archive { "${1:filename}" :
|
||||
ensure => ${2:present},
|
||||
url => "http://${3:url}",
|
||||
extension => "${4:tgz}",
|
||||
target => "${5:target}",
|
||||
checksum => ${6:false},
|
||||
src_target => "${7:/tmp}",
|
||||
}
|
||||
|
||||
snippet firewall
|
||||
firewall { "${1:comment}" :
|
||||
proto => ${2:tcp},
|
||||
action => ${3:accept},
|
||||
port => ${4},
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,9 @@ snippet iem
|
||||
# ipython debugger (pdbbb)
|
||||
snippet pdbbb
|
||||
import pdbpp; pdbpp.set_trace()
|
||||
# remote python debugger (rpdb)
|
||||
snippet rpdb
|
||||
import rpdb; rpdb.set_trace()
|
||||
# python_prompt_toolkit
|
||||
snippet ppt
|
||||
from prompt_toolkit.contrib.repl import embed
|
||||
|
Reference in New Issue
Block a user