add all the missing modes

This commit is contained in:
Andrea Crotti 2019-03-09 18:35:58 +00:00
parent 037b60e0df
commit a4fa2e3596
No known key found for this signature in database
GPG Key ID: 88DC3F2180C34EDB
353 changed files with 597 additions and 225 deletions

View File

@ -84,5 +84,25 @@
(hiccup/html
(structure tables)))))
(def mode-line "# -*- mode: snippet -*-")
(defn all-snips
[d]
(filter #(and (.isFile %)
(not= (.getName %) ".yas-parents")
(not (.endsWith (str %) ".el")))
(file-seq (io/file d))))
(defn fix-all-modelines
[snips]
(doseq [s snips]
(let [content (-> s slurp str/split-lines)
f-line (first content)]
(when-not (str/includes? f-line "# -*- mode")
(println "Writing to " s)
(spit s (str/join "\n" (cons mode-line content)))))))
(comment
(gen-html "../snippets"))

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: namespace ...
# key: ns
# --

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: using namespace ...
# key: using
# --

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: #ifndef XXX; #define XXX; #endif
# key: once
# --

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: do { ... } while (...)
# key: do
# --

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: struct ... { ... }
# key: struct
# --

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: bench
# key: bench
# --

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# name: bp
# key: bp
# --
(swank.core/break)
(swank.core/break)

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# name: def
# key: def
# --
(def $0)
(def $0)

View File

@ -1,7 +1,8 @@
# -*- mode: snippet -*-
# name: defmacro
# key: defm
# --
(defmacro $1
"$2"$>
[$3]$>
$0)$>
$0)$>

View File

@ -1,7 +1,8 @@
# -*- mode: snippet -*-
# name: defn
# key: defn
# --
(defn $1
"$2"$>
[$3]$>
$0)$>
$0)$>

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: defrecord
# key: defr
# --
@ -5,4 +6,4 @@
^{"$1"}$>
$2$>
[$3]$>
$0)$>
$0)$>

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: deftype
# key: deft
# --

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: doseq
# key: doseq
# --

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# name: fn
# key: fn
# --
(fn [$1]
$0)$>
$0)$>

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# name: for
# key: for
# --
(for [$1 $2]
$3)$>
$3)$>

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: if
# key: if
@ -5,4 +6,4 @@
(if $1
$2$>
$3)$>
$0
$0

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: ifl
# key: ifl

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: import
# key: import
# expand-env: ((yas-triggers-in-field nil))

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: is
# key: is
# --
(is (= $1 $2))
(is (= $1 $2))

View File

@ -1,7 +1,8 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: let
# key: let
# --
(let [$1 $2]$>
$3)$>
$0
$0

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: map
# key: map

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: map lambda
# key: map

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: mdoc
# key: mdoc

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: ns
# key: ns
@ -19,4 +20,4 @@
(p4 (mapconcat '(lambda (x) x)
(split-string p3 "/")
".")))
(replace-regexp-in-string "_" "-" p4)))`)
(replace-regexp-in-string "_" "-" p4)))`)

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# key: opts
# name: opts
# --

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: pr
# key: pr

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: print
# key: print

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: reduce
# key: reduce
# --
(reduce ${1:(fn [p n] $0)} $2)
(reduce ${1:(fn [p n] $0)} $2)

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# name: require
# key: require
# expand-env: ((yas-triggers-in-field nil))
# --
(:require [$1 :as $2])$>
(:require [$1 :as $2])$>

View File

@ -1,6 +1,7 @@
# -*- mode: snippet -*-
# name: test
# key: test
# --
(deftest $1
(is (= $2))$>
$0)$>
$0)$>

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: try
# key: try
# --

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: use
# key: use
# expand-env: ((yas-triggers-in-field nil))

View File

