about summary refs log tree commit diff
path: root/configs/shared/emacs/.emacs.d/snippets
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2018-09-10T18·51-0400
committerWilliam Carroll <wpcarro@gmail.com>2018-09-10T18·53-0400
commit17ee0e400bef47c371afcae76037f9ea6a44ad13 (patch)
tree0e5efee6f00e402890e91f3eceb4b29408a498b6 /configs/shared/emacs/.emacs.d/snippets
parent8b2fadf4776b7ddb4a67b4bc8ff6463770e56028 (diff)
Support Vim, Tmux, Emacs with Stow
After moving off of Meta, Dotfiles has a greater responsibility to
manage configs. Vim, Tmux, and Emacs are now within Stow's purview.
Diffstat (limited to 'configs/shared/emacs/.emacs.d/snippets')
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/emacs-lisp-mode/elisp-module-docs11
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/emacs-lisp-mode/provide-footer6
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/haskell-mode/derive-safe-copy5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/haskell-mode/import-qualified5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/haskell-mode/instance-defn6
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/haskell-mode/language-extension5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/haskell-mode/separator5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/haskell-mode/undefined5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/org-mode/code-snippet7
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/org-mode/href5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/action-extractor5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/console-log5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/const-defn5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/const-function7
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/destructure-const5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow-function7
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-destructured5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-react5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-type5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-x-from-y5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-y5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/jest-describe-test10
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/jest-test7
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/react-class-component11
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/redux-action5
-rw-r--r--configs/shared/emacs/.emacs.d/snippets/rjsx-mode/typed-redux-action5
27 files changed, 162 insertions, 0 deletions
diff --git a/configs/shared/emacs/.emacs.d/snippets/emacs-lisp-mode/elisp-module-docs b/configs/shared/emacs/.emacs.d/snippets/emacs-lisp-mode/elisp-module-docs
new file mode 100644
index 000000000000..8ea7b8f07724
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/emacs-lisp-mode/elisp-module-docs
@@ -0,0 +1,11 @@
+# -*- mode: snippet -*-
+# name: Elisp module docs
+# key: emd
+# --
+;;; `(-> (buffer-file-name) f-filename)` --- $2 -*- lexical-binding: t -*-
+;; Author: William Carroll <wpcarro@gmail.com>
+
+;;; Commentary:
+;; $3
+
+;;; Code:
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/emacs-lisp-mode/provide-footer b/configs/shared/emacs/.emacs.d/snippets/emacs-lisp-mode/provide-footer
new file mode 100644
index 000000000000..2a0bcc33f7bb
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/emacs-lisp-mode/provide-footer
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: Provide footer
+# key: elf
+# --
+(provide '`(-> (buffer-file-name) f-filename f-no-ext)`)
+;;; `(-> (buffer-file-name) f-filename)` ends here
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/haskell-mode/derive-safe-copy b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/derive-safe-copy
new file mode 100644
index 000000000000..95f7d9deecd0
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/derive-safe-copy
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Derive Safe Copy
+# key: dsc
+# --
+deriveSafeCopy 0 'base ''$1
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/haskell-mode/import-qualified b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/import-qualified
new file mode 100644
index 000000000000..4c4db62a8a47
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/import-qualified
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Import qualified
+# key: iq
+# --
+import qualified $1 as $2
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/haskell-mode/instance-defn b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/instance-defn
new file mode 100644
index 000000000000..10d194ce41f0
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/instance-defn
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: Instance
+# key: inst
+# --
+instance $1 where
+  $2 = $3
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/haskell-mode/language-extension b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/language-extension
new file mode 100644
index 000000000000..9d6084acb40d
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/language-extension
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: language extension
+# key: lang
+# --
+{-# LANGUAGE $1 #-}
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/haskell-mode/separator b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/separator
new file mode 100644
index 000000000000..1ab0d762b611
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/separator
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Separator
+# key: -
+# --
+--------------------------------------------------------------------------------
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/haskell-mode/undefined b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/undefined
new file mode 100644
index 000000000000..7609f801f278
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/haskell-mode/undefined
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Undefiend
+# key: nd
+# --
+undefined
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/org-mode/code-snippet b/configs/shared/emacs/.emacs.d/snippets/org-mode/code-snippet
new file mode 100644
index 000000000000..4215b15992b6
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/org-mode/code-snippet
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: Code Snippet
+# key: src
+# --
+#+BEGIN_SRC $1
+$2
+#+END_SRC
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/org-mode/href b/configs/shared/emacs/.emacs.d/snippets/org-mode/href
new file mode 100644
index 000000000000..ac65ea2e49be
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/org-mode/href
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Org mode URL
+# key: href
+# --
+[[$1][$2]]
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/action-extractor b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/action-extractor
new file mode 100644
index 000000000000..62834a29ab04
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/action-extractor
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: exactness
+# key: $x
+# --
+$Exact<$Call<typeof $1>>
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/console-log b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/console-log
new file mode 100644
index 000000000000..82ec3fd8e379
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/console-log
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Console.log helper
+# key: clg
+# --
+console.log($1)
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/const-defn b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/const-defn
new file mode 100644
index 000000000000..8e35e61fc2c4
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/const-defn
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: const definition
+# key: cn
+# --
+const $1 = '$2'
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/const-function b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/const-function
new file mode 100644
index 000000000000..13f2018f2269
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/const-function
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: const function
+# key: cfn
+# --
+const $1 = ($2) => {
+  $3
+}
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/destructure-const b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/destructure-const
new file mode 100644
index 000000000000..2a52c57c75cd
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/destructure-const
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Destructuring a const
+# key: cds
+# --
+const { $1 } = $2
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow
new file mode 100644
index 000000000000..187a2efc5a7c
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Fat arrow function
+# key: fa
+# --
+=>
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow-function b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow-function
new file mode 100644
index 000000000000..694914a83c95
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow-function
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: Fat arrow function
+# key: faf
+# --
+() => {
+  $1
+}
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-destructured b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-destructured
new file mode 100644
index 000000000000..ded3ce163a93
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-destructured
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Import destructured
+# key: ids
+# --
+import { $1 } from '$2'
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-react b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-react
new file mode 100644
index 000000000000..0463f5cd5593
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-react
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Import React dependency (ES6)
+# key: ir
+# --
+import React from 'react'
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-type b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-type
new file mode 100644
index 000000000000..fcd51f687b61
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-type
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: import type
+# key: ixt
+# --
+import type { $1 } from '$2'
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-x-from-y b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-x-from-y
new file mode 100644
index 000000000000..09fa6df50506
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-x-from-y
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: import x from y
+# key: ix
+# --
+import $1 from '$2'
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-y b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-y
new file mode 100644
index 000000000000..9f550e300d12
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/import-y
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: import y
+# key: iy
+# --
+import '$1'
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/jest-describe-test b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/jest-describe-test
new file mode 100644
index 000000000000..ed382d4f74c4
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/jest-describe-test
@@ -0,0 +1,10 @@
+# -*- mode: snippet -*-
+# name: Jest describe/test block
+# key: dsc
+# --
+describe('$1', () => {
+  test('$2', () => {
+
+    expect($3).toEqual($4)
+  })
+})
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/jest-test b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/jest-test
new file mode 100644
index 000000000000..12ca2e786ded
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/jest-test
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: Jest / Jasmine test
+# key: tst
+# --
+test('$1', () => {
+  expect($2).toBe($3)
+})
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/react-class-component b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/react-class-component
new file mode 100644
index 000000000000..f2a93a31d96d
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/react-class-component
@@ -0,0 +1,11 @@
+# -*- mode: snippet -*-
+# name: React class extends
+# key: clz
+# --
+class $1 extends React.Component {
+  render() {
+    $2
+  }
+}
+
+export default $1
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/redux-action b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/redux-action
new file mode 100644
index 000000000000..d196f8ee809f
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/redux-action
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: redux-action
+# key: rax
+# --
+export const ${1:$$(lower->caps yas-text)} = '`(downcase (buffer-dirname))`/${1:$(caps->kebab yas-text)}'
\ No newline at end of file
diff --git a/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/typed-redux-action b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/typed-redux-action
new file mode 100644
index 000000000000..a4ef0181cd4e
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/snippets/rjsx-mode/typed-redux-action
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: typed-redux-action
+# key: trax
+# --
+export const ${1:$$(lower->caps yas-text)}: '`(downcase (buffer-dirname))`/${1:$(caps->kebab yas-text)}' = '`(downcase (buffer-dirname))`/${1:$(caps->kebab yas-text)}'
\ No newline at end of file