summary refs log tree commit diff
path: root/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'snippets')
-rw-r--r--snippets/emacs-lisp-mode/defun6
-rw-r--r--snippets/emacs-lisp-mode/format5
-rw-r--r--snippets/emacs-lisp-mode/header18
-rw-r--r--snippets/go-mode/method8
-rw-r--r--snippets/go-mode/test7
-rw-r--r--snippets/go-mode/type8
-rw-r--r--snippets/markdown-mode/new-blog-entry12
-rw-r--r--snippets/org-mode/begin8
-rw-r--r--snippets/org-mode/srcsh7
-rw-r--r--snippets/python-mode/cli15
-rw-r--r--snippets/python-mode/function6
-rw-r--r--snippets/python-mode/main9
12 files changed, 109 insertions, 0 deletions
diff --git a/snippets/emacs-lisp-mode/defun b/snippets/emacs-lisp-mode/defun
new file mode 100644
index 0000000..1c1282b
--- /dev/null
+++ b/snippets/emacs-lisp-mode/defun
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: function
+# key: d
+# --
+(defun $1 ($2)
+$0)
\ No newline at end of file
diff --git a/snippets/emacs-lisp-mode/format b/snippets/emacs-lisp-mode/format
new file mode 100644
index 0000000..2bd648f
--- /dev/null
+++ b/snippets/emacs-lisp-mode/format
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: format
+# key: f
+# --
+(format "$1" $0)
\ No newline at end of file
diff --git a/snippets/emacs-lisp-mode/header b/snippets/emacs-lisp-mode/header
new file mode 100644
index 0000000..b868f51
--- /dev/null
+++ b/snippets/emacs-lisp-mode/header
@@ -0,0 +1,18 @@
+# -*- mode: snippet -*-
+# name: header
+# key: header
+# --
+;;; `(file-name-nondirectory (buffer-file-name))` --- ${1:summary} -*- lexical-binding: t -*-
+;; Author: Franck Cuny <franck@fcuny.net>
+
+;;; Commentary:
+
+;; ${2:commentary}
+
+;;; Code:
+
+${3:(message "Hello World!")}
+
+(provide '`(file-name-nondirectory (buffer-file-name))`)
+
+;;; `(file-name-nondirectory (buffer-file-name))` ends here
\ No newline at end of file
diff --git a/snippets/go-mode/method b/snippets/go-mode/method
new file mode 100644
index 0000000..78e61fc
--- /dev/null
+++ b/snippets/go-mode/method
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: method
+# key: method
+# --
+// $2 ${5:...}
+func (${1:recv}) ${2:name}(${3:args}) $4 {
+	$0
+}
\ No newline at end of file
diff --git a/snippets/go-mode/test b/snippets/go-mode/test
new file mode 100644
index 0000000..3140ec2
--- /dev/null
+++ b/snippets/go-mode/test
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: test
+# key: test
+# --
+func Test$1(t *testing.T) {
+	$0
+}
\ No newline at end of file
diff --git a/snippets/go-mode/type b/snippets/go-mode/type
new file mode 100644
index 0000000..d8b2004
--- /dev/null
+++ b/snippets/go-mode/type
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: type
+# key: type
+# --
+// $3
+type $1 $2 {
+	$0
+}
\ No newline at end of file
diff --git a/snippets/markdown-mode/new-blog-entry b/snippets/markdown-mode/new-blog-entry
new file mode 100644
index 0000000..ad6a53f
--- /dev/null
+++ b/snippets/markdown-mode/new-blog-entry
@@ -0,0 +1,12 @@
+# -*- mode: snippet -*-
+# name: blogtop
+# key: blogtop
+# --
+---
+title: ${1:Title}
+date: `(format-time-string "%Y-%m-%d" nil nil)`
+tags:
+  - $2
+---
+
+$0
diff --git a/snippets/org-mode/begin b/snippets/org-mode/begin
new file mode 100644
index 0000000..15d66d8
--- /dev/null
+++ b/snippets/org-mode/begin
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: begin
+# key: begin
+# uuid: begin
+# --
+#+begin_${1:type} ${2:options}
+`%`$0
+#+end_$1
diff --git a/snippets/org-mode/srcsh b/snippets/org-mode/srcsh
new file mode 100644
index 0000000..0ced1f6
--- /dev/null
+++ b/snippets/org-mode/srcsh
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: srcsh
+# key: <ssh
+# --
+#+begin_src sh
+$0
+#+end_src
\ No newline at end of file
diff --git a/snippets/python-mode/cli b/snippets/python-mode/cli
new file mode 100644
index 0000000..f5e9503
--- /dev/null
+++ b/snippets/python-mode/cli
@@ -0,0 +1,15 @@
+# -*- mode: snippet -*-
+# name: cli
+# key: cli
+# --
+import click
+
+
+@click.command()
+@click.version_option()
+def cli():
+    pass
+
+
+if __name__ == "__main__":
+    cli()
\ No newline at end of file
diff --git a/snippets/python-mode/function b/snippets/python-mode/function
new file mode 100644
index 0000000..ffde801
--- /dev/null
+++ b/snippets/python-mode/function
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: function
+# key: fn
+# --
+def $1($2):
+  $3
\ No newline at end of file
diff --git a/snippets/python-mode/main b/snippets/python-mode/main
new file mode 100644
index 0000000..b1564a8
--- /dev/null
+++ b/snippets/python-mode/main
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: main
+# key: main
+# --
+def main():
+    pass
+
+if __name__ == "__main__":
+    main()
\ No newline at end of file