summaryrefslogtreecommitdiff
path: root/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'snippets')
-rw-r--r--snippets/.dir-locals.el1
-rw-r--r--snippets/ess-mode/datatable2
-rw-r--r--snippets/ess-mode/dplyr2
-rw-r--r--snippets/ess-mode/ggplot22
-rw-r--r--snippets/ess-mode/lme42
-rw-r--r--snippets/ess-mode/rscript-shebang2
-rw-r--r--snippets/python-mode/defaultdict2
-rw-r--r--snippets/python-mode/docopt2
-rw-r--r--snippets/python-mode/docopt-args2
-rw-r--r--snippets/python-mode/examples-header2
-rw-r--r--snippets/python-mode/figax2
-rw-r--r--snippets/python-mode/figaxs2
-rw-r--r--snippets/python-mode/h5py2
-rw-r--r--snippets/python-mode/mock2
-rw-r--r--snippets/python-mode/mpi4py2
-rw-r--r--snippets/python-mode/numpy-random-seed2
-rw-r--r--snippets/python-mode/numpy-testing2
-rw-r--r--snippets/python-mode/ordereddict7
-rw-r--r--snippets/python-mode/pandas2
-rw-r--r--snippets/python-mode/pandas-hdf-store6
-rw-r--r--snippets/python-mode/parameters-header2
-rw-r--r--snippets/python-mode/pdb-set-trace2
-rw-r--r--snippets/python-mode/plotting-imports2
-rw-r--r--snippets/python-mode/pprint2
-rw-r--r--snippets/python-mode/pymc2
-rw-r--r--snippets/python-mode/pymc-file2
-rw-r--r--snippets/python-mode/pyplot2
-rw-r--r--snippets/python-mode/pytest2
-rw-r--r--snippets/python-mode/python-shebang2
-rw-r--r--snippets/python-mode/returns-header2
-rw-r--r--snippets/python-mode/seaborn2
-rw-r--r--snippets/python-mode/theano2
-rw-r--r--snippets/python-mode/try-argv10
-rw-r--r--snippets/sh-mode/bash-shebang2
-rw-r--r--snippets/snakemake-mode/cdrun2
-rw-r--r--snippets/snakemake-mode/rule2
-rw-r--r--snippets/text-mode/cdate2
-rw-r--r--snippets/text-mode/date2
-rw-r--r--snippets/text-mode/fname2
-rw-r--r--snippets/text-mode/random-num2
40 files changed, 60 insertions, 36 deletions
diff --git a/snippets/.dir-locals.el b/snippets/.dir-locals.el
new file mode 100644
index 0000000..21bdffe
--- /dev/null
+++ b/snippets/.dir-locals.el
@@ -0,0 +1 @@
+((snippet-mode . ((require-final-newline . nil))))
diff --git a/snippets/ess-mode/datatable b/snippets/ess-mode/datatable
index 86911e9..a77253b 100644
--- a/snippets/ess-mode/datatable
+++ b/snippets/ess-mode/datatable
@@ -4,4 +4,4 @@
# group: imports
# --
library(data.table)
-$0
+$0 \ No newline at end of file
diff --git a/snippets/ess-mode/dplyr b/snippets/ess-mode/dplyr
index f21bc00..1c5024d 100644
--- a/snippets/ess-mode/dplyr
+++ b/snippets/ess-mode/dplyr
@@ -4,4 +4,4 @@
# group: imports
# --
library(dplyr)
-$0
+$0 \ No newline at end of file
diff --git a/snippets/ess-mode/ggplot2 b/snippets/ess-mode/ggplot2
index 5646e31..55a5bc6 100644
--- a/snippets/ess-mode/ggplot2
+++ b/snippets/ess-mode/ggplot2
@@ -4,4 +4,4 @@
# group: imports
# --
library(ggplot2)
-$0
+$0 \ No newline at end of file
diff --git a/snippets/ess-mode/lme4 b/snippets/ess-mode/lme4
index 47cf0b3..2a54c58 100644
--- a/snippets/ess-mode/lme4
+++ b/snippets/ess-mode/lme4
@@ -4,4 +4,4 @@
# group: imports
# --
library(lme4)
-$0
+$0 \ No newline at end of file
diff --git a/snippets/ess-mode/rscript-shebang b/snippets/ess-mode/rscript-shebang
index 4f49f3b..7b47645 100644
--- a/snippets/ess-mode/rscript-shebang
+++ b/snippets/ess-mode/rscript-shebang
@@ -3,4 +3,4 @@
# key: sb
# --
#!/usr/bin/env Rscript
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/defaultdict b/snippets/python-mode/defaultdict
index 3633383..35a381c 100644
--- a/snippets/python-mode/defaultdict
+++ b/snippets/python-mode/defaultdict
@@ -4,4 +4,4 @@
# group: imports
# --
from collections import defaultdict
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/docopt b/snippets/python-mode/docopt
index 33bed9f..71e98ed 100644
--- a/snippets/python-mode/docopt
+++ b/snippets/python-mode/docopt
@@ -3,4 +3,4 @@
# group: imports
# --
from docopt import docopt
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/docopt-args b/snippets/python-mode/docopt-args
index c9f2e98..0743633 100644
--- a/snippets/python-mode/docopt-args
+++ b/snippets/python-mode/docopt-args
@@ -3,4 +3,4 @@
# key: da
# --
args = docopt(__doc__)
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/examples-header b/snippets/python-mode/examples-header
index 581b1dc..339a1be 100644
--- a/snippets/python-mode/examples-header
+++ b/snippets/python-mode/examples-header
@@ -4,4 +4,4 @@
# --
Examples
--------
-$0
+ $0 \ No newline at end of file
diff --git a/snippets/python-mode/figax b/snippets/python-mode/figax
index 2e149bc..65d4ce8 100644
--- a/snippets/python-mode/figax
+++ b/snippets/python-mode/figax
@@ -3,4 +3,4 @@
# key: fax
# --
fig, ax = plt.subplots()
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/figaxs b/snippets/python-mode/figaxs
index a9117ca..7e99635 100644
--- a/snippets/python-mode/figaxs
+++ b/snippets/python-mode/figaxs
@@ -2,4 +2,4 @@
# name: figaxs
# key: faxs
# --
-fig, axs = plt.subplots($0)
+fig, axs = plt.subplots($0) \ No newline at end of file
diff --git a/snippets/python-mode/h5py b/snippets/python-mode/h5py
index 6bea2df..3eb0ceb 100644
--- a/snippets/python-mode/h5py
+++ b/snippets/python-mode/h5py
@@ -4,4 +4,4 @@
# group: imports
# --
import h5py
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/mock b/snippets/python-mode/mock
index 5c122aa..5d8d1f8 100644
--- a/snippets/python-mode/mock
+++ b/snippets/python-mode/mock
@@ -3,4 +3,4 @@
# group: imports
# --
from unittest import mock
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/mpi4py b/snippets/python-mode/mpi4py
index 80bd6b3..6b77ddc 100644
--- a/snippets/python-mode/mpi4py
+++ b/snippets/python-mode/mpi4py
@@ -4,4 +4,4 @@
# group: imports
# --
from mpi4py import MPI
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/numpy-random-seed b/snippets/python-mode/numpy-random-seed
index 6022be3..b8db465 100644
--- a/snippets/python-mode/numpy-random-seed
+++ b/snippets/python-mode/numpy-random-seed
@@ -3,4 +3,4 @@
# key: nrs
# --
np.random.seed(`(random 4294967295)`)
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/numpy-testing b/snippets/python-mode/numpy-testing
index fbfb238..c84868d 100644
--- a/snippets/python-mode/numpy-testing
+++ b/snippets/python-mode/numpy-testing
@@ -4,4 +4,4 @@
# group: imports
# --
import numpy.testing as npt
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/ordereddict b/snippets/python-mode/ordereddict
new file mode 100644
index 0000000..e49e377
--- /dev/null
+++ b/snippets/python-mode/ordereddict
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: ordereddict
+# key: od
+# group: imports
+# --
+from collections import OrderedDict
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/pandas b/snippets/python-mode/pandas
index b20e0dd..7239528 100644
--- a/snippets/python-mode/pandas
+++ b/snippets/python-mode/pandas
@@ -4,4 +4,4 @@
# group: imports
# --
import pandas as pd
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/pandas-hdf-store b/snippets/python-mode/pandas-hdf-store
new file mode 100644
index 0000000..a19ab13
--- /dev/null
+++ b/snippets/python-mode/pandas-hdf-store
@@ -0,0 +1,6 @@
+# -*- mode: snippet -*-
+# name: Pandas HDF5 store
+# key: pdhs
+# --
+with pd.HDFStore($1) as store:
+ $0 \ No newline at end of file
diff --git a/snippets/python-mode/parameters-header b/snippets/python-mode/parameters-header
index 74311d1..90d26ca 100644
--- a/snippets/python-mode/parameters-header
+++ b/snippets/python-mode/parameters-header
@@ -4,4 +4,4 @@
# --
Parameters
----------
-$0
+ $0 \ No newline at end of file
diff --git a/snippets/python-mode/pdb-set-trace b/snippets/python-mode/pdb-set-trace
index 6f41e0e..c4cb5de 100644
--- a/snippets/python-mode/pdb-set-trace
+++ b/snippets/python-mode/pdb-set-trace
@@ -1,4 +1,4 @@
# -*- mode: snippet -*-
# key: pst
# --
-import pdb; pdb.set_trace()$0
+import pdb; pdb.set_trace()$0 \ No newline at end of file
diff --git a/snippets/python-mode/plotting-imports b/snippets/python-mode/plotting-imports
index 46b986d..2900948 100644
--- a/snippets/python-mode/plotting-imports
+++ b/snippets/python-mode/plotting-imports
@@ -6,4 +6,4 @@
import matplotlib.pyplot as plt
import mplutil
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/pprint b/snippets/python-mode/pprint
index cb8a7a6..0c09793 100644
--- a/snippets/python-mode/pprint
+++ b/snippets/python-mode/pprint
@@ -4,4 +4,4 @@
# group: imports
# --
from pprint import pprint
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/pymc b/snippets/python-mode/pymc
index 1fc9900..9bcd56c 100644
--- a/snippets/python-mode/pymc
+++ b/snippets/python-mode/pymc
@@ -3,4 +3,4 @@
# group: imports
# --
import pymc3 as pm
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/pymc-file b/snippets/python-mode/pymc-file
index 0425445..1cae0cd 100644
--- a/snippets/python-mode/pymc-file
+++ b/snippets/python-mode/pymc-file
@@ -13,4 +13,4 @@ if __name__ == '__main__':
start = {}
trace = pm.sample(1000,
step=pm.NUTS(model.vars),
- start=start)
+ start=start) \ No newline at end of file
diff --git a/snippets/python-mode/pyplot b/snippets/python-mode/pyplot
index 24f541b..608b77f 100644
--- a/snippets/python-mode/pyplot
+++ b/snippets/python-mode/pyplot
@@ -4,4 +4,4 @@
# group: imports
# --
import matplotlib.pyplot as plt
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/pytest b/snippets/python-mode/pytest
index 0f5a0ab..e81d0a9 100644
--- a/snippets/python-mode/pytest
+++ b/snippets/python-mode/pytest
@@ -4,4 +4,4 @@
# group: imports
# --
import pytest
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/python-shebang b/snippets/python-mode/python-shebang
index 3d4d9a3..fdacfed 100644
--- a/snippets/python-mode/python-shebang
+++ b/snippets/python-mode/python-shebang
@@ -3,4 +3,4 @@
# key: sb
# --
#!/usr/bin/env python${1:3}
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/returns-header b/snippets/python-mode/returns-header
index 713f69b..b84bb21 100644
--- a/snippets/python-mode/returns-header
+++ b/snippets/python-mode/returns-header
@@ -4,4 +4,4 @@
# --
Returns
-------
-$0
+ $0 \ No newline at end of file
diff --git a/snippets/python-mode/seaborn b/snippets/python-mode/seaborn
index 14710e8..bfa54da 100644
--- a/snippets/python-mode/seaborn
+++ b/snippets/python-mode/seaborn
@@ -4,4 +4,4 @@
# group: imports
# --
import seaborn as sns
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/theano b/snippets/python-mode/theano
index f7d31c9..c3a3375 100644
--- a/snippets/python-mode/theano
+++ b/snippets/python-mode/theano
@@ -4,4 +4,4 @@
# group: imports
# --
import theano.tensor as tn
-$0
+$0 \ No newline at end of file
diff --git a/snippets/python-mode/try-argv b/snippets/python-mode/try-argv
new file mode 100644
index 0000000..5b515ad
--- /dev/null
+++ b/snippets/python-mode/try-argv
@@ -0,0 +1,10 @@
+# -*- mode: snippet -*-
+# name: try argv
+# key: targv
+# --
+try:
+ _, $1 = sys.argv
+except ValueError:
+ sys.exit(__doc__)
+
+$0 \ No newline at end of file
diff --git a/snippets/sh-mode/bash-shebang b/snippets/sh-mode/bash-shebang
index 925e0c0..fb377d5 100644
--- a/snippets/sh-mode/bash-shebang
+++ b/snippets/sh-mode/bash-shebang
@@ -3,4 +3,4 @@
# key: sb
# --
#!/usr/bin/env bash
-$0
+$0 \ No newline at end of file
diff --git a/snippets/snakemake-mode/cdrun b/snippets/snakemake-mode/cdrun
index 191cbb3..6715cf5 100644
--- a/snippets/snakemake-mode/cdrun
+++ b/snippets/snakemake-mode/cdrun
@@ -2,4 +2,4 @@
# name: cdrun
# key: cd
# --
-'cd $(dirname {${1:input[0]}}) && ./$(basename {$1})'
+'cd $(dirname {${1:input[0]}}) && ./$(basename {$1})' \ No newline at end of file
diff --git a/snippets/snakemake-mode/rule b/snippets/snakemake-mode/rule
index 249e83e..8d6204f 100644
--- a/snippets/snakemake-mode/rule
+++ b/snippets/snakemake-mode/rule
@@ -6,4 +6,4 @@
rule $0:
input:
output:
- shell:
+ shell: \ No newline at end of file
diff --git a/snippets/text-mode/cdate b/snippets/text-mode/cdate
index ad32367..84cd077 100644
--- a/snippets/text-mode/cdate
+++ b/snippets/text-mode/cdate
@@ -1,4 +1,4 @@
# -*- mode: snippet -*-
# key: cdate
# --
-`(yas-with-comment (concat " " (format-time-string "%Y-%m-%d")))`
+`(yas-with-comment (concat " " (format-time-string "%Y-%m-%d")))` \ No newline at end of file
diff --git a/snippets/text-mode/date b/snippets/text-mode/date
index 8bc5ce1..14ee4ec 100644
--- a/snippets/text-mode/date
+++ b/snippets/text-mode/date
@@ -1,4 +1,4 @@
# -*- mode: snippet -*-
# key: date
# --
-`(format-time-string "%Y-%m-%d")`$0
+`(format-time-string "%Y-%m-%d")`$0 \ No newline at end of file
diff --git a/snippets/text-mode/fname b/snippets/text-mode/fname
index 40a8f2f..e5ca8ad 100644
--- a/snippets/text-mode/fname
+++ b/snippets/text-mode/fname
@@ -1,4 +1,4 @@
# -*- mode: snippet -*-
# key: fname
# --
-`(insert (file-name-nondirectory (buffer-file-name)))` $0
+`(insert (file-name-nondirectory (buffer-file-name)))` $0 \ No newline at end of file
diff --git a/snippets/text-mode/random-num b/snippets/text-mode/random-num
index c241f4c..2ef8c60 100644
--- a/snippets/text-mode/random-num
+++ b/snippets/text-mode/random-num
@@ -2,4 +2,4 @@
# name: random number
# key: rnum
# --
-`(random 4294967295)`$0
+`(random 4294967295)`$0 \ No newline at end of file