mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Add explicit "# key" directive to legacy snippet collection before deprecating filenames-as-triggers
This commit is contained in:
parent
1bc5993a44
commit
f48317e7c5
@ -1,3 +1,4 @@
|
||||
#name : v.begin(), v.end()
|
||||
# key: beginend
|
||||
# --
|
||||
${1:v}.begin(), $1.end
|
@ -1,4 +1,5 @@
|
||||
#name : class ... { ... }
|
||||
# key: class
|
||||
# --
|
||||
class ${1:Name}
|
||||
{
|
||||
|
@ -1,3 +1,4 @@
|
||||
#name : namespace ...
|
||||
# key: ns
|
||||
# --
|
||||
namespace
|
@ -1,3 +1,4 @@
|
||||
#name : template <typename ...>
|
||||
# key: template
|
||||
# --
|
||||
template <typename ${T}>
|
@ -1,4 +1,5 @@
|
||||
#name : using namespace ...
|
||||
# key: using
|
||||
# --
|
||||
using namespace ${std};
|
||||
$0
|
@ -1,3 +1,4 @@
|
||||
#name : FILE *fp = fopen(..., ...);
|
||||
# key: fopen
|
||||
# --
|
||||
FILE *${fp} = fopen(${"file"}, "${r}");
|
@ -1,6 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name : printf
|
||||
# contributor : joaotavora
|
||||
# key: printf
|
||||
# --
|
||||
printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")
|
||||
}$2${1:$(if (string-match "%" text) "\);" "")}
|
@ -1,4 +1,5 @@
|
||||
#name : do { ... } while (...)
|
||||
# key: do
|
||||
# --
|
||||
do
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : for (...; ...; ...) { ... }
|
||||
# key: for
|
||||
# --
|
||||
for (${1:int i = 0}; ${2:i < N}; ${3:++i})
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : if (...) { ... }
|
||||
# key: cc-modeif
|
||||
# --
|
||||
if (${1:condition})
|
||||
{
|
||||
|
@ -1,3 +1,4 @@
|
||||
#name : #include "..."
|
||||
# key: inc
|
||||
# --
|
||||
#include "$1"
|
@ -1,3 +1,4 @@
|
||||
#name : #include <...>
|
||||
# key: inc
|
||||
# --
|
||||
#include <$1>
|
@ -1,4 +1,5 @@
|
||||
#name: int main(argc, argv) { ... }
|
||||
# key: main
|
||||
# --
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : #ifndef XXX; #define XXX; #endif
|
||||
# key: once
|
||||
# --
|
||||
#ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_}
|
||||
#define $1
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : struct ... { ... }
|
||||
# key: struct
|
||||
# --
|
||||
struct ${1:name}
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : private attribute ....;
|
||||
# key: attrib
|
||||
# --
|
||||
/// <summary>
|
||||
/// $3
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : private attribute ....; public property ... ... { ... }
|
||||
# key: attrib
|
||||
# --
|
||||
/// <summary>
|
||||
/// $3
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : private _attribute ....; public Property ... ... { ... }
|
||||
# key: attrib
|
||||
# --
|
||||
/// <summary>
|
||||
/// $3
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : class ... { ... }
|
||||
# key: class
|
||||
# --
|
||||
${5:public} class ${1:Name}
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : /// <summary> ... </summary>
|
||||
# key: comment
|
||||
# --
|
||||
/// <summary>
|
||||
/// $1
|
||||
|
@ -1,4 +1,5 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : /// <param name="..."> ... </param>
|
||||
# key: comment
|
||||
# --
|
||||
/// <param name="$1">$2</param>
|
@ -1,4 +1,5 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : /// <param name="..."> ... </param>
|
||||
# key: comment
|
||||
# --
|
||||
/// <returns>$1</returns>
|
@ -1,4 +1,5 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : /// <exception cref="..."> ... </exception>
|
||||
# key: comment
|
||||
# --
|
||||
/// <exception cref="$1">$2</exception>
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : public void Method { ... }
|
||||
# key: method
|
||||
# --
|
||||
/// <summary>
|
||||
/// ${5:Description}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : namespace .. { ... }
|
||||
# key: namespace
|
||||
# --
|
||||
namespace $1
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : property ... ... { ... }
|
||||
# key: prop
|
||||
# --
|
||||
/// <summary>
|
||||
/// $5
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : #region ... #endregion
|
||||
# key: region
|
||||
# --
|
||||
#region $1
|
||||
$0
|
||||
|
@ -1,4 +1,5 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : using ...;
|
||||
# key: using
|
||||
# --
|
||||
using $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : using System;
|
||||
# key: using
|
||||
# --
|
||||
using System;
|
@ -1,4 +1,5 @@
|
||||
#contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
|
||||
#name : using System....;
|
||||
# key: using
|
||||
# --
|
||||
using System.$1;
|
@ -1,3 +1,4 @@
|
||||
#name : background-color: ...
|
||||
# key: bg
|
||||
# --
|
||||
background-color: #${1:DDD};
|
@ -1,3 +1,4 @@
|
||||
#name : background-image: ...
|
||||
# key: bg
|
||||
# --
|
||||
background-image: url($1);
|
@ -1,3 +1,4 @@
|
||||
#name : border size style color
|
||||
# key: bor
|
||||
# --
|
||||
border: ${1:1px} ${2:solid} #${3:999};
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : clear: ...
|
||||
# key: cl
|
||||
# --
|
||||
clear: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : display: block
|
||||
# key: disp
|
||||
# --
|
||||
display: block;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : display: inline
|
||||
# key: disp
|
||||
# --
|
||||
display: inline;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : display: none
|
||||
# key: disp
|
||||
# --
|
||||
display: none;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : font-family: ...
|
||||
# key: ff
|
||||
# --
|
||||
font-family: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : font-size: ...
|
||||
# key: fs
|
||||
# --
|
||||
font-size: ${12px};
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : margin-bottom: ...
|
||||
# key: mar
|
||||
# --
|
||||
margin-bottom: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : margin-left: ...
|
||||
# key: mar
|
||||
# --
|
||||
margin-left: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : margin: ...
|
||||
# key: mar
|
||||
# --
|
||||
margin: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : margin top right bottom left
|
||||
# key: mar
|
||||
# --
|
||||
margin: ${top} ${right} ${bottom} ${left};
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : margin-right: ...
|
||||
# key: mar
|
||||
# --
|
||||
margin-right: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : margin-top: ...
|
||||
# key: mar
|
||||
# --
|
||||
margin-top: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : padding-bottom: ...
|
||||
# key: pad
|
||||
# --
|
||||
padding-bottom: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : padding-left: ...
|
||||
# key: pad
|
||||
# --
|
||||
padding-left: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : padding: ...
|
||||
# key: pad
|
||||
# --
|
||||
padding: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : padding: top right bottom left
|
||||
# key: pad
|
||||
# --
|
||||
padding: ${top} ${right} ${bottom} ${left};
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : padding-right: ...
|
||||
# key: pad
|
||||
# --
|
||||
padding-right: $1;
|
@ -1,4 +1,5 @@
|
||||
#contributor : rejeep <johan.rejeep@gmail.com>
|
||||
#name : padding-top: ...
|
||||
# key: pad
|
||||
# --
|
||||
padding-top: $1;
|
@ -1,5 +1,6 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: process marked files in dired
|
||||
# key: x-dired
|
||||
# --
|
||||
;; idiom for processing a list of files in dired's marked files
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: a function that process a file
|
||||
# key: x-file
|
||||
# --
|
||||
(defun doThisFile (fpath)
|
||||
"Process the file at path FPATH ..."
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: read lines of a file
|
||||
# key: x-file
|
||||
# --
|
||||
(defun read-lines (filePath)
|
||||
"Return a list of lines in FILEPATH."
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: find and replace on region
|
||||
# key: x-find-replace
|
||||
# --
|
||||
(defun replace-html-chars-region (start end)
|
||||
"Replace “<” to “<” and other chars in HTML.
|
||||
|
@ -1,4 +1,5 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: grab buffer substring
|
||||
# key: x-grabstring
|
||||
# --
|
||||
(setq $0 (buffer-substring-no-properties myStartPos myEndPos))
|
@ -1,4 +1,5 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: grab word under cursor
|
||||
# key: x-grabthing
|
||||
# --
|
||||
(setq $0 (thing-at-point 'symbol))
|
@ -1,5 +1,6 @@
|
||||
#name: traversing a directory
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
# key: x-traverse_dir
|
||||
# --
|
||||
;; apply a function to all files in a dir
|
||||
(require 'find-lisp)
|
||||
|
@ -1,5 +1,6 @@
|
||||
#contributor: Xah Lee (XahLee.org)
|
||||
#name: Command that works on region or word
|
||||
# key: x-word-or-region
|
||||
# --
|
||||
;; example of a command that works on current word or text selection
|
||||
(defun down-case-word-or-region ()
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : after ... ->
|
||||
# key: after
|
||||
# --
|
||||
after
|
||||
$1 -> $0
|
@ -1,4 +1,5 @@
|
||||
#name : begin ... end
|
||||
# key: begin
|
||||
# --
|
||||
begin
|
||||
$0
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : -behaviour(...).
|
||||
# key: beh
|
||||
# --
|
||||
-behaviour(${1:gen_server}).
|
||||
$0
|
@ -1,4 +1,5 @@
|
||||
#name : case ... of ... end
|
||||
# key: case
|
||||
# --
|
||||
case $1 of
|
||||
$0
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : -compile(...).
|
||||
# key: compile
|
||||
# --
|
||||
-compile([${1:export_all}]).
|
||||
$0
|
@ -1,4 +1,5 @@
|
||||
#name : -define(...,...).
|
||||
# key: def
|
||||
# --
|
||||
-define($1,$2).
|
||||
$0
|
@ -1,5 +1,6 @@
|
||||
#name : -export([]).
|
||||
#contributor : hitesh <hitesh.jasani@gmail.com>
|
||||
# key: exp
|
||||
# --
|
||||
-export([${1:start/0}]).
|
||||
$0
|
@ -1,3 +1,4 @@
|
||||
#name : fun (...) -> ... end
|
||||
# key: fun
|
||||
# --
|
||||
fun ($1) -> $0 end
|
@ -1,4 +1,5 @@
|
||||
#name : if ... -> ... ; true -> ... end
|
||||
# key: erlang-modeif
|
||||
# --
|
||||
if
|
||||
$1 -> $2;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : -ifdef(...). ... -endif.
|
||||
# key: erlang-modeifdef
|
||||
# --
|
||||
-ifdef($1).
|
||||
$0
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : -ifndef(...). ... -endif.
|
||||
# key: erlang-modeifndef
|
||||
# --
|
||||
-ifndef($1).
|
||||
$0
|
||||
|
@ -1,5 +1,6 @@
|
||||
#name : -import([]).
|
||||
#contributor : hitesh <hitesh.jasani@gmail.com>
|
||||
# key: imp
|
||||
# --
|
||||
-import(${1:lists}, [${2:map/2, sum/1}]).
|
||||
$0
|
@ -1,4 +1,5 @@
|
||||
#name : -include("...").
|
||||
# key: inc
|
||||
# --
|
||||
-include("$1").
|
||||
$0
|
@ -1,4 +1,5 @@
|
||||
#name : -include_lib("...").
|
||||
# key: inc
|
||||
# --
|
||||
-include_lib("$1").
|
||||
$0
|
@ -1,4 +1,5 @@
|
||||
#name : loop(...) -> receive _ -> loop(...) end.
|
||||
# key: loop
|
||||
# --
|
||||
${1:loop}($2) ->
|
||||
receive
|
||||
|
@ -1,5 +1,6 @@
|
||||
#name : -module().
|
||||
#contributor : hitesh <hitesh.jasani@gmail.com>
|
||||
# key: mod
|
||||
# --
|
||||
-module(${1:`(file-name-nondirectory
|
||||
(file-name-sans-extension (or (buffer-file-name) (buffer-name))))`}).
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : receive ... -> ... end
|
||||
# key: rcv
|
||||
# --
|
||||
receive
|
||||
$1 -> $0
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : receive after ... -> ... end
|
||||
# key: rcv
|
||||
# --
|
||||
receive
|
||||
after
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : -record(...,{...}).
|
||||
# key: rec
|
||||
# --
|
||||
-record($1,{$2}).
|
||||
$0
|
@ -1,4 +1,5 @@
|
||||
#name : try ... of ... catch after end
|
||||
# key: try
|
||||
# --
|
||||
try $1 of
|
||||
$0
|
||||
|
@ -1,4 +1,5 @@
|
||||
#name : -undef(...).
|
||||
# key: undef
|
||||
# --
|
||||
-undef($1).
|
||||
$0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : automatic
|
||||
# key: au
|
||||
# --
|
||||
automatic $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : block data
|
||||
# key: bd
|
||||
# --
|
||||
block data $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : continue
|
||||
# key: c
|
||||
# --
|
||||
continue $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : character
|
||||
# key: ch
|
||||
# --
|
||||
character $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : complex
|
||||
# key: cx
|
||||
# --
|
||||
complex $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : double complex
|
||||
# key: dc
|
||||
# --
|
||||
double complex $0
|
@ -1,5 +1,6 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : do while (...) end do
|
||||
# key: do
|
||||
# --
|
||||
do while (${1:condition})
|
||||
$0
|
||||
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : double precision
|
||||
# key: dp
|
||||
# --
|
||||
double precision $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : equivalence
|
||||
# key: eq
|
||||
# --
|
||||
equivalence $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : implicit byte
|
||||
# key: ib
|
||||
# --
|
||||
implicit byte $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : implicit complex
|
||||
# key: ic
|
||||
# --
|
||||
implicit complex $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : implicit character
|
||||
# key: ich
|
||||
# --
|
||||
implicit character $0
|
@ -1,5 +1,6 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : if then end if
|
||||
# key: f90-modeif
|
||||
# --
|
||||
if ( ${1:condition} ) then
|
||||
$0
|
||||
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : implicit integer
|
||||
# key: ii
|
||||
# --
|
||||
implicit integer $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : implicit logical
|
||||
# key: il
|
||||
# --
|
||||
implicit logical $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : implicit none
|
||||
# key: in
|
||||
# --
|
||||
implicit none
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : include
|
||||
# key: inc
|
||||
# --
|
||||
include $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : intrinsic
|
||||
# key: intr
|
||||
# --
|
||||
intrinsic $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : implicit real
|
||||
# key: ir
|
||||
# --
|
||||
implicit real $0
|
@ -1,4 +1,5 @@
|
||||
#contributor: Li Zhu <http://www.zhuli.name>
|
||||
#name : logical
|
||||
# key: l
|
||||
# --
|
||||
logical $0
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user