mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-10 19:23:03 +03:00
feat(emacs): snippets
This commit is contained in:
parent
c42b693c51
commit
586d0c9cd5
7 changed files with 37 additions and 1 deletions
7
.emacs.d/snippets/latex-mode/begin
Normal file
7
.emacs.d/snippets/latex-mode/begin
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: begin
|
||||
# key: begin
|
||||
# --
|
||||
\begin{${1:environment}}
|
||||
$0
|
||||
\end{$1}
|
||||
5
.emacs.d/snippets/latex-mode/frac
Normal file
5
.emacs.d/snippets/latex-mode/frac
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: frac
|
||||
# key: frac
|
||||
# --
|
||||
\frac{$1}{$2}$0
|
||||
8
.emacs.d/snippets/python-mode/__init__-py
Normal file
8
.emacs.d/snippets/python-mode/__init__-py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# key: init
|
||||
# name: __init__-py
|
||||
# condition: (string-match-p "__init__.py" (buffer-file-name))
|
||||
# --
|
||||
${1:`(thread-last (directory-files default-directory)
|
||||
(seq-filter (lambda (s) (string-match-p (rx bos (not (or ?_ ?# ?.)) (* nonl) ".py" eos) s)))
|
||||
(mapcar (lambda (s) (format "from .%s import *" (substring s 0 (- (length s) 3)))))
|
||||
(funcall (lambda (ss) (string-join ss "\n"))))`}
|
||||
5
.emacs.d/snippets/python-mode/ipdb
Normal file
5
.emacs.d/snippets/python-mode/ipdb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: ipdb
|
||||
# key: ipdb
|
||||
# --
|
||||
import ipdb; ipdb.set_trace()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# key: prs
|
||||
# name: private-service
|
||||
# --
|
||||
private ${1:service}Service: ${1:$(capitalize yas-text)}Service$0
|
||||
private ${1:service}Service: ${1:$(format "%s%s" (capitalize (substring yas-text 0 1)) (substring yas-text 1))}Service$0
|
||||
7
.emacs.d/snippets/typescript-mode/transaction
Normal file
7
.emacs.d/snippets/typescript-mode/transaction
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: transaction
|
||||
# key: tran
|
||||
# --
|
||||
await this.sequelize.transaction(async (t) => {
|
||||
$0
|
||||
});
|
||||
4
.emacs.d/snippets/typescript-mode/transaction -
Normal file
4
.emacs.d/snippets/typescript-mode/transaction -
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# key: tt
|
||||
# name: transaction -
|
||||
# --
|
||||
{ transaction: t }$0
|
||||
Loading…
Add table
Reference in a new issue