@ -1,7 +1,8 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: when
# key: when
# --
(when $1
$2)$>
$0$>
$0$>

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# -*- coding: utf-8 -*-
# name: whenl
# key: whenl

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: private attribute ....;
# key: attrib

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: private attribute ....; public property ... ... { ... }
# key: attrib
@ -19,4 +20,4 @@ public $1 $2
set {
this.$2 = value;
}
}
}

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: private _attribute ....; public Property ... ... { ... }
# key: attrib
@ -19,4 +20,4 @@ public ${1:Type} ${2:Name}
set {
this.${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")} = value;
}
}
}

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: class ... { ... }
# key: class

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: /// <summary> ... </summary>
# key: comment

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: /// <param name="..."> ... </param>
# key: comment
# --
/// <param name="$1">$2</param>
/// <param name="$1">$2</param>

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: /// <param name="..."> ... </param>
# key: comment
# --
/// <returns>$1</returns>
/// <returns>$1</returns>

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: /// <exception cref="..."> ... </exception>
# key: comment
# --
/// <exception cref="$1">$2</exception>
/// <exception cref="$1">$2</exception>

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Jostein Kjønigsen <jostein@kjonigsen.net>
# name: foreach { ... }
# key: fore

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: public void Method { ... }
# key: method

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: namespace .. { ... }
# key: namespace
@ -5,4 +6,4 @@
namespace $1
{
$0
}
}

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: property ... ... { ... }
# key: prop

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: #region ... #endregion
# key: region

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: using ...;
# key: using

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: using System;
# key: using
# --
using System;
using System;

View File

@ -1,5 +1,6 @@
# -*- mode: snippet -*-
# contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx>
# name: using System....;
# key: using
# --
using System.$1;
using System.$1;

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: background-color: ...
# --
background-color: #${1:DDD};

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: background-image: ...
# --
background-image: url($1);
background-image: url($1);

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# name: border size style color
# --
border: ${1:1px} ${2:solid} #${3:999};

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: clear: ...
# --
clear: $1;
clear: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: display: block
# --
display: block;
display: block;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: display: inline
# --
display: inline;
display: inline;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: display: none
# --
display: none;
display: none;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: font-family: ...
# --
font-family: $1;
font-family: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: font-size: ...
# --
font-size: ${12px};
font-size: ${12px};

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: margin-bottom: ...
# --
margin-bottom: $1;
margin-bottom: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: margin-left: ...
# --
margin-left: $1;
margin-left: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: margin: ...
# --
margin: $1;
margin: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: margin top right bottom left
# --
margin: ${top} ${right} ${bottom} ${left};
margin: ${top} ${right} ${bottom} ${left};

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: margin-right: ...
# --
margin-right: $1;
margin-right: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: margin-top: ...
# --
margin-top: $1;
margin-top: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: padding-bottom: ...
# --
padding-bottom: $1;
padding-bottom: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: padding-left: ...
# --
padding-left: $1;
padding-left: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: padding: ...
# --
padding: $1;
padding: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: padding: top right bottom left
# --
padding: ${top} ${right} ${bottom} ${left};
padding: ${top} ${right} ${bottom} ${left};

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: padding-right: ...
# --
padding-right: $1;
padding-right: $1;

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# contributor : rejeep <johan.rejeep@gmail.com>
# name: padding-top: ...
# --
padding-top: $1;
padding-top: $1;

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
-*- coding: utf-8 -*-
Originally started by Xah Lee (xahlee.org) on 2009-02-22
Released under GPL 3.

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: and
# key: and

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: aref
# key: aref

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: aset
# key: aset

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: assq
# key: assq

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: autoload
# key: autoload

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: backward-char
# key: backward-char

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: beginning-of-line
# key: beginning-of-line

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: bounds-of-thing-at-point
# key: bounds-of-thing-at-point

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: buffer-file-name
# key: buffer-file-name

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: buffer-modified-p
# key: buffer-modified-p

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: buffer-substring
# key: buffer-substring

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: buffer-substring-no-properties
# key: buffer-substring-no-properties

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: cond
# key: cond

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: condition-case
# key: condition-case

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: copy-directory
# key: copy-directory

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: copy-file
# key: copy-file

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: current-buffer
# key: current-buffer

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: custom-autoload
# key: custom-autoload

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: defalias
# key: defalias

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: defcustom
# key: defcustom

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: define-key
# key: define-key

View File

@ -1,4 +1,5 @@
# -*- mode: snippet -*-
# name: defvar
# key: defvar
# --
(defvar ${1:symbol} ${2:initvalue} "${3:docstring}")
(defvar ${1:symbol} ${2:initvalue} "${3:docstring}")

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: delete-char
# key: delete-char

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: delete-directory
# key: delete-directory

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: delete-file
# key: delete-file

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: delete-region
# key: delete-region

View File

@ -1,3 +1,4 @@
# -*- mode: snippet -*-
# contributor: Xah Lee (XahLee.org)
# name: directory-files
# key: directory-files

Some files were not shown because too many files have changed in this diff Show More