├── .gitignore ├── .gitmodules ├── README.md ├── README.org ├── bashrc.sh ├── emacs.res ├── emacs23.ubuntu.res ├── gcontact.rb ├── init.el ├── init ├── X.el ├── _browse-url.el ├── _cc-mode.el ├── _clojure.el ├── _ediff.el ├── _ess.el ├── _go.el ├── _helm.el ├── _js.el ├── _latex.el ├── _lua.el ├── _mmm.el ├── _nxml.el ├── _org.el ├── _paren.el ├── _py.el ├── _python.el ├── _rust.el ├── _shell.el ├── _sunrise.el ├── buffer-menu.el ├── darwin.el ├── delete.el ├── dired.el ├── fonts.el ├── grave.el ├── korean.el ├── lisp.el ├── maven.el ├── ruby.el ├── scala.el ├── vcs.el ├── window-frame.el └── wsl.el ├── init_bash.sh ├── license ├── APACHE-2.0 ├── BOOST ├── BSD ├── BSD-new ├── BSD-old ├── FREEBSD ├── GPL-2.0 ├── GPL-3.0 ├── LGPL ├── MIT ├── MPL-2.0 └── WTFPL ├── local └── .gitkeep ├── open.sh ├── scala.etags ├── schema ├── 1.rnc ├── 2.rnc ├── 3.rnc ├── 4.rnc ├── 5.rnc ├── 6.rnc ├── 7.rnc ├── 8.rnc ├── 9.rnc ├── README.md ├── index.txt ├── maven.rnc ├── relaxng ├── schemas-html5.xml └── schemas.xml ├── snippets ├── c++-mode │ ├── .yas-parents │ ├── beginend │ ├── class │ ├── ns │ ├── template │ └── using ├── c-mode │ └── .yas-parents ├── cc-mode │ ├── .yas-parents │ ├── do │ ├── fopen │ ├── for │ ├── if │ ├── inc │ ├── inc.1 │ ├── main │ ├── once │ ├── printf │ ├── struct │ └── while ├── cperl-mode │ └── .yas-parents ├── csharp-mode │ ├── .yas-parents │ ├── attrib │ ├── attrib.1 │ ├── attrib.2 │ ├── class │ ├── comment │ ├── comment.1 │ ├── comment.2 │ ├── comment.3 │ ├── method │ ├── namespace │ ├── prop │ ├── region │ ├── using │ ├── using.1 │ └── using.2 ├── css-mode │ ├── .yas-parents │ ├── bg │ ├── bg.1 │ ├── bor │ ├── cl │ ├── disp.block │ ├── disp.inline │ ├── disp.none │ ├── ff │ ├── fs │ ├── mar.bottom │ ├── mar.left │ ├── mar.mar │ ├── mar.margin │ ├── mar.right │ ├── mar.top │ ├── pad.bottom │ ├── pad.left │ ├── pad.pad │ ├── pad.padding │ ├── pad.right │ └── pad.top ├── emacs-lisp-mode │ ├── .read_me │ ├── .yas-parents │ ├── add-hook.yasnippet │ ├── and.yasnippet │ ├── append.yasnippet │ ├── apply.yasnippet │ ├── aref.yasnippet │ ├── aset.yasnippet │ ├── assq.yasnippet │ ├── autoload.yasnippet │ ├── backward-char.yasnippet │ ├── beginning-of-line.yasnippet │ ├── bounds-of-thing-at-point.yasnippet │ ├── buffer-file-name.yasnippet │ ├── buffer-modified-p.yasnippet │ ├── buffer-substring-no-properties.yasnippet │ ├── buffer-substring.yasnippet │ ├── car.yasnippet │ ├── cdr.yasnippet │ ├── concat.yasnippet │ ├── cond.yasnippet │ ├── condition-case.yasnippet │ ├── cons.yasnippet │ ├── consp.yasnippet │ ├── copy-directory.yasnippet │ ├── copy-file.yasnippet │ ├── current-buffer.yasnippet │ ├── custom-autoload.yasnippet │ ├── defalias.yasnippet │ ├── defcustom.yasnippet │ ├── define-key.yasnippet │ ├── defsubst.yasnippet │ ├── defun.yasnippet │ ├── defvar.yasnippet │ ├── delete-char.yasnippet │ ├── delete-directory.yasnippet │ ├── delete-file.yasnippet │ ├── delete-region.yasnippet │ ├── directory-files.yasnippet │ ├── dolist.yasnippet │ ├── end-of-line.yasnippet │ ├── eq.yasnippet │ ├── equal.yasnippet │ ├── error.yasnippet │ ├── expand-file-name.yasnippet │ ├── f.yasnippet │ ├── fboundp.yasnippet │ ├── file-name-directory.yasnippet │ ├── file-name-extension.yasnippet │ ├── file-name-nondirectory.yasnippet │ ├── file-name-sans-extension.yasnippet │ ├── file-relative-name.yasnippet │ ├── find-file.yasnippet │ ├── format.yasnippet │ ├── forward-char.yasnippet │ ├── forward-line.yasnippet │ ├── funcall.yasnippet │ ├── function.yasnippet │ ├── get.yasnippet │ ├── global-set-key.yasnippet │ ├── goto-char.yasnippet │ ├── if.yasnippet │ ├── insert-file-contents.yasnippet │ ├── insert.yasnippet │ ├── interactive.yasnippet │ ├── kbd.yasnippet │ ├── kill-buffer.yasnippet │ ├── lambda.yasnippet │ ├── length.yasnippet │ ├── let.yasnippet │ ├── line-beginning-position.yasnippet │ ├── line-end-position.yasnippet │ ├── list.yasnippet │ ├── looking-at.yasnippet │ ├── make-directory.yasnippet │ ├── make-local-variable.yasnippet │ ├── mapc.yasnippet │ ├── mapcar.yasnippet │ ├── match-beginning.yasnippet │ ├── match-end.yasnippet │ ├── match-string.yasnippet │ ├── memq.yasnippet │ ├── message.yasnippet │ ├── not.yasnippet │ ├── nth.yasnippet │ ├── null.yasnippet │ ├── number-to-string.yasnippet │ ├── or.yasnippet │ ├── point-max.yasnippet │ ├── point-min.yasnippet │ ├── point.yasnippet │ ├── princ.yasnippet │ ├── print.yasnippet │ ├── progn.yasnippet │ ├── push.yasnippet │ ├── put.yasnippet │ ├── re-search-backward.yasnippet │ ├── re-search-forward.yasnippet │ ├── region-active-p.yasnippet │ ├── region-beginning.yasnippet │ ├── region-end.yasnippet │ ├── rename-file.yasnippet │ ├── repeat.yasnippet │ ├── replace-regexp-in-string.yasnippet │ ├── replace-regexp.yasnippet │ ├── require.yasnippet │ ├── save-buffer.yasnippet │ ├── save-excursion.yasnippet │ ├── search-backward-regexp.yasnippet │ ├── search-backward.yasnippet │ ├── search-forward-regexp.yasnippet │ ├── search-forward.yasnippet │ ├── set-buffer.yasnippet │ ├── set-file-modes.yasnippet │ ├── set-mark.yasnippet │ ├── set.yasnippet │ ├── setq.yasnippet │ ├── skip-chars-backward.yasnippet │ ├── skip-chars-forward.yasnippet │ ├── split-string.yasnippet │ ├── string-match.yasnippet │ ├── string-to-number.yasnippet │ ├── string.yasnippet │ ├── string=.yasnippet │ ├── stringp.yasnippet │ ├── substring.yasnippet │ ├── thing-at-point.yasnippet │ ├── unless.yasnippet │ ├── vector.yasnippet │ ├── when.yasnippet │ ├── while.yasnippet │ ├── widget-get.yasnippet │ ├── with-current-buffer.yasnippet │ ├── x-dired.process_marked.yasnippet │ ├── x-file.process.yasnippet │ ├── x-file.read-lines.yasnippet │ ├── x-find-replace.yasnippet │ ├── x-grabstring.yasnippet │ ├── x-grabthing.yasnippet │ ├── x-traverse_dir.yasnippet │ ├── x-word-or-region.yasnippet │ ├── y-or-n-p.yasnippet │ └── yes-or-no-p.yasnippet ├── erlang-mode │ ├── .yas-parents │ ├── after │ ├── begin │ ├── beh │ ├── case │ ├── compile │ ├── def │ ├── exp │ ├── fun │ ├── if │ ├── ifdef │ ├── ifndef │ ├── imp │ ├── inc │ ├── inc.lib │ ├── loop │ ├── mod │ ├── rcv │ ├── rcv.after │ ├── rec │ ├── try │ └── undef ├── f90-mode │ ├── .yas-parents │ ├── au │ ├── bd │ ├── c │ ├── ch │ ├── cx │ ├── dc │ ├── do │ ├── dp │ ├── eq │ ├── ib │ ├── ic │ ├── ich │ ├── if │ ├── ii │ ├── il │ ├── in │ ├── inc │ ├── intr │ ├── ir │ ├── l │ ├── pa │ ├── pr │ ├── re │ ├── st │ ├── su │ └── wr ├── html-mode │ ├── .yas-make-groups │ ├── .yas-parents │ ├── b.yasnippet │ ├── body │ ├── br │ ├── code │ ├── code.class │ ├── div │ ├── div.class │ ├── div.id │ ├── div.id-class │ ├── dov │ ├── form │ ├── head │ ├── header │ │ ├── h1 │ │ ├── h2 │ │ ├── h3 │ │ ├── h4 │ │ ├── h5 │ │ └── h6 │ ├── hr │ ├── href │ ├── html │ ├── html.xmlns │ ├── i.yasnippet │ ├── img │ ├── input │ ├── link.stylesheet │ ├── link.stylesheet-ie │ ├── list │ │ ├── dd │ │ ├── dl │ │ ├── dl.id │ │ ├── dt │ │ ├── li │ │ ├── li.class │ │ ├── ol │ │ ├── ol.class │ │ ├── ol.id │ │ ├── ul │ │ ├── ul.class │ │ └── ul.id │ ├── mailto │ ├── meta │ │ ├── doctype │ │ ├── doctype.xhml1 │ │ ├── doctype.xhtml1_1 │ │ ├── doctype.xhtml1_strict │ │ ├── doctype.xhtml1_transitional │ │ ├── meta │ │ └── meta.http-equiv │ ├── p │ ├── pre │ ├── q.yasnippet │ ├── quote │ ├── script.javascript │ ├── script.javascript-src │ ├── span │ ├── span.class │ ├── span.id │ ├── style │ ├── table │ │ ├── table │ │ ├── td │ │ ├── th │ │ └── tr │ ├── textarea │ └── title ├── latex-mode │ ├── .yas-parents │ └── begin ├── markdown-mode │ ├── + │ ├── - │ ├── .yas-parents │ ├── _ │ ├── __ │ ├── ` │ ├── h1.1 │ ├── h1.2 │ ├── h2.1 │ ├── h2.2 │ ├── h3 │ ├── h4 │ ├── h5 │ ├── h6 │ ├── hr.1 │ ├── hr.2 │ ├── img │ ├── link │ ├── ol │ ├── rimg │ ├── rlb │ └── rlink ├── nxml-mode │ ├── .yas-make-groups │ ├── .yas-parents │ ├── body │ ├── br │ ├── code │ ├── div │ ├── form │ ├── head │ ├── header │ │ ├── h1 │ │ ├── h2 │ │ ├── h3 │ │ ├── h4 │ │ ├── h5 │ │ └── h6 │ ├── hr │ ├── href │ ├── html │ ├── img │ ├── input │ ├── li │ ├── link │ ├── meta │ │ ├── doctype │ │ ├── doctype.xhtml1_strict │ │ ├── doctype.xhtml1_transitional │ │ └── meta │ ├── name │ ├── ol │ ├── p │ ├── pre │ ├── quote │ ├── span │ ├── style │ ├── table │ ├── tag.1l │ ├── tag.2l │ ├── td │ ├── th │ ├── title │ ├── tr │ ├── ul │ └── xml ├── objc-mode │ ├── .yas-parents │ └── prop ├── org-mode │ ├── .yas-parents │ ├── begin_center │ ├── begin_example │ ├── begin_quote │ ├── begin_src │ ├── begin_verse │ ├── insert_contact │ └── man ├── perl-mode │ ├── .yas-parents │ ├── eval │ ├── for │ ├── fore │ ├── if │ ├── ife │ ├── ifee │ ├── sub │ ├── unless │ ├── while │ ├── xfore │ ├── xif │ ├── xunless │ └── xwhile ├── python-mode │ ├── .yas-parents │ ├── __ │ ├── class │ ├── def │ ├── defm │ ├── for │ ├── ifmain │ ├── prop │ ├── propg │ ├── propsg │ └── while ├── rst-mode │ ├── .yas-parents │ ├── chap │ ├── sec │ └── tit ├── ruby-mode │ ├── .yas-make-groups │ ├── .yas-parents │ ├── collections │ │ ├── all │ │ ├── any │ │ ├── classify │ │ ├── collect │ │ ├── deli │ │ ├── det │ │ ├── ea │ │ ├── eac │ │ ├── eai │ │ ├── eav │ │ ├── eawi │ │ ├── inject │ │ ├── reject │ │ ├── select │ │ └── zip │ ├── control structure │ │ ├── forin │ │ ├── if │ │ ├── ife │ │ ├── tim │ │ ├── until │ │ ├── upt │ │ ├── when │ │ └── while │ ├── definitions │ │ ├── Comp │ │ ├── am │ │ ├── cla │ │ ├── cls │ │ ├── mm │ │ ├── r │ │ ├── rw │ │ └── w │ └── general │ │ ├── # │ │ ├── =b │ │ ├── app │ │ ├── bm │ │ ├── case │ │ ├── dee │ │ ├── rb │ │ ├── req │ │ ├── rreq │ │ └── y ├── scala-mode │ ├── .yas-parents │ ├── act │ ├── act.arg │ ├── actor │ ├── ano │ ├── app │ ├── arr.new │ ├── arr.val-new │ ├── asof │ ├── ass │ ├── ass.true │ ├── at.author │ ├── at.param │ ├── at.return │ ├── at.version │ ├── bang │ ├── case │ ├── case.match-all │ ├── cast │ ├── cc │ ├── cl │ ├── cl.abs │ ├── cl.abs-arg │ ├── cl.arg │ ├── clof │ ├── co │ ├── cons │ ├── cons.nil │ ├── def.arg │ ├── def.arg-body │ ├── def.arg-ret │ ├── def.arg-ret-body │ ├── def.body │ ├── def.ret │ ├── def.ret-body │ ├── def.simple │ ├── doc.class │ ├── doc.def │ ├── doc.file │ ├── doc.file-scala │ ├── doc.file-scala-api │ ├── doc.scaladoc │ ├── expect │ ├── ext │ ├── for.extract │ ├── for.if │ ├── for.loop │ ├── for.multi │ ├── foreach │ ├── hmap.new │ ├── hmap.val-new │ ├── hset.new │ ├── hset.val-new │ ├── if │ ├── if.else │ ├── imp │ ├── intercept │ ├── isof │ ├── ls.new │ ├── ls.val-new │ ├── main │ ├── map │ ├── map.new │ ├── match │ ├── match.can │ ├── match.option │ ├── mix │ ├── ob │ ├── pac │ ├── pr.newline │ ├── pr.simple │ ├── pr.string │ ├── pr.trace │ ├── pri │ ├── pri.param │ ├── pro │ ├── pro.param │ ├── suite │ ├── test │ ├── throw │ ├── tr │ ├── tr.ext │ ├── tr.ext-with │ ├── tr.with │ ├── try │ ├── try.catch-finally │ ├── try.finally │ ├── tup.arrow │ ├── tup.paren │ ├── val │ ├── val.new │ ├── val.ret │ ├── var │ ├── var.new │ ├── var.ret │ ├── whi │ └── with ├── snippet-mode │ ├── .yas-parents │ ├── field │ ├── mirror │ └── vars ├── sql-mode │ ├── .yas-parents │ ├── column │ ├── constraint │ ├── constraint.1 │ ├── create │ ├── create.1 │ └── references └── text-mode │ ├── email │ └── time └── src ├── amazon-util.el ├── capitalize+.el ├── cinsk-common.el ├── cinsk-wood.el ├── contacts.el ├── dired-xx.el ├── dirtree.el ├── dwim-compile.el ├── ediffx.el ├── etheme.el ├── ffap-java.el ├── fontutil.el ├── insertat.el ├── linux-type.el ├── rfc2org.el ├── uinit.el ├── untabify.el ├── vc-dirx.el ├── vc-jump.el ├── wfutils.el ├── xlicense.el └── xskel.el /.gitignore: -------------------------------------------------------------------------------- 1 | # Files that GIT should ignore 2 | # See gitignore(5) for the format of this file 3 | 4 | # tramp -- Tramp connection history 5 | /tramp 6 | # generated etags file(s) 7 | /TAGS* 8 | # auto-saves 9 | auto-save-list/ 10 | # untested schemas 11 | /schema/xmpp/ 12 | 13 | # all schemas 14 | /schema 15 | 16 | # packages installed by package.el 17 | elpa 18 | # packages installed manually 19 | site-lisp 20 | *~ 21 | *.elc 22 | /unmaintained 23 | /abbrev_defs 24 | /w3m 25 | /packages 26 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cal-korea-x"] 2 | path = cal-korea-x 3 | url = https://github.com/cinsk/cal-korea-x.git 4 | [submodule "vim-modeline"] 5 | path = vim-modeline 6 | url = https://github.com/cinsk/emacs-vim-modeline.git 7 | [submodule "filladapt"] 8 | path = filladapt 9 | url = https://github.com/cinsk/filladapt.git 10 | [submodule "package"] 11 | path = package 12 | url = https://github.com/technomancy/package.el 13 | [submodule "html5-el"] 14 | path = html5-el 15 | url = https://github.com/hober/html5-el.git 16 | [submodule "html5-syntax"] 17 | path = html5-syntax 18 | url = https://github.com/appden/html5-syntax.git 19 | [submodule "magit"] 20 | path = magit 21 | url = https://github.com/cinsk/magit.git 22 | -------------------------------------------------------------------------------- /bashrc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This file is automatically read by Emacs on `M-x shell'. 3 | 4 | if test "x$INSIDE_EMACS" != "x"; then 5 | if test "x$TERM" == "xdumb"; then 6 | # Issuing GIT command in shell mode (`M-x shell') is 7 | # distracting since it uses less(1) as a pager. Setting 8 | # GIT_PAGER and MANPAGER will prevent to use less(1) in shell 9 | # mode. 10 | export GIT_PAGER="/bin/cat" 11 | export MANPAGER="/bin/cat" 12 | fi 13 | fi -------------------------------------------------------------------------------- /init/X.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | ;;; 4 | ;;; X window system customization 5 | ;;; 6 | 7 | (eval-when-compile 8 | (require 'fontutil nil t)) 9 | 10 | (setq select-enable-clipboard t) 11 | 12 | (when (display-graphic-p) 13 | (when (locate-library "fontutil") 14 | (require 'fontutil) 15 | (fontutil/set-font "scodepro-15"))) 16 | -------------------------------------------------------------------------------- /init/_browse-url.el: -------------------------------------------------------------------------------- 1 | ;;; 2 | ;;; browse-url configuration 3 | ;;; 4 | 5 | (eval-when-compile (require 'browse-url)) 6 | 7 | (add-to-list 'browse-url-filename-alist 8 | '("\\`/home/\\([^/]+\\)/public_html/\\(.*\\)\\'" . 9 | "http://localhost/~\\1/\\2")) 10 | 11 | ;; gentoo: /var/www/localhost/htdocs 12 | ;; ubuntu: /var/www/ 13 | ;; centos: /var/www/html/ /var/www/cgi-bin/ 14 | (add-to-list 'browse-url-filename-alist 15 | '("\\'/var/www/localhost/htdocs/\\(.*\\)\\'" . 16 | "http://localhost/\\1")) 17 | 18 | (defun browse-url-dwim (&optional arg) 19 | "Open URL or call find-file with the text at the point" 20 | (interactive "P") 21 | (let ((w (thing-at-point 'url)) url file) 22 | (if w 23 | (progn 24 | (setq url (url-generic-parse-url w)) 25 | (let ((ut (url-type url))) 26 | (if (or (null ut) (string-equal ut "file")) 27 | (setq file (url-filename url) 28 | url nil)))) 29 | (setq w (thing-at-point 'filename)) 30 | (if w 31 | (setq file w))) 32 | 33 | (let ((current-prefix-arg arg)) 34 | (if file 35 | (call-interactively (lookup-key (current-global-map) 36 | [(control ?x) (control ?f)])) 37 | (if url 38 | (call-interactively #'browse-url)))))) 39 | 40 | (global-set-key [(control ?c) (control ?o)] #'browse-url-dwim) 41 | -------------------------------------------------------------------------------- /init/_clojure.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | 4 | ;;; 5 | ;;; Clojure configuration 6 | ;;; 7 | 8 | (defun run-clojure () 9 | (interactive) 10 | (if (or (not (fboundp 'cider-connected-p)) 11 | (not (cider-connected-p))) 12 | (call-interactively 'cider-jack-in) 13 | (cider-switch-to-repl-buffer))) 14 | 15 | (with-eval-after-load "cider-mode" 16 | (when (boundp 'cider-mode-map) 17 | ;; I used `C-c C-d' for `delete-chars-forward-with-syntax' years. 18 | ;; Since xcscope.el uses `C-c s d' for similar purpose, I rebind 19 | ;; `cider-doc-map' to `C-c s'. 20 | (cinsk/move-key cider-mode-map [(control ?c) (control ?d)] [(control ?c) ?s]))) 21 | 22 | (with-eval-after-load "cider-repl" 23 | (when (boundp 'cider-repl-mode-map) 24 | (cinsk/move-key cider-repl-mode-map [(control ?c) (control ?d)] [(control ?c) ?s]))) 25 | 26 | (with-eval-after-load "clojure-mode" 27 | (when (locate-library "paredit") 28 | (add-hook 'clojure-mode-hook 'paredit-mode)) 29 | (when (boundp 'clojure-mode-map) 30 | (define-key clojure-mode-map [(control ?c) ?\!] 'run-clojure))) 31 | 32 | (with-eval-after-load "company-mode" 33 | (add-hook 'cider-repl-mode-hook #'company-mode) 34 | (add-hook 'cider-mode-hook #'company-mode)) 35 | -------------------------------------------------------------------------------- /init/_js.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | ;;; 4 | ;;; javascript configuration 5 | ;;; 6 | 7 | (eval-when-compile 8 | (if (locate-library "js2-mode") 9 | (require 'js2-mode) 10 | (require 'js) 11 | (require 'js-comint nil t))) 12 | 13 | 14 | (with-eval-after-load "indium-interaction" 15 | (cinsk/move-key indium-interaction-mode-map [(control ?c) ?d] [(control ?c) ?D]) 16 | (define-key indium-interaction-mode-map [(control ?c) (control ?r)] 'indium-eval-region) 17 | (define-key indium-interaction-mode-map [(control ?c) (control ?b)] 'indium-eval-buffer) 18 | (define-key indium-interaction-mode-map [(control ?c) ?\!] 'indium-run-node) 19 | ) 20 | 21 | (if (locate-library "js2-mode") 22 | (progn 23 | (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) 24 | (add-to-list 'interpreter-mode-alist '("node" . js2-mode)) 25 | (add-to-list 'interpreter-mode-alist '("nodejs" . js2-mode)) 26 | 27 | (with-eval-after-load "js2-mode" 28 | (add-to-list 'js2-mode-hook 'subword-mode) 29 | 30 | (when (locate-library "indium") 31 | (add-hook 'js2-mode-hook (lambda () 32 | (unless (fboundp 'indium-interaction-mode) 33 | (require 'indium)) 34 | (indium-interaction-mode)))))) 35 | ;; else part 36 | (when (locate-library "js-comint") 37 | (require 'js-comint)) 38 | 39 | (let ((path (executable-find "js"))) 40 | (when path 41 | (setq inferior-js-program-command path))) 42 | 43 | (with-eval-after-load "js" 44 | (define-key js-mode-map [(control ?c) ?\!] 'run-js) 45 | (define-key js-mode-map [(control ?c) (control ?r)] 'js-send-region-and-go) 46 | (define-key js-mode-map [(control ?c) (control ?b)] 'js-send-buffer-and-go))) 47 | 48 | 49 | (enable-minor-mode "js2-mode" js2-mode-hook skewer-mode skewer-mode 50 | (string-prefix-p (expand-file-name "~/src/js/d3/") buffer-file-name)) 51 | 52 | 53 | (with-eval-after-load "skewer-mode" 54 | (define-key skewer-mode-map [(control ?c) (control ?b)] 'skewer-load-buffer) 55 | (define-key skewer-mode-map [(control ?c) ?\!] 'skewer-repl)) 56 | -------------------------------------------------------------------------------- /init/_lua.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | ;;; 4 | ;;; lua configuration 5 | ;;; 6 | 7 | 8 | (with-eval-after-load "lua-mode" 9 | ;;(define-key lua-mode-map [(control ?c) ?\!] 'run-js) 10 | (when (and (fboundp 'lua-setup-keymap) 11 | (null lua-mode-map)) 12 | (setq lua-mode-map (lua-setup-keymap))) 13 | 14 | (when (keymapp lua-mode-map) 15 | (define-key lua-mode-map [(control ?c) (control ?r)] 'lua-send-region) 16 | (define-key lua-mode-map [(control ?c) (control ?b)] 'lua-send-buffer) 17 | (define-key lua-mode-map [(control ?c) (control ?l)] 18 | 'lua-send-current-line) 19 | (define-key lua-mode-map [(control ?c) (control ?e)] 20 | 'lua-send-lua-region))) 21 | 22 | (when (locate-library "lua-mode") 23 | (require 'lua-mode)) 24 | -------------------------------------------------------------------------------- /init/_mmm.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | ;;; 4 | ;;; MMM mode configuration 5 | ;;; 6 | (let ((mmm-dir (expand-file-name 7 | (path-join user-emacs-directory "mmm-mode")))) 8 | ;; If MMM mode is installed in $HOME/.emacs.d/mmm-mode/ 9 | (when (file-accessible-directory-p mmm-dir) 10 | (add-to-list 'load-path mmm-dir) 11 | (add-to-list 'Info-directory-list mmm-dir))) 12 | 13 | (with-eval-after-load "mmm-mode" 14 | ;; It seems that mmm-mode 0.4.8 will reset the mmm-related face 15 | ;; attributes after loading mmm-mode.el. To prevent resetting, 16 | ;; set the background of the faces AFTER loading mmm-mode.el 17 | 18 | ;; By default, mmm-mode uses faces with bright background for 19 | ;; the submodes. I don't like the bright background for most faces. 20 | (set-face-background 'mmm-code-submode-face "black") 21 | (set-face-background 'mmm-declaration-submode-face "black") 22 | (set-face-background 'mmm-default-submode-face "black")) 23 | 24 | (when (locate-library "mmm-auto") 25 | (require 'mmm-auto) 26 | 27 | ;; DO NOT SET `mmm-global-mode' to t!!! If you do in mmm-mode 28 | ;; 0.4.8, some mysterious bugs will happen. Particularly, on ediff 29 | ;; control panel will not listen to your key input on ediff-patch-* 30 | ;; command. 31 | (setq mmm-global-mode 'maybe) 32 | 33 | ;; `mmm-submode-decoration-level' can be 0, 1, or 2. (0: no color) 34 | (setq mmm-submode-decoration-level 2) 35 | 36 | (setq mmm-mode-ext-classes-alist 37 | '((xhtml-mode nil html-js) 38 | (xhtml-mode nil embedded-css) 39 | (html-mode nil html-js) 40 | (html-mode nil embedded-css) 41 | (nxml-mode nil html-js) 42 | (nxml-mode nil embedded-css) 43 | ))) 44 | -------------------------------------------------------------------------------- /init/_py.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | ;;; 4 | ;;; python mode configuration (python.el from vanilla Emacs) 5 | ;;; 6 | 7 | (eval-when-compile 8 | (require 'subr-x)) 9 | 10 | (defun pyenv-check-executable (snake) 11 | "Return t if SNAKE is under the path of pyenv(1) environment. 12 | 13 | SNAKE should be a string in absolute path." 14 | (let (out) 15 | (setq out (string-trim (with-output-to-string 16 | (with-temp-buffer 17 | (let ((tmpbuf (current-buffer))) 18 | (with-current-buffer 19 | standard-output 20 | (shell-command "pyenv root" t tmpbuf))))))) 21 | (not (not (string-match-p (concat "^" (regexp-quote out)) 22 | snake))))) 23 | 24 | (with-eval-after-load "pyenv-mode" 25 | ;; pyenv uses "C-c C-s" for `pyenv-mode-set', which overlapped with 26 | ;; python.el's "C-c C-s", `python-shell-send-string'. 27 | (define-key pyenv-mode-map [(control ?c) (control ?s)] nil) 28 | (define-key pyenv-mode-map [(control ?c) (control ?p)] 'pyenv-mode-set)) 29 | 30 | (when (pyenv-check-executable (executable-find "python")) 31 | (require 'pyenv-mode)) 32 | 33 | (with-eval-after-load "python" 34 | (add-to-list 'python-mode-hook 'pyenv-mode) 35 | 36 | (define-key python-mode-map [(control ?c) ?\!] 'run-python) 37 | (define-key python-mode-map [(control ?c) (control ?b)] 'python-shell-send-buffer)) 38 | -------------------------------------------------------------------------------- /init/_rust.el: -------------------------------------------------------------------------------- 1 | 2 | (when (and (executable-find "racer") 3 | (locate-library "racer") 4 | (locate-library "company")) 5 | ;; (setq racer-cmd "/target/release/racer") 6 | ;; (setq racer-rust-src-path "/src/") 7 | 8 | (with-eval-after-load "rust-mode" 9 | (add-hook 'rust-mode-hook 'racer-mode) 10 | (add-hook 'racer-mode-hook 'eldoc-mode) 11 | 12 | (add-hook 'rust-mode-hook 'company-mode) 13 | (setq company-tooltip-align-annotations t) 14 | 15 | (define-key rust-mode-map [tab] 'company-indent-or-complete-common))) 16 | -------------------------------------------------------------------------------- /init/buffer-menu.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | ;;; 4 | ;;; Buffer Menu (buffer-menu or ibuffer) configuration 5 | ;;; 6 | 7 | (eval-when-compile 8 | (require 'ibuf-ext)) 9 | 10 | ;; Sort by the 2nd column (buffer name) in Buffer list 11 | (setq Buffer-menu-sort-column 2) 12 | 13 | ;; ibuffer - advanced buffer menu 14 | (global-set-key [(control ?x) (control ?b)] 'ibuffer) 15 | (autoload 'ibuffer "ibuffer" "List buffers." t) 16 | 17 | (setq ibuffer-saved-filter-groups 18 | '(("default" 19 | ("dired" (mode . dired-mode)) 20 | ("manual" (or 21 | (name . "^\\*info.*\\*$") 22 | (name . "^\\*Man.*\\*$") 23 | (name . "^\\*Help.*\\*$"))) 24 | ("joplin" (or 25 | (mode . joplin-search-mode) 26 | (mode . joplin-mode) 27 | (name . "^\\*[jJ]oplin.*$"))) 28 | ("elisp" (or 29 | (mode . emacs-lisp-mode) 30 | (name . "\\`\\*scratch\\*\\'"))) 31 | ("gnus" (or 32 | (name . "\\`\\*Group\\*\\'") 33 | (name . "\\`\\*Server\\*\\'") 34 | (name . "\\`\\*Article .*\\*\\'") 35 | (name . "\\`\\*Summary .*\\*\\'"))) 36 | ("internal" (or 37 | (name . "^TAGS$") 38 | (name . "^\\*.*\\*$")))))) 39 | 40 | (add-hook 'ibuffer-mode-hook 41 | (lambda () 42 | (ibuffer-switch-to-saved-filter-groups "default"))) 43 | -------------------------------------------------------------------------------- /init/grave.el: -------------------------------------------------------------------------------- 1 | ;; As suggested in 2 | ;; http://stackoverflow.com/questions/935723/find-tab-characters-in-emacs, 3 | ;; 4 | ;; Following sexp visualize tab character. 5 | (when nil 6 | (add-hook 'font-lock-mode-hook 7 | '(lambda () 8 | (when (memq major-mode 9 | untabify-remove-trailing-spaces-on-write-modes) 10 | (font-lock-add-keywords nil 11 | '(("\t" 0 12 | 'trailing-whitespace prepend))))))) 13 | 14 | 15 | (when nil 16 | (add-hook 'c-mode-hook '(lambda () 17 | (make-local-variable 'write-contents-hooks) 18 | (add-hook 'write-contents-hooks 'cinsk/source-untabify))) 19 | (add-hook 'c++-mode-hook '(lambda () 20 | (make-local-variable 'write-contents-hooks) 21 | (add-hook 'write-contents-hooks 'cinsk/source-untabify)))) 22 | 23 | 24 | (when nil 25 | ;; Support for GNU global, the source code tag system 26 | (load-library "gtags") 27 | (add-hook 'c-mode-hook '(lambda () (gtags-mode 1))) 28 | (add-hook 'c++-mode-hook '(lambda () (gtags-mode 1)))) 29 | 30 | (when nil 31 | (require 'autoinsert) 32 | 33 | (let ((aid_correct (path-join user-emacs-directory "insert")) 34 | (aid_default (if (boundp 'auto-insert-directory) 35 | auto-insert-directory 36 | "~/insert"))) 37 | (setq auto-insert-directory 38 | (if (file-accessible-directory-p aid_correct) 39 | aid_correct 40 | aid_default))) 41 | 42 | (add-hook 'find-file-hook 'auto-insert)) 43 | -------------------------------------------------------------------------------- /init/korean.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | ;;; From Mr. Shin's FAQ 4 | ;;; and jay's setup 5 | ;;; General korean langauge environment setting 6 | 7 | ;;; set input method toggle key to 'Shift-Space' 8 | (global-set-key [?\S- ] 'toggle-input-method) 9 | 10 | (set-language-environment "Korean") 11 | ;; (setq-default file-name-coding-system 'utf-8) 12 | 13 | ;; Default korean keyboard layout 14 | ;; 15 | ;; "" for 2 (du-bul-sik), "3" for 3 (se-bul-sik) 16 | (setq-default default-korean-keyboard "3") 17 | 18 | (setq default-input-method "korean-hangul3") 19 | 20 | (setq input-method-verbose-flag nil 21 | input-method-highlight-flag nil) 22 | 23 | ;;;; give highest priority to utf-8 24 | (prefer-coding-system 'utf-8) 25 | (set-default-coding-systems 'utf-8) 26 | 27 | (add-hook 'quail-deactivate-hook 'delete-quail-completions) 28 | (defun delete-quail-completions () 29 | (when (get-buffer "*Quail Completions*") 30 | (kill-buffer "*Quail Completions*"))) 31 | ;;(set-selection-coding-system 'euc-kr) 32 | (set-selection-coding-system 'utf-8) 33 | (setq x-select-request-type 'UTF8_STRING) 34 | 35 | ;;(unless window-system 36 | 37 | ;;(set-keyboard-coding-system 'nil) 38 | ;;(set-terminal-coding-system 'euc-kr)) 39 | 40 | ;; Hangul Mail setting 41 | (setq-default sendmail-coding-system 'euc-kr) 42 | 43 | ;; For use of `emacs -nw' in Korean terminal emulator 44 | (if (and (null window-system) (null noninteractive)) 45 | (progn 46 | (set-keyboard-coding-system 'utf-8) 47 | (set-terminal-coding-system 'utf-8))) 48 | 49 | ;; hangul printing for ps-mule.el 50 | (setq-default ps-multibyte-buffer 'non-latin-printer) 51 | 52 | ;; turn off C-h during input 53 | (with-eval-after-load "quail" 54 | (define-key quail-translation-keymap "\C-h" 55 | 'quail-delete-last-char) 56 | ;;(define-key quail-translation-keymap "\C-?" 57 | ;; 'quail-translation-help) 58 | (define-key quail-translation-keymap "\C-?" 59 | 'quail-delete-last-char)) 60 | 61 | ;; The default coding system of the dired buffer is utf-8. 62 | (add-hook 'dired-before-readin-hook 63 | (lambda () 64 | (set (make-local-variable 'coding-system-for-read) 'utf-8))) 65 | -------------------------------------------------------------------------------- /init/maven.el: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | 3 | ;;; 4 | ;;; Maven 5 | ;;; 6 | 7 | (unless (boundp 'compilation-error-regexp-alist-alist) 8 | (require 'compile)) 9 | 10 | (when (not (assoc 'maven3 compilation-error-regexp-alist-alist)) 11 | ;; On GNU Emacs 24.0.94.1 (x86_64-apple-darwin, NS 12 | ;; apple-appkit-1038.36) of 2012-02-28 on bob.porkrind.org, 13 | ;; http://emacsformacosx.com/builds/Emacs-pretest-24.0.94-universal-10.6.8.dmg, 14 | ;; maven in `compilation-error-regexp-alist-alist' is not handling 15 | ;; maven 3.0.3 in my Macbook. -- cinsk 16 | 17 | (add-to-list 'compilation-error-regexp-alist-alist 18 | '(maven3 "^\\[ERROR\\] +\\(.+?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\].*" 19 | 1 2 2)) 20 | (add-to-list 'compilation-error-regexp-alist 'maven3) 21 | ;// "[ERROR] /Users/.../KafkaBridge.java:[71,52] ';' expected" 22 | ) 23 | -------------------------------------------------------------------------------- /init_bash.sh: -------------------------------------------------------------------------------- 1 | . ~/.emacs.d/bashrc.sh 2 | -------------------------------------------------------------------------------- /license/APACHE-2.0: -------------------------------------------------------------------------------- 1 | 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | -------------------------------------------------------------------------------- /license/BOOST: -------------------------------------------------------------------------------- 1 | 2 | Boost Software License - Version 1.0 - August 17th, 2003 3 | 4 | Permission is hereby granted, free of charge, to any person or 5 | organization obtaining a copy of the software and accompanying 6 | documentation covered by this license (the "Software") to use, 7 | reproduce, display, distribute, execute, and transmit the Software, 8 | and to prepare derivative works of the Software, and to permit 9 | third-parties to whom the Software is furnished to do so, all subject 10 | to the following: 11 | 12 | The copyright notices in the Software and this entire statement, 13 | including the above license grant, this restriction and the following 14 | disclaimer, must be included in all copies of the Software, in whole 15 | or in part, and all derivative works of the Software, unless such 16 | copies or derivative works are solely in the form of 17 | machine-executable object code generated by a source language 18 | processor. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND 23 | NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE 24 | DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 26 | OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | THE SOFTWARE. 28 | 29 | -------------------------------------------------------------------------------- /license/BSD: -------------------------------------------------------------------------------- 1 | All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 1. Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | 2. Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the 11 | distribution. 12 | 3. All advertising materials mentioning features or use of this 13 | software must display the following acknowledgement: This product 14 | includes software developed by the @organization@. 15 | 4. Neither the name of the @organization@ nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY @AUTHOR@ ''AS IS'' AND ANY 20 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL @AUTHOR@ BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 26 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 29 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /license/BSD-new: -------------------------------------------------------------------------------- 1 | All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following 12 | disclaimer in the documentation and/or other materials provided 13 | with the distribution. 14 | 15 | * Neither the name of the @organization@ nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL @AUTHOR@ BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 26 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 29 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /license/BSD-old: -------------------------------------------------------------------------------- 1 | All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 1. Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | 2. Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the 11 | distribution. 12 | 3. All advertising materials mentioning features or use of this 13 | software must display the following acknowledgement: This product 14 | includes software developed by the @organization@. 15 | 4. Neither the name of the @organization@ nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY @AUTHOR@ ''AS IS'' AND ANY 20 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL @AUTHOR@ BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 26 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 29 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /license/FREEBSD: -------------------------------------------------------------------------------- 1 | All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following 12 | disclaimer in the documentation and/or other materials provided 13 | with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY @AUTHOR@ ``AS IS'' AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL @AUTHOR@ OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 21 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 23 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | The views and conclusions contained in the software and documentation 28 | are those of the authors and should not be interpreted as representing 29 | official policies, either expressed or implied, of @author@. 30 | -------------------------------------------------------------------------------- /license/GPL-2.0: -------------------------------------------------------------------------------- 1 | 2 | This program is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 2 of the License, or (at 5 | your option) any later version. 6 | 7 | This program is distributed in the hope that it will be useful, but 8 | WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 | 02110-1301, USA. 16 | -------------------------------------------------------------------------------- /license/GPL-3.0: -------------------------------------------------------------------------------- 1 | 2 | This program is free software: you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation, either version 2 of the License, or (at 5 | your option) any later version. 6 | 7 | This program is distributed in the hope that it will be useful, but 8 | WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program. If not, see . 14 | -------------------------------------------------------------------------------- /license/LGPL: -------------------------------------------------------------------------------- 1 | 2 | This library is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU Lesser General Public License as 4 | published by the Free Software Foundation; either version 2.1 of the 5 | License, or (at your option) any later version. 6 | 7 | This library is distributed in the hope that it will be useful, but 8 | WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | Lesser General Public License for more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 | 02110-1301 USA 16 | -------------------------------------------------------------------------------- /license/MIT: -------------------------------------------------------------------------------- 1 | 2 | Permission is hereby granted, free of charge, to any person obtaining 3 | a copy of this software and associated documentation files (the 4 | "Software"), to deal in the Software without restriction, including 5 | without limitation the rights to use, copy, modify, merge, publish, 6 | distribute, sublicense, and/or sell copies of the Software, and to 7 | permit persons to whom the Software is furnished to do so, subject to 8 | the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be 11 | included in all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 15 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 16 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 19 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | 21 | Except as contained in this notice, the name(s) of the above copyright 22 | holders shall not be used in advertising or otherwise to promote the 23 | sale, use or other dealings in this Software without prior written 24 | authorization. -------------------------------------------------------------------------------- /license/MPL-2.0: -------------------------------------------------------------------------------- 1 | This Source Code Form is subject to the terms of the Mozilla Public 2 | License, v. 2.0. If a copy of the MPL was not distributed with this 3 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | -------------------------------------------------------------------------------- /license/WTFPL: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) @year@ @author@ <@email@> 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | This program is free software. It comes without any warranty, to the 16 | extent permitted by applicable law. You can redistribute it and/or 17 | modify it under the terms of the Do What The Fuck You Want To Public 18 | License, Version 2, as published by Sam Hocevar. See 19 | http://www.wtfpl.net/ for more details. -------------------------------------------------------------------------------- /local/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinsk/emacs-scripts/3d38a83727f28945e4624efe059f5245253d97d7/local/.gitkeep -------------------------------------------------------------------------------- /open.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # See http://blog.nguyenvq.com/2009/12/01/file-management-emacs-dired-to-replace-finder-in-mac-os-x-and-other-os/ 4 | 5 | 6 | uname -a | grep -i microsoft &>/dev/null 7 | if [ $? -eq 0 ]; then 8 | WSL=1 9 | fi 10 | 11 | if [ -z "$WSL" ]; then 12 | for f in "$@"; do 13 | nohup xdg-open "$f" /dev/null 2>&1 & 14 | disown 15 | done 16 | else 17 | for f in "$@"; do 18 | nohup cmd.exe /c start $(wslpath -w "$f") /dev/null 2>&1 & 19 | disown 20 | done 21 | fi 22 | 23 | # why 1 second? perhaps 0.5 would be better? -- cinsk 24 | sleep 0.2 25 | 26 | -------------------------------------------------------------------------------- /scala.etags: -------------------------------------------------------------------------------- 1 | /[^\*\/]*class[ \t]*\([a-zA-Z0-9_]+\)/\1/ 2 | /[^\*\/]*object[ \t]*\([a-zA-Z0-9_]+\)/\1/ 3 | /[^\*\/]*trait[ \t]*\([a-zA-Z0-9_]+\)/\1/ 4 | /[^\*\/]*case[ \t]*class[ \t]*\([a-zA-Z0-9_]+\)/\1/ 5 | /[^\*\/]*abstract[ \t]*class[ \t]*\([a-zA-Z0-9_]+\)/\1/ 6 | /[^\*\/]*def[ \t]*\([^[ \a\b\d\e\f\n\r\t\v(]+\)[ \t]*.*[:=]/\1/ 7 | /[^\*\/]*val[ \t]*\([a-zA-Z0-9_]+\)[ \t]*[:=]/\1/ 8 | /[^\*\/]*var[ \t]*\([a-zA-Z0-9_]+\)[ \t]*[:=]/\1/ 9 | /[^\*\/]*type[ \t]*\([a-zA-Z0-9_]+\)[ \t]*[\[<>=]/\1/ 10 | -------------------------------------------------------------------------------- /schema/README.md: -------------------------------------------------------------------------------- 1 | This directory contains XML schemas which is not part of NXML distribution. 2 | 3 | How to convert XSD into RNC (new) 4 | --------------------------------- 5 | 6 | 1. Install the package, `genrnc`. 7 | 2. Download the `.xsd` file. 8 | 3. Run `genrnc-regist-file` to convert it. 9 | 4. If the command asks "Including not located ns:", provide the 10 | pathname of the dependent .xsd file location. 11 | 12 | How to convert XSD into RNC (old) 13 | --------------------------------- 14 | 15 | To add XML schema in .xsd format, you need to use two tools; `rngconv` 16 | and `trang`. 17 | 18 | If you cannot find rngconv, here is a working link: 19 | 20 | http://java.net/downloads/msv/nightly/rngconv.20060319.zip 21 | 22 | With `rngconv`, you can convert `.xsd` into `.rng`: 23 | 24 | $ rngconv sample.xsd > sample.rng 25 | 26 | (You may want to use http://debeissat.nicolas.free.fr/XSDtoRNG.php 27 | instead `rngconv`.) 28 | 29 | With `trang`, you can convert `.rng` into `.rnc`: 30 | 31 | $ trang sample.rng sample.rnc 32 | 33 | Place the `.rnc` file into `$HOME/.emacs.d/schema/` and add the entry 34 | in `$HOME/.emacs.d/schema/schemas.xml`: 35 | 36 | -------------------------------------------------------------------------------- /schema/index.txt: -------------------------------------------------------------------------------- 1 | 2 | 1 /Users/cinsk/.emacs.d/schema/src/spring-beans.xsd 3 | 2 /Users/cinsk/.emacs.d/schema/src/spring-aop.xsd 4 | 3 http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 5 | 4 http://www.springframework.org/schema/tool/spring-tool-4.2.xsd 6 | 5 /Users/cinsk/.emacs.d/schema/src/spring-jdbc.xsd 7 | 6 /Users/cinsk/.emacs.d/schema/src/spring-repository.xsd 8 | 7 http://www.springframework.org/schema/context/spring-context.xsd 9 | 8 http://www.springframework.org/schema/tool/spring-tool.xsd 10 | 9 http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd 11 | -------------------------------------------------------------------------------- /schema/relaxng: -------------------------------------------------------------------------------- 1 | ../html5-syntax/relaxng -------------------------------------------------------------------------------- /schema/schemas-html5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /snippets/c++-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | cc-mode 2 | -------------------------------------------------------------------------------- /snippets/c++-mode/beginend: -------------------------------------------------------------------------------- 1 | # name: v.begin(), v.end() 2 | # key: beginend 3 | # -- 4 | ${1:v}.begin(), $1.end -------------------------------------------------------------------------------- /snippets/c++-mode/class: -------------------------------------------------------------------------------- 1 | # name: class ... { ... } 2 | # key: class 3 | # -- 4 | class ${1:Name} 5 | { 6 | public: 7 | ${1:$(yas-substr text "[^: ]*")}($2); 8 | virtual ~${1:$(yas-substr text "[^: ]*")}(); 9 | }; -------------------------------------------------------------------------------- /snippets/c++-mode/ns: -------------------------------------------------------------------------------- 1 | # name: namespace ... 2 | # key: ns 3 | # -- 4 | BEGIN_NS($1) 5 | $0 6 | END_NS 7 | -------------------------------------------------------------------------------- /snippets/c++-mode/template: -------------------------------------------------------------------------------- 1 | # name: template 2 | # key: template 3 | # -- 4 | template -------------------------------------------------------------------------------- /snippets/c++-mode/using: -------------------------------------------------------------------------------- 1 | # name: using namespace ... 2 | # key: using 3 | # -- 4 | using namespace ${std}; 5 | $0 -------------------------------------------------------------------------------- /snippets/c-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | cc-mode 2 | -------------------------------------------------------------------------------- /snippets/cc-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/cc-mode/do: -------------------------------------------------------------------------------- 1 | # name: do { ... } while (...) 2 | # key: do 3 | # -- 4 | do { 5 | $0 6 | } while (${1:condition}); -------------------------------------------------------------------------------- /snippets/cc-mode/fopen: -------------------------------------------------------------------------------- 1 | # name: FILE *fp = fopen(..., ...); 2 | # key: fopen 3 | # -- 4 | FILE *${fp} = fopen(${"file"}, "${r}"); -------------------------------------------------------------------------------- /snippets/cc-mode/for: -------------------------------------------------------------------------------- 1 | # name: for (...; ...; ...) { ... } 2 | # key: for 3 | # -- 4 | for (${1:int i = 0}; ${2:i < N}; ${3:++i}) { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/cc-mode/if: -------------------------------------------------------------------------------- 1 | # name: if (...) { ... } 2 | # key: if 3 | # -- 4 | if (${1:condition}) { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/cc-mode/inc: -------------------------------------------------------------------------------- 1 | # name: #include "..." 2 | # key: inc 3 | # -- 4 | #include "$1" -------------------------------------------------------------------------------- /snippets/cc-mode/inc.1: -------------------------------------------------------------------------------- 1 | # name: #include <...> 2 | # key: inc 3 | # -- 4 | #include <$1> -------------------------------------------------------------------------------- /snippets/cc-mode/main: -------------------------------------------------------------------------------- 1 | # name: int main(argc, argv) { ... } 2 | # key: main 3 | # -- 4 | int 5 | main(int argc, char *argv[]) 6 | { 7 | $0 8 | return 0; 9 | } -------------------------------------------------------------------------------- /snippets/cc-mode/once: -------------------------------------------------------------------------------- 1 | # name: #ifndef XXX; #define XXX; #endif 2 | # key: once 3 | # -- 4 | #ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_} 5 | #define $1 6 | 7 | $0 8 | 9 | #endif /* $1 */ -------------------------------------------------------------------------------- /snippets/cc-mode/printf: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: printf 3 | # contributor: joaotavora 4 | # key: printf 5 | # -- 6 | printf("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);") 7 | }$2${1:$(if (string-match "%" text) "\);" "")} -------------------------------------------------------------------------------- /snippets/cc-mode/struct: -------------------------------------------------------------------------------- 1 | # name: struct ... { ... } 2 | # key: struct 3 | # -- 4 | struct ${1:name} { 5 | $0 6 | }; -------------------------------------------------------------------------------- /snippets/cc-mode/while: -------------------------------------------------------------------------------- 1 | # name: while (...) { ... } 2 | # key: while 3 | # -- 4 | while (${1:condition}) { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/cperl-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | perl-mode 2 | -------------------------------------------------------------------------------- /snippets/csharp-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | cc-mode 2 | -------------------------------------------------------------------------------- /snippets/csharp-mode/attrib: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: private attribute ....; 3 | # key: attrib 4 | # -- 5 | /// 6 | /// $3 7 | /// 8 | private $1 $2; -------------------------------------------------------------------------------- /snippets/csharp-mode/attrib.1: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: private attribute ....; public property ... ... { ... } 3 | # key: attrib 4 | # -- 5 | /// 6 | /// $3 7 | /// 8 | private $1 $2; 9 | 10 | /// 11 | /// $4 12 | /// 13 | /// $5 14 | public $1 $2 15 | { 16 | get { 17 | return this.$2; 18 | } 19 | set { 20 | this.$2 = value; 21 | } 22 | } -------------------------------------------------------------------------------- /snippets/csharp-mode/attrib.2: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: private _attribute ....; public Property ... ... { ... } 3 | # key: attrib 4 | # -- 5 | /// 6 | /// $3 7 | /// 8 | private $1 ${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")}; 9 | 10 | /// 11 | /// ${3:Description} 12 | /// 13 | /// $1 14 | public ${1:Type} ${2:Name} 15 | { 16 | get { 17 | return this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")}; 18 | } 19 | set { 20 | this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")} = value; 21 | } 22 | } -------------------------------------------------------------------------------- /snippets/csharp-mode/class: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: class ... { ... } 3 | # key: class 4 | # -- 5 | ${5:public} class ${1:Name} 6 | { 7 | #region Ctor & Destructor 8 | /// 9 | /// ${3:Standard Constructor} 10 | /// 11 | public $1($2) 12 | { 13 | } 14 | 15 | /// 16 | /// ${4:Default Destructor} 17 | /// 18 | public ~$1() 19 | { 20 | } 21 | #endregion 22 | } -------------------------------------------------------------------------------- /snippets/csharp-mode/comment: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: /// ... 3 | # key: comment 4 | # -- 5 | /// 6 | /// $1 7 | /// -------------------------------------------------------------------------------- /snippets/csharp-mode/comment.1: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: /// ... 3 | # key: comment 4 | # -- 5 | /// $2 -------------------------------------------------------------------------------- /snippets/csharp-mode/comment.2: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: /// ... 3 | # key: comment 4 | # -- 5 | /// $1 -------------------------------------------------------------------------------- /snippets/csharp-mode/comment.3: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: /// ... 3 | # key: comment 4 | # -- 5 | /// $2 -------------------------------------------------------------------------------- /snippets/csharp-mode/method: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: public void Method { ... } 3 | # key: method 4 | # -- 5 | /// 6 | /// ${5:Description} 7 | /// ${2:$(if (string= (upcase text) "VOID") "" (format "%s%s%s" "\n/// " text ""))} 8 | ${1:public} ${2:void} ${3:MethodName}($4) 9 | { 10 | $0 11 | } -------------------------------------------------------------------------------- /snippets/csharp-mode/namespace: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: namespace .. { ... } 3 | # key: namespace 4 | # -- 5 | namespace $1 6 | { 7 | $0 8 | } -------------------------------------------------------------------------------- /snippets/csharp-mode/prop: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: property ... ... { ... } 3 | # key: prop 4 | # -- 5 | /// 6 | /// $5 7 | /// 8 | /// $6 9 | $1 $2 $3 10 | { 11 | get { 12 | return this.$4; 13 | } 14 | set { 15 | this.$4 = value; 16 | } 17 | } -------------------------------------------------------------------------------- /snippets/csharp-mode/region: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: #region ... #endregion 3 | # key: region 4 | # -- 5 | #region $1 6 | $0 7 | #endregion -------------------------------------------------------------------------------- /snippets/csharp-mode/using: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: using ...; 3 | # key: using 4 | # -- 5 | using $1; -------------------------------------------------------------------------------- /snippets/csharp-mode/using.1: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: using System; 3 | # key: using 4 | # -- 5 | using System; -------------------------------------------------------------------------------- /snippets/csharp-mode/using.2: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: using System....; 3 | # key: using 4 | # -- 5 | using System.$1; -------------------------------------------------------------------------------- /snippets/css-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/css-mode/bg: -------------------------------------------------------------------------------- 1 | # name: background-color: ... 2 | # key: bg 3 | # -- 4 | background-color: #${1:DDD}; -------------------------------------------------------------------------------- /snippets/css-mode/bg.1: -------------------------------------------------------------------------------- 1 | # name: background-image: ... 2 | # key: bg 3 | # -- 4 | background-image: url($1); -------------------------------------------------------------------------------- /snippets/css-mode/bor: -------------------------------------------------------------------------------- 1 | # name: border size style color 2 | # key: bor 3 | # -- 4 | border: ${1:1px} ${2:solid} #${3:999}; -------------------------------------------------------------------------------- /snippets/css-mode/cl: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: clear: ... 3 | # key: cl 4 | # -- 5 | clear: $1; -------------------------------------------------------------------------------- /snippets/css-mode/disp.block: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: display: block 3 | # key: disp 4 | # -- 5 | display: block; -------------------------------------------------------------------------------- /snippets/css-mode/disp.inline: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: display: inline 3 | # key: disp 4 | # -- 5 | display: inline; -------------------------------------------------------------------------------- /snippets/css-mode/disp.none: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: display: none 3 | # key: disp 4 | # -- 5 | display: none; -------------------------------------------------------------------------------- /snippets/css-mode/ff: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: font-family: ... 3 | # key: ff 4 | # -- 5 | font-family: $1; -------------------------------------------------------------------------------- /snippets/css-mode/fs: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: font-size: ... 3 | # key: fs 4 | # -- 5 | font-size: ${12px}; -------------------------------------------------------------------------------- /snippets/css-mode/mar.bottom: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: margin-bottom: ... 3 | # key: mar 4 | # -- 5 | margin-bottom: $1; -------------------------------------------------------------------------------- /snippets/css-mode/mar.left: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: margin-left: ... 3 | # key: mar 4 | # -- 5 | margin-left: $1; -------------------------------------------------------------------------------- /snippets/css-mode/mar.mar: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: margin: ... 3 | # key: mar 4 | # -- 5 | margin: $1; -------------------------------------------------------------------------------- /snippets/css-mode/mar.margin: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: margin top right bottom left 3 | # key: mar 4 | # -- 5 | margin: ${top} ${right} ${bottom} ${left}; -------------------------------------------------------------------------------- /snippets/css-mode/mar.right: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: margin-right: ... 3 | # key: mar 4 | # -- 5 | margin-right: $1; -------------------------------------------------------------------------------- /snippets/css-mode/mar.top: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: margin-top: ... 3 | # key: mar 4 | # -- 5 | margin-top: $1; -------------------------------------------------------------------------------- /snippets/css-mode/pad.bottom: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: padding-bottom: ... 3 | # key: pad 4 | # -- 5 | padding-bottom: $1; -------------------------------------------------------------------------------- /snippets/css-mode/pad.left: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: padding-left: ... 3 | # key: pad 4 | # -- 5 | padding-left: $1; -------------------------------------------------------------------------------- /snippets/css-mode/pad.pad: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: padding: ... 3 | # key: pad 4 | # -- 5 | padding: $1; -------------------------------------------------------------------------------- /snippets/css-mode/pad.padding: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: padding: top right bottom left 3 | # key: pad 4 | # -- 5 | padding: ${top} ${right} ${bottom} ${left}; -------------------------------------------------------------------------------- /snippets/css-mode/pad.right: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: padding-right: ... 3 | # key: pad 4 | # -- 5 | padding-right: $1; -------------------------------------------------------------------------------- /snippets/css-mode/pad.top: -------------------------------------------------------------------------------- 1 | # contributor: rejeep 2 | # name: padding-top: ... 3 | # key: pad 4 | # -- 5 | padding-top: $1; -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/.read_me: -------------------------------------------------------------------------------- 1 | -*- coding: utf-8 -*- 2 | Originally started by Xah Lee (xahlee.org) on 2009-02-22 3 | Released under GPL 3. 4 | 5 | Feel free to add missing ones or modify existing ones to improve. 6 | 7 | Those starting with “x-” are supposed to be idiom templates. Not sure it's very useful. They might start with “i-” or "id-" in the future. -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/add-hook.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: add-hook 3 | # key: add-hook 4 | # key: ah 5 | # -- 6 | (add-hook HOOK$0 FUNCTION) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/and.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: and 3 | # key: and 4 | # key: a 5 | # -- 6 | (and $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/append.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: append 3 | # key: append 4 | # -- 5 | (append $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/apply.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: apply 3 | # key: apply 4 | # -- 5 | (apply $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/aref.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: aref 3 | # key: aref 4 | # -- 5 | (aref ARRAY$0 INDEX) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/aset.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: aset 3 | # key: aset 4 | # -- 5 | (aset ARRAY$0 IDX NEWELT) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/assq.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: assq 3 | # key: assq 4 | # -- 5 | (assq KEY$0 LIST) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/autoload.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: autoload 3 | # key: autoload 4 | # -- 5 | (autoload 'FUNCNAME$0 "FILENAME" &optional "DOCSTRING" INTERACTIVE TYPE) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/backward-char.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: backward-char 3 | # key: backward-char 4 | # key: bc 5 | # -- 6 | (backward-char $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/beginning-of-line.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: beginning-of-line 3 | # key: beginning-of-line 4 | # key: bol 5 | # -- 6 | (beginning-of-line) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/bounds-of-thing-at-point.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: bounds-of-thing-at-point 3 | # key: bounds-of-thing-at-point 4 | # key: botap 5 | # -- 6 | (bounds-of-thing-at-point '$0) ; symbol, list, sexp, defun, filename, url, email, word, sentence, whitespace, line, page ... -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/buffer-file-name.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: buffer-file-name 3 | # key: buffer-file-name 4 | # key: bfn 5 | # -- 6 | (buffer-file-name) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/buffer-modified-p.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: buffer-modified-p 3 | # key: buffer-modified-p 4 | # key: bmp 5 | # -- 6 | (buffer-modified-p $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/buffer-substring-no-properties.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: buffer-substring-no-properties 3 | # key: buffer-substring-no-properties 4 | # key: bsnp 5 | # -- 6 | (buffer-substring-no-properties START$0 END) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/buffer-substring.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: buffer-substring 3 | # key: buffer-substring 4 | # key: bs 5 | # -- 6 | (buffer-substring START$0 END) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/car.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: car 3 | # key: car 4 | # -- 5 | (car $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/cdr.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: cdr 3 | # key: cdr 4 | # -- 5 | (cdr $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/concat.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: concat 3 | # key: concat 4 | # -- 5 | (concat $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/cond.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: cond 3 | # key: cond 4 | # -- 5 | (cond 6 | (CONDITION$0 BODY) 7 | (CONDITION BODY) 8 | ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/condition-case.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: condition-case 3 | # key: condition-case 4 | # key: cc 5 | # -- 6 | (condition-case $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/cons.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: cons 3 | # key: cons 4 | # -- 5 | (cons $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/consp.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: consp 3 | # key: consp 4 | # -- 5 | (consp $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/copy-directory.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: copy-directory 3 | # key: copy-directory 4 | # key: cd 5 | # -- 6 | (copy-directory $0 NEWNAME &optional KEEP-TIME PARENTS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/copy-file.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: copy-file 3 | # key: copy-file 4 | # key: cf 5 | # -- 6 | (copy-file FILE$0 NEWNAME &optional OK-IF-ALREADY-EXISTS KEEP-TIME PRESERVE-UID-GID) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/current-buffer.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: current-buffer 3 | # key: current-buffer 4 | # key: cb 5 | # -- 6 | (current-buffer) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/custom-autoload.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: custom-autoload 3 | # key: custom-autoload 4 | # key: ca 5 | # -- 6 | (custom-autoload$0 SYMBOL LOAD &optional NOSET) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/defalias.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: defalias 3 | # key: defalias 4 | # -- 5 | (defalias 'SYMBOL$0 'DEFINITION &optional DOCSTRING) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/defcustom.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: defcustom 3 | # key: defcustom 4 | # -- 5 | (defcustom $0 VALUE "DOC" &optional ARGS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/define-key.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: define-key 3 | # key: define-key 4 | # key: dk 5 | # -- 6 | (define-key KEYMAPNAME$0 (kbd "M-b") 'FUNCNAME) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/defsubst.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: defsubst 3 | # key: defsubst 4 | # -- 5 | (defsubst $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/defun.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: defun 3 | # key: defun 4 | # key: d 5 | # -- 6 | (defun $1 () 7 | "DOCSTRING" 8 | (interactive) 9 | (let (var1) 10 | (setq var1 some) 11 | $0 12 | )) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/defvar.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: defvar 3 | # key: defvar 4 | # -- 5 | (defvar $0 &optional INITVALUE "DOCSTRING") -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/delete-char.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: delete-char 3 | # key: delete-char 4 | # key: dc 5 | # -- 6 | (delete-char $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/delete-directory.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: delete-directory 3 | # key: delete-directory 4 | # key: dd 5 | # -- 6 | (delete-directory $0 &optional RECURSIVE) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/delete-file.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: delete-file 3 | # key: delete-file 4 | # key: df 5 | # -- 6 | (delete-file $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/delete-region.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: delete-region 3 | # key: delete-region 4 | # key: dr 5 | # -- 6 | (delete-region $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/directory-files.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: directory-files 3 | # key: directory-files 4 | # key: df 5 | # -- 6 | (directory-files $0 &optional FULL MATCH NOSORT) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/dolist.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: dolist 3 | # key: dolist 4 | # -- 5 | (dolist $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/end-of-line.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: end-of-line 3 | # key: end-of-line 4 | # key: eol 5 | # -- 6 | (end-of-line) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/eq.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: eq 3 | # key: eq 4 | # -- 5 | (eq $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/equal.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: equal 3 | # key: equal 4 | # -- 5 | (equal $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/error.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: error 3 | # key: error 4 | # -- 5 | (error "$0" &optional ARGS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/expand-file-name.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: expand-file-name 3 | # key: expand-file-name 4 | # key: efn 5 | # -- 6 | (expand-file-name $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/f.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: format 3 | # key: format 4 | # -- 5 | (format "$0" &optional OBJECTS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/fboundp.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: fboundp 3 | # key: fboundp 4 | # -- 5 | (fboundp '$0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/file-name-directory.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: file-name-directory 3 | # key: file-name-directory 4 | # key: fnd 5 | # -- 6 | (file-name-directory $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/file-name-extension.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: file-name-extension 3 | # key: file-name-extension 4 | # key: fne 5 | # -- 6 | (file-name-extension $0 &optional PERIOD) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/file-name-nondirectory.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: file-name-nondirectory 3 | # key: file-name-nondirectory 4 | # key: fnn 5 | # -- 6 | (file-name-nondirectory $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/file-name-sans-extension.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: file-name-sans-extension 3 | # key: file-name-sans-extension 4 | # key: fnse 5 | # -- 6 | (file-name-sans-extension $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/file-relative-name.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: file-relative-name 3 | # key: file-relative-name 4 | # key: frn 5 | # -- 6 | (file-relative-name $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/find-file.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: find-file 3 | # key: find-file 4 | # key: ff 5 | # -- 6 | (find-file $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/format.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: format 3 | # key: format 4 | # -- 5 | (format "$0" &optional OBJECTS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/forward-char.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: forward-char 3 | # key: forward-char 4 | # key: fc 5 | # -- 6 | (forward-char $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/forward-line.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: forward-line 3 | # key: forward-line 4 | # key: fl 5 | # -- 6 | (forward-line $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/funcall.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: funcall 3 | # key: funcall 4 | # -- 5 | (funcall $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/function.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: function 3 | # key: function 4 | # -- 5 | (function $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/get.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: get 3 | # key: get 4 | # -- 5 | (get SYMBOL$0 PROPNAME) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/global-set-key.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: global-set-key 3 | # key: global-set-key 4 | # key: gsk 5 | # -- 6 | (global-set-key (kbd "C-$0") 'COMMAND) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/goto-char.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: goto-char 3 | # key: goto-char 4 | # key: gc 5 | # -- 6 | (goto-char $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/if.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: if 3 | # key: if 4 | # -- 5 | (if $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/insert-file-contents.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: insert-file-contents 3 | # key: insert-file-contents 4 | # key: ifc 5 | # -- 6 | (insert-file-contents $0 &optional VISIT BEG END REPLACE) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/insert.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: insert 3 | # key: insert 4 | # key: i 5 | # -- 6 | (insert $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/interactive.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: interactive 3 | # key: interactive 4 | # -- 5 | (interactive) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/kbd.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: kbd 3 | # key: kbd 4 | # -- 5 | (kbd "$0") -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/kill-buffer.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: kill-buffer 3 | # key: kill-buffer 4 | # key: kb 5 | # -- 6 | (kill-buffer $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/lambda.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: lambda 3 | # key: lambda 4 | # -- 5 | (lambda ($0) "DOCSTRING" (interactive) BODY) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/length.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: length 3 | # key: length 4 | # -- 5 | (length $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/let.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: let 3 | # key: let 4 | # key: l 5 | # -- 6 | (let ($1 ) 7 | $0 8 | ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/line-beginning-position.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: line-beginning-position 3 | # key: line-beginning-position 4 | # key: lbp 5 | # -- 6 | (line-beginning-position) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/line-end-position.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: line-end-position 3 | # key: line-end-position 4 | # key: lep 5 | # -- 6 | (line-end-position) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/list.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: list 3 | # key: list 4 | # -- 5 | (list $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/looking-at.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: looking-at 3 | # key: looking-at 4 | # key: la 5 | # -- 6 | (looking-at $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/make-directory.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: make-directory 3 | # key: make-directory 4 | # key: md 5 | # -- 6 | (make-directory $0 &optional PARENTS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/make-local-variable.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: make-local-variable 3 | # key: make-local-variable 4 | # key: mlv 5 | # -- 6 | (make-local-variable $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/mapc.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: mapc 3 | # key: mapc 4 | # -- 5 | (mapc '$0 SEQUENCE) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/mapcar.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: mapcar 3 | # key: mapcar 4 | # -- 5 | (mapcar $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/match-beginning.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: match-beginning 3 | # key: match-beginning 4 | # key: mb 5 | # -- 6 | (match-beginning N$0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/match-end.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: match-end 3 | # key: match-end 4 | # key: me 5 | # -- 6 | (match-end N$0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/match-string.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: match-string 3 | # key: match-string 4 | # key: ms 5 | # -- 6 | (match-string $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/memq.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: memq 3 | # key: memq 4 | # -- 5 | (memq ELT$0 LIST) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/message.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: message 3 | # key: message 4 | # key: m 5 | # -- 6 | (message "FORMATSTRING$0" &optional ARGS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/not.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: not 3 | # key: not 4 | # key: n 5 | # -- 6 | (not $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/nth.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: nth 3 | # key: nth 4 | # -- 5 | (nth N$0 LIST) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/null.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: null 3 | # key: null 4 | # -- 5 | (null $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/number-to-string.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: number-to-string 3 | # key: number-to-string 4 | # key: nts 5 | # -- 6 | (number-to-string $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/or.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: or 3 | # key: or 4 | # key: o 5 | # -- 6 | (or $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/point-max.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: point-max 3 | # key: point-max 4 | # -- 5 | (point-max) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/point-min.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: point-min 3 | # key: point-min 4 | # key: pm 5 | # -- 6 | (point-min) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/point.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: point 3 | # key: point 4 | # key: p 5 | # -- 6 | (point) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/princ.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: princ 3 | # key: princ 4 | # -- 5 | (princ $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/print.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: print 3 | # key: print 4 | # -- 5 | (print $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/progn.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: progn 3 | # key: progn 4 | # -- 5 | (progn $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/push.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: push 3 | # key: push 4 | # -- 5 | (push $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/put.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: put 3 | # key: put 4 | # -- 5 | (put $0 PROPNAME VALUE) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/re-search-backward.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: re-search-backward 3 | # key: re-search-backward 4 | # key: rsb 5 | # -- 6 | (re-search-backward REGEXP$0 &optional BOUND NOERROR COUNT) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/re-search-forward.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: re-search-forward 3 | # key: re-search-forward 4 | # key: rsf 5 | # -- 6 | (re-search-forward REGEXP$0 &optional BOUND NOERROR COUNT) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/region-active-p.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: region-active-p 3 | # key: region-active-p 4 | # key: rap 5 | # -- 6 | (region-active-p) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/region-beginning.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: region-beginning 3 | # key: region-beginning 4 | # key: rb 5 | # -- 6 | (region-beginning) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/region-end.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: region-end 3 | # key: region-end 4 | # key: re 5 | # -- 6 | (region-end) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/rename-file.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: rename-file 3 | # key: rename-file 4 | # key: rf 5 | # -- 6 | (rename-file FILE$0 NEWNAME &optional OK-IF-ALREADY-EXISTS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/repeat.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: repeat 3 | # key: repeat 4 | # -- 5 | (repeat $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/replace-regexp-in-string.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: replace-regexp-in-string 3 | # key: replace-regexp-in-string 4 | # key: rris 5 | # -- 6 | (replace-regexp-in-string REGEXP$0 REP STRING &optional FIXEDCASE LITERAL SUBEXP START) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/replace-regexp.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: replace-regexp 3 | # key: replace-regexp 4 | # key: rr 5 | # -- 6 | (replace-regexp REGEXP$0 TO-STRING &optional DELIMITED START END) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/require.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: require 3 | # key: require 4 | # -- 5 | (require $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/save-buffer.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: save-buffer 3 | # key: save-buffer 4 | # key: sb 5 | # -- 6 | (save-buffer $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/save-excursion.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: save-excursion 3 | # key: save-excursion 4 | # key: se 5 | # -- 6 | (save-excursion $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/search-backward-regexp.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: search-backward-regexp 3 | # key: search-backward-regexp 4 | # key: sbr 5 | # -- 6 | (search-backward-regexp "$0" &optional BOUND NOERROR COUNT) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/search-backward.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: search-backward 3 | # key: search-backward 4 | # key: sb 5 | # -- 6 | (search-backward "$0" &optional BOUND NOERROR COUNT) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/search-forward-regexp.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: search-forward-regexp 3 | # key: search-forward-regexp 4 | # key: sfr 5 | # -- 6 | (search-forward-regexp "$0" &optional BOUND NOERROR COUNT) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/search-forward.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: search-forward 3 | # key: search-forward 4 | # key: sf 5 | # -- 6 | (search-forward "$0" &optional BOUND NOERROR COUNT) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/set-buffer.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: set-buffer 3 | # key: set-buffer 4 | # key: sb 5 | # -- 6 | (set-buffer $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/set-file-modes.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: set-file-modes 3 | # key: set-file-modes 4 | # key: sfm 5 | # -- 6 | (set-file-modes $0 MODE) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/set-mark.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: set-mark 3 | # key: set-mark 4 | # key: sm 5 | # -- 6 | (set-mark $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/set.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: set 3 | # key: set 4 | # -- 5 | (set $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/setq.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: setq 3 | # key: setq 4 | # key: s 5 | # -- 6 | (setq $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/skip-chars-backward.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: skip-chars-backward 3 | # key: skip-chars-backward 4 | # key: scb 5 | # -- 6 | (skip-chars-backward "$0" &optional LIM) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/skip-chars-forward.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: skip-chars-forward 3 | # key: skip-chars-forward 4 | # key: scf 5 | # -- 6 | (skip-chars-forward "$0" &optional LIM) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/split-string.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: split-string 3 | # key: split-string 4 | # key: ss 5 | # -- 6 | (split-string $0 &optional SEPARATORS OMIT-NULLS) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/string-match.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: string-match 3 | # key: string-match 4 | # key: sm 5 | # -- 6 | (string-match "REGEXP$0" "STRING" &optional START) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/string-to-number.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: string-to-number 3 | # key: string-to-number 4 | # key: stn 5 | # -- 6 | (string-to-number "$0") -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/string.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: string 3 | # key: string 4 | # -- 5 | (string $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/string=.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: string= 3 | # key: string= 4 | # -- 5 | (string= $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/stringp.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: stringp 3 | # key: stringp 4 | # -- 5 | (stringp $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/substring.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: substring 3 | # key: substring 4 | # -- 5 | (substring STRING$0 FROM &optional TO) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/thing-at-point.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: thing-at-point 3 | # key: thing-at-point 4 | # key: tap 5 | # -- 6 | (thing-at-point '$0) ; symbol, list, sexp, defun, filename, url, email, word, sentence, whitespace, line, page ... -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/unless.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: unless 3 | # key: unless 4 | # -- 5 | (unless $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/vector.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: vector 3 | # key: vector 4 | # key: v 5 | # -- 6 | (vector $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/when.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: when 3 | # key: when 4 | # -- 5 | (when $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/while.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: while 3 | # key: while 4 | # -- 5 | (while $0) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/widget-get.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: widget-get 3 | # key: widget-get 4 | # key: wg 5 | # -- 6 | (widget-get $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/with-current-buffer.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: with-current-buffer 3 | # key: with-current-buffer 4 | # key: wcb 5 | # -- 6 | (with-current-buffer $0 ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/x-dired.process_marked.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: process marked files in dired 3 | # key: x-dired 4 | # -- 5 | ;; idiom for processing a list of files in dired's marked files 6 | 7 | ;; suppose myProcessFile is your function that takes a file path 8 | ;; and do some processing on the file 9 | 10 | (defun dired-myProcessFile () 11 | "apply myProcessFile function to marked files in dired." 12 | (interactive) 13 | (require 'dired) 14 | (mapc 'myProcessFile (dired-get-marked-files)) 15 | ) 16 | 17 | ;; to use it, type M-x dired-myProcessFile -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/x-file.process.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: a function that process a file 3 | # key: x-file 4 | # -- 5 | (defun doThisFile (fpath) 6 | "Process the file at path FPATH ..." 7 | (let () 8 | ;; create temp buffer without undo record or font lock. (more efficient) 9 | ;; first space in temp buff name is necessary 10 | (set-buffer (get-buffer-create " myTemp")) 11 | (insert-file-contents fpath nil nil nil t) 12 | 13 | ;; process it ... 14 | ;; (goto-char 0) ; move to begining of file's content (in case it was open) 15 | ;; ... do something here 16 | ;; (write-file fpath) ;; write back to the file 17 | 18 | (kill-buffer " myTemp"))) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/x-file.read-lines.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: read lines of a file 3 | # key: x-file 4 | # -- 5 | (defun read-lines (filePath) 6 | "Return a list of lines in FILEPATH." 7 | (with-temp-buffer 8 | (insert-file-contents filePath) 9 | (split-string 10 | (buffer-string) "\n" t)) ) 11 | 12 | ;; process all lines 13 | (mapc 14 | (lambda (aLine) 15 | (message aLine) ; do your stuff here 16 | ) 17 | (read-lines "inputFilePath") 18 | ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/x-find-replace.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: find and replace on region 3 | # key: x-find-replace 4 | # -- 5 | (defun replace-html-chars-region (start end) 6 | "Replace “<” to “<” and other chars in HTML. 7 | This works on the current region." 8 | (interactive "r") 9 | (save-restriction 10 | (narrow-to-region start end) 11 | (goto-char (point-min)) 12 | (while (search-forward "&" nil t) (replace-match "&" nil t)) 13 | (goto-char (point-min)) 14 | (while (search-forward "<" nil t) (replace-match "<" nil t)) 15 | (goto-char (point-min)) 16 | (while (search-forward ">" nil t) (replace-match ">" nil t)) 17 | ) 18 | ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/x-grabstring.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: grab buffer substring 3 | # key: x-grabstring 4 | # -- 5 | (setq $0 (buffer-substring-no-properties myStartPos myEndPos)) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/x-grabthing.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: grab word under cursor 3 | # key: x-grabthing 4 | # -- 5 | (setq $0 (thing-at-point 'symbol)) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/x-traverse_dir.yasnippet: -------------------------------------------------------------------------------- 1 | # name: traversing a directory 2 | # contributor: Xah Lee (XahLee.org) 3 | # key: x-traverse_dir 4 | # -- 5 | ;; apply a function to all files in a dir 6 | (require 'find-lisp) 7 | (mapc 'my-process-file (find-lisp-find-files "~/myweb/" "\\.html$")) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/x-word-or-region.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: Command that works on region or word 3 | # key: x-word-or-region 4 | # -- 5 | ;; example of a command that works on current word or text selection 6 | (defun down-case-word-or-region () 7 | "Lower case the current word or text selection." 8 | (interactive) 9 | (let (pos1 pos2 meat) 10 | (if (and transient-mark-mode mark-active) 11 | (setq pos1 (region-beginning) 12 | pos2 (region-end)) 13 | (setq pos1 (car (bounds-of-thing-at-point 'symbol)) 14 | pos2 (cdr (bounds-of-thing-at-point 'symbol)))) 15 | 16 | ; now, pos1 and pos2 are the starting and ending positions 17 | ; of the current word, or current text selection if exists 18 | 19 | ;; put your code here. 20 | $0 21 | ;; Some example of things you might want to do 22 | (downcase-region pos1 pos2) ; example of a func that takes region as args 23 | (setq meat (buffer-substring-no-properties pos1 pos2)) ; grab the text. 24 | (delete-region pos1 pos2) ; get rid of it 25 | (insert "newText") ; insert your new text 26 | 27 | ) 28 | ) -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/y-or-n-p.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: y-or-n-p 3 | # key: y-or-n-p 4 | # key: yonp 5 | # -- 6 | (yes-or-no-p "PROMPT$0 ") -------------------------------------------------------------------------------- /snippets/emacs-lisp-mode/yes-or-no-p.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee (XahLee.org) 2 | # name: yes-or-no-p 3 | # key: yes-or-no-p 4 | # -- 5 | (yes-or-no-p "PROMPT$0 ") -------------------------------------------------------------------------------- /snippets/erlang-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/erlang-mode/after: -------------------------------------------------------------------------------- 1 | # name: after ... -> 2 | # key: after 3 | # -- 4 | after 5 | $1 -> $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/begin: -------------------------------------------------------------------------------- 1 | # name: begin ... end 2 | # key: begin 3 | # -- 4 | begin 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/beh: -------------------------------------------------------------------------------- 1 | # name: -behaviour(...). 2 | # key: beh 3 | # -- 4 | -behaviour(${1:gen_server}). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/case: -------------------------------------------------------------------------------- 1 | # name: case ... of ... end 2 | # key: case 3 | # -- 4 | case $1 of 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/compile: -------------------------------------------------------------------------------- 1 | # name: -compile(...). 2 | # key: compile 3 | # -- 4 | -compile([${1:export_all}]). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/def: -------------------------------------------------------------------------------- 1 | # name: -define(...,...). 2 | # key: def 3 | # -- 4 | -define($1,$2). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/exp: -------------------------------------------------------------------------------- 1 | # name: -export([]). 2 | # contributor: hitesh 3 | # key: exp 4 | # -- 5 | -export([${1:start/0}]). 6 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/fun: -------------------------------------------------------------------------------- 1 | # name: fun (...) -> ... end 2 | # key: fun 3 | # -- 4 | fun ($1) -> $0 end -------------------------------------------------------------------------------- /snippets/erlang-mode/if: -------------------------------------------------------------------------------- 1 | # name: if ... -> ... ; true -> ... end 2 | # key: if 3 | # -- 4 | if 5 | $1 -> $2; 6 | true -> $0 7 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/ifdef: -------------------------------------------------------------------------------- 1 | # name: -ifdef(...). ... -endif. 2 | # key: ifdef 3 | # -- 4 | -ifdef($1). 5 | $0 6 | -endif. -------------------------------------------------------------------------------- /snippets/erlang-mode/ifndef: -------------------------------------------------------------------------------- 1 | # name: -ifndef(...). ... -endif. 2 | # key: ifndef 3 | # -- 4 | -ifndef($1). 5 | $0 6 | -endif. -------------------------------------------------------------------------------- /snippets/erlang-mode/imp: -------------------------------------------------------------------------------- 1 | # name: -import([]). 2 | # contributor: hitesh 3 | # key: imp 4 | # -- 5 | -import(${1:lists}, [${2:map/2, sum/1}]). 6 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/inc: -------------------------------------------------------------------------------- 1 | # name: -include("..."). 2 | # key: inc 3 | # -- 4 | -include("$1"). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/inc.lib: -------------------------------------------------------------------------------- 1 | # name: -include_lib("..."). 2 | # key: inc 3 | # -- 4 | -include_lib("$1"). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/loop: -------------------------------------------------------------------------------- 1 | # name: loop(...) -> receive _ -> loop(...) end. 2 | # key: loop 3 | # -- 4 | ${1:loop}($2) -> 5 | receive 6 | ${3:_} -> 7 | $1($2) 8 | end. 9 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/mod: -------------------------------------------------------------------------------- 1 | # name: -module(). 2 | # contributor: hitesh 3 | # key: mod 4 | # -- 5 | -module(${1:`(file-name-nondirectory 6 | (file-name-sans-extension (or (buffer-file-name) (buffer-name))))`}). 7 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/rcv: -------------------------------------------------------------------------------- 1 | # name: receive ... -> ... end 2 | # key: rcv 3 | # -- 4 | receive 5 | $1 -> $0 6 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/rcv.after: -------------------------------------------------------------------------------- 1 | # name: receive after ... -> ... end 2 | # key: rcv 3 | # -- 4 | receive 5 | after 6 | $1 -> $0 7 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/rec: -------------------------------------------------------------------------------- 1 | # name: -record(...,{...}). 2 | # key: rec 3 | # -- 4 | -record($1,{$2}). 5 | $0 -------------------------------------------------------------------------------- /snippets/erlang-mode/try: -------------------------------------------------------------------------------- 1 | # name: try ... of ... catch after end 2 | # key: try 3 | # -- 4 | try $1 of 5 | $0 6 | catch 7 | after 8 | end -------------------------------------------------------------------------------- /snippets/erlang-mode/undef: -------------------------------------------------------------------------------- 1 | # name: -undef(...). 2 | # key: undef 3 | # -- 4 | -undef($1). 5 | $0 -------------------------------------------------------------------------------- /snippets/f90-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/f90-mode/au: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: automatic 3 | # key: au 4 | # -- 5 | automatic $0 -------------------------------------------------------------------------------- /snippets/f90-mode/bd: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: block data 3 | # key: bd 4 | # -- 5 | block data $0 -------------------------------------------------------------------------------- /snippets/f90-mode/c: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: continue 3 | # key: c 4 | # -- 5 | continue $0 -------------------------------------------------------------------------------- /snippets/f90-mode/ch: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: character 3 | # key: ch 4 | # -- 5 | character $0 -------------------------------------------------------------------------------- /snippets/f90-mode/cx: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: complex 3 | # key: cx 4 | # -- 5 | complex $0 -------------------------------------------------------------------------------- /snippets/f90-mode/dc: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: double complex 3 | # key: dc 4 | # -- 5 | double complex $0 -------------------------------------------------------------------------------- /snippets/f90-mode/do: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: do while (...) end do 3 | # key: do 4 | # -- 5 | do while (${1:condition}) 6 | $0 7 | end do -------------------------------------------------------------------------------- /snippets/f90-mode/dp: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: double precision 3 | # key: dp 4 | # -- 5 | double precision $0 -------------------------------------------------------------------------------- /snippets/f90-mode/eq: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: equivalence 3 | # key: eq 4 | # -- 5 | equivalence $0 -------------------------------------------------------------------------------- /snippets/f90-mode/ib: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: implicit byte 3 | # key: ib 4 | # -- 5 | implicit byte $0 -------------------------------------------------------------------------------- /snippets/f90-mode/ic: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: implicit complex 3 | # key: ic 4 | # -- 5 | implicit complex $0 -------------------------------------------------------------------------------- /snippets/f90-mode/ich: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: implicit character 3 | # key: ich 4 | # -- 5 | implicit character $0 -------------------------------------------------------------------------------- /snippets/f90-mode/if: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: if then end if 3 | # key: if 4 | # -- 5 | if ( ${1:condition} ) then 6 | $0 7 | end if -------------------------------------------------------------------------------- /snippets/f90-mode/ii: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: implicit integer 3 | # key: ii 4 | # -- 5 | implicit integer $0 -------------------------------------------------------------------------------- /snippets/f90-mode/il: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: implicit logical 3 | # key: il 4 | # -- 5 | implicit logical $0 -------------------------------------------------------------------------------- /snippets/f90-mode/in: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: implicit none 3 | # key: in 4 | # -- 5 | implicit none -------------------------------------------------------------------------------- /snippets/f90-mode/inc: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: include 3 | # key: inc 4 | # -- 5 | include $0 -------------------------------------------------------------------------------- /snippets/f90-mode/intr: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: intrinsic 3 | # key: intr 4 | # -- 5 | intrinsic $0 -------------------------------------------------------------------------------- /snippets/f90-mode/ir: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: implicit real 3 | # key: ir 4 | # -- 5 | implicit real $0 -------------------------------------------------------------------------------- /snippets/f90-mode/l: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: logical 3 | # key: l 4 | # -- 5 | logical $0 -------------------------------------------------------------------------------- /snippets/f90-mode/pa: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: parameter 3 | # key: pa 4 | # -- 5 | parameter $0 -------------------------------------------------------------------------------- /snippets/f90-mode/pr: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: program ... end program ... 3 | # key: pr 4 | # -- 5 | program ${1:name} 6 | $0 7 | end program ${1:name} -------------------------------------------------------------------------------- /snippets/f90-mode/re: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: read (*,*) 3 | # key: re 4 | # -- 5 | read (${1:*},${2:*}) $0 -------------------------------------------------------------------------------- /snippets/f90-mode/st: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: structure 3 | # key: st 4 | # -- 5 | structure $0 -------------------------------------------------------------------------------- /snippets/f90-mode/su: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: subroutine 3 | # key: su 4 | # -- 5 | subroutine $0 -------------------------------------------------------------------------------- /snippets/f90-mode/wr: -------------------------------------------------------------------------------- 1 | # contributor: Li Zhu 2 | # name: write (*,*) 3 | # key: wr 4 | # -- 5 | write (${1:*},${2:*}) $0 -------------------------------------------------------------------------------- /snippets/html-mode/.yas-make-groups: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinsk/emacs-scripts/3d38a83727f28945e4624efe059f5245253d97d7/snippets/html-mode/.yas-make-groups -------------------------------------------------------------------------------- /snippets/html-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/html-mode/b.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee xahlee.org 2 | # name: ... 3 | # key: b 4 | # -- 5 | $0 -------------------------------------------------------------------------------- /snippets/html-mode/body: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: body 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/html-mode/br: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
3 | # key: br 4 | # -- 5 |
-------------------------------------------------------------------------------- /snippets/html-mode/code: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: code 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/html-mode/code.class: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: code 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/html-mode/div: -------------------------------------------------------------------------------- 1 | # name: ... 2 | # key: div 3 | # -- 4 | $0 -------------------------------------------------------------------------------- /snippets/html-mode/div.class: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
...
3 | # key: div 4 | # -- 5 |
6 | $0 7 |
-------------------------------------------------------------------------------- /snippets/html-mode/div.id: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
...
3 | # key: div 4 | # -- 5 |
6 | $0 7 |
-------------------------------------------------------------------------------- /snippets/html-mode/div.id-class: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
...
3 | # key: div 4 | # -- 5 |
6 | $0 7 |
-------------------------------------------------------------------------------- /snippets/html-mode/dov: -------------------------------------------------------------------------------- 1 | # name: ... 2 | # key: dov 3 | # -- 4 | a mirror up here $3 5 | 6 | 7 | 8 | $0 9 | 10 | 11 | actually some other shit and $3 12 | -------------------------------------------------------------------------------- /snippets/html-mode/form: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | #name :
3 | # key: form 4 | # -- 5 |
6 | $0 7 |
-------------------------------------------------------------------------------- /snippets/html-mode/head: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: head 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/html-mode/header/h1: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:

...

3 | # key: h1 4 | # -- 5 |

$1

-------------------------------------------------------------------------------- /snippets/html-mode/header/h2: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:

...

3 | # key: h2 4 | # -- 5 |

$1

-------------------------------------------------------------------------------- /snippets/html-mode/header/h3: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:

...

3 | # key: h3 4 | # -- 5 |

$1

-------------------------------------------------------------------------------- /snippets/html-mode/header/h4: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:

...

3 | # key: h4 4 | # -- 5 |

$1

-------------------------------------------------------------------------------- /snippets/html-mode/header/h5: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
...
3 | # key: h5 4 | # -- 5 |
$1
-------------------------------------------------------------------------------- /snippets/html-mode/header/h6: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
...
3 | # key: h6 4 | # -- 5 |
$1
-------------------------------------------------------------------------------- /snippets/html-mode/hr: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
3 | # key: hr 4 | # -- 5 |
-------------------------------------------------------------------------------- /snippets/html-mode/href: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: href 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/html-mode/html: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: html 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/html-mode/html.xmlns: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: html 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/html-mode/i.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee xahlee.org 2 | # name: ... 3 | # key: i 4 | # -- 5 | $0 -------------------------------------------------------------------------------- /snippets/html-mode/img: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: img 4 | # -- 5 | $3 -------------------------------------------------------------------------------- /snippets/html-mode/input: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: 3 | # key: input 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/link.stylesheet: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: 3 | # key: link 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/link.stylesheet-ie: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: 3 | # key: link 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/list/dd: -------------------------------------------------------------------------------- 1 | # contributor: Rodrigo Setti 2 | # name:
...
3 | # key: dd 4 | # -- 5 |
$1
-------------------------------------------------------------------------------- /snippets/html-mode/list/dl: -------------------------------------------------------------------------------- 1 | # contributor: Rodrigo Setti 2 | # name:
...
3 | # key: dl 4 | # -- 5 |
6 | $0 7 |
-------------------------------------------------------------------------------- /snippets/html-mode/list/dl.id: -------------------------------------------------------------------------------- 1 | # contributor: Rodrigo Setti 2 | # name:
...
3 | # key: dl 4 | # -- 5 |
6 | $0 7 |
-------------------------------------------------------------------------------- /snippets/html-mode/list/dt: -------------------------------------------------------------------------------- 1 | # contributor: Rodrigo Setti 2 | # name:
...
3 | # key: dt 4 | # -- 5 |
$1
-------------------------------------------------------------------------------- /snippets/html-mode/list/li: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
  • ...
  • 3 | # key: li 4 | # -- 5 |
  • $1
  • -------------------------------------------------------------------------------- /snippets/html-mode/list/li.class: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
  • ...
  • 3 | # key: li 4 | # -- 5 |
  • $2
  • -------------------------------------------------------------------------------- /snippets/html-mode/list/ol: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
      ...
    3 | # key: ol 4 | # -- 5 |
      6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/list/ol.class: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
      ...
    3 | # key: ol 4 | # -- 5 |
      6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/list/ol.id: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
      ...
    3 | # key: ol 4 | # -- 5 |
      6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/list/ul: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
      ...
    3 | # key: ul 4 | # -- 5 |
      6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/list/ul.class: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
      ...
    3 | # key: ul 4 | # -- 5 |
      6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/list/ul.id: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
      ...
    3 | # key: ul 4 | # -- 5 |
      6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/mailto: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: mailto 4 | # -- 5 | $0 -------------------------------------------------------------------------------- /snippets/html-mode/meta/doctype: -------------------------------------------------------------------------------- 1 | # name: Doctype HTML 4.01 Strict 2 | # key: doctype 3 | # -- 4 | -------------------------------------------------------------------------------- /snippets/html-mode/meta/doctype.xhml1: -------------------------------------------------------------------------------- 1 | # name: DocType XHTML 1.0 frameset 2 | # key: doctype 3 | # -- 4 | -------------------------------------------------------------------------------- /snippets/html-mode/meta/doctype.xhtml1_1: -------------------------------------------------------------------------------- 1 | # name: DocType XHTML 1.1 2 | # key: doctype 3 | # -- 4 | -------------------------------------------------------------------------------- /snippets/html-mode/meta/doctype.xhtml1_strict: -------------------------------------------------------------------------------- 1 | # name: DocType XHTML 1.0 Strict 2 | # key: doctype 3 | # -- 4 | -------------------------------------------------------------------------------- /snippets/html-mode/meta/doctype.xhtml1_transitional: -------------------------------------------------------------------------------- 1 | # name: DocType XHTML 1.0 Transitional 2 | # key: doctype 3 | # -- 4 | -------------------------------------------------------------------------------- /snippets/html-mode/meta/meta: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: 3 | # key: meta 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/meta/meta.http-equiv: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: 3 | # key: meta 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/p: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:

    ...

    3 | # key: p 4 | # -- 5 |

    $1

    -------------------------------------------------------------------------------- /snippets/html-mode/pre: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
    ...
    3 | # key: pre 4 | # -- 5 |
    6 |   $0
    7 | 
    -------------------------------------------------------------------------------- /snippets/html-mode/q.yasnippet: -------------------------------------------------------------------------------- 1 | # contributor: Xah Lee xahlee.org 2 | # name:
    ...
    3 | # key: q 4 | # -- 5 |
    6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/quote: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name:
    ...
    3 | # key: quote 4 | # -- 5 |
    6 | $1 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/script.javascript: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | #name : 3 | # key: script 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/script.javascript-src: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | #name : 3 | # key: script 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/span: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: span 4 | # -- 5 | $1 -------------------------------------------------------------------------------- /snippets/html-mode/span.class: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: span 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/html-mode/span.id: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: span 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/html-mode/style: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: 3 | # key: style 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/table/table: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ...
    3 | # key: table 4 | # -- 5 | 6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/html-mode/table/td: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: td 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/html-mode/table/th: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: th 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/html-mode/table/tr: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: tr 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/html-mode/textarea: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: 3 | # key: textarea 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/html-mode/title: -------------------------------------------------------------------------------- 1 | # contributor: Jimmy Wu 2 | # name: ... 3 | # key: title 4 | # -- 5 | $1 -------------------------------------------------------------------------------- /snippets/latex-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/latex-mode/begin: -------------------------------------------------------------------------------- 1 | # contributor: Rodrigo Setti 2 | # name: \begin{environment} ... \end{environment} 3 | # key: begin 4 | # -- 5 | 6 | \begin{${1:environment}} 7 | $0 8 | \end{$1} -------------------------------------------------------------------------------- /snippets/markdown-mode/+: -------------------------------------------------------------------------------- 1 | # name: Unordered List 2 | # contributor: Peng Deng 3 | # key: + 4 | # -- 5 | + ${1:Text} 6 | +$0 -------------------------------------------------------------------------------- /snippets/markdown-mode/-: -------------------------------------------------------------------------------- 1 | # name: Unordered List 2 | # contributor: Peng Deng 3 | # key: - 4 | # -- 5 | - ${1:Text} 6 | -$0 -------------------------------------------------------------------------------- /snippets/markdown-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/markdown-mode/_: -------------------------------------------------------------------------------- 1 | # name: Emphasis 2 | # contributor: Peng Deng 3 | # key: _ 4 | # -- 5 | _${1:Text}_ $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/__: -------------------------------------------------------------------------------- 1 | # name: Strong 2 | # contributor: Peng Deng 3 | # key: __ 4 | # -- 5 | **${1:Text}** $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/`: -------------------------------------------------------------------------------- 1 | # name: Inline Code 2 | # contributor: Peng Deng 3 | # key: ` 4 | # -- 5 | \`${1:Code}\` $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/h1.1: -------------------------------------------------------------------------------- 1 | # name: Header 1 (#) 2 | # contributor: Peng Deng 3 | # key: h1 4 | # -- 5 | # ${1:Header 1} # 6 | 7 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/h1.2: -------------------------------------------------------------------------------- 1 | # name: Header 1 (=) 2 | # contributor: Peng Deng 3 | # key: h1 4 | # -- 5 | ${1:Header 1} 6 | ${1:$(make-string (string-width text) ?\=)} 7 | 8 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/h2.1: -------------------------------------------------------------------------------- 1 | # name: Header 2 (##) 2 | # contributor: Peng Deng 3 | # key: h2 4 | # -- 5 | ## ${1:Header 1} ## 6 | 7 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/h2.2: -------------------------------------------------------------------------------- 1 | # name: Header 2 (-) 2 | # contributor: Peng Deng 3 | # key: h2 4 | # -- 5 | ${1:Header 2} 6 | ${1:$(make-string (string-width text) ?\-)} 7 | 8 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/h3: -------------------------------------------------------------------------------- 1 | # name: Header 3 2 | # contributor: Peng Deng 3 | # key: h3 4 | # -- 5 | ### ${1:Header 3} ### 6 | 7 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/h4: -------------------------------------------------------------------------------- 1 | # name: Header 4 2 | # contributor: Peng Deng 3 | # key: h4 4 | # -- 5 | #### ${1:Header 4} #### 6 | 7 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/h5: -------------------------------------------------------------------------------- 1 | # name: Header 5 2 | # contributor: Peng Deng 3 | # key: h5 4 | # -- 5 | ##### ${1:Header 5} ##### 6 | 7 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/h6: -------------------------------------------------------------------------------- 1 | # name: Header 6 2 | # contributor: Peng Deng 3 | # key: h6 4 | # -- 5 | ###### ${1:Header 6} ###### 6 | 7 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/hr.1: -------------------------------------------------------------------------------- 1 | # name: Horizontal Rule (-) 2 | # contributor: Peng Deng 3 | # key: hr 4 | # -- 5 | 6 | ---------- 7 | 8 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/hr.2: -------------------------------------------------------------------------------- 1 | # name: Horizontal Rule (*) 2 | # contributor: Peng Deng 3 | # key: hr 4 | # -- 5 | 6 | ******* 7 | 8 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/img: -------------------------------------------------------------------------------- 1 | # name: Image 2 | # contributor: Peng Deng 3 | # key: img 4 | # -- 5 | ![${1:Alt Text}](${2:URL} $3) $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/link: -------------------------------------------------------------------------------- 1 | # name: Link 2 | # contributor: Peng Deng 3 | # key: link 4 | # -- 5 | [${1:Link Text}](${2:URL} $3) $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/ol: -------------------------------------------------------------------------------- 1 | # name: Ordered List 2 | # contributor: Peng Deng 3 | # key: ol 4 | # -- 5 | ${1:1}. ${2:Text} 6 | ${1:$(number-to-string (1+ (string-to-number text)))}. $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/rimg: -------------------------------------------------------------------------------- 1 | # name: Referenced Image 2 | # contributor: Peng Deng 3 | # key: rimg 4 | # -- 5 | ![${1:Alt Text}][$2] $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/rlb: -------------------------------------------------------------------------------- 1 | # name: Reference Label 2 | # contributor: Peng Deng 3 | # key: rlb 4 | # -- 5 | [${1:Reference}]: ${2:URL} $3 6 | $0 -------------------------------------------------------------------------------- /snippets/markdown-mode/rlink: -------------------------------------------------------------------------------- 1 | # name: Reference Link 2 | # contributor: Peng Deng 3 | # key: rlink 4 | # -- 5 | [${1:Link Text}][$2] $0 -------------------------------------------------------------------------------- /snippets/nxml-mode/.yas-make-groups: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinsk/emacs-scripts/3d38a83727f28945e4624efe059f5245253d97d7/snippets/nxml-mode/.yas-make-groups -------------------------------------------------------------------------------- /snippets/nxml-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/nxml-mode/body: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: body 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/nxml-mode/br: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
    3 | # key: br 4 | # -- 5 |
    -------------------------------------------------------------------------------- /snippets/nxml-mode/code: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: code 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/nxml-mode/div: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: div 4 | # -- 5 | $0 -------------------------------------------------------------------------------- /snippets/nxml-mode/form: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | #name :
    3 | # key: form 4 | # -- 5 |
    6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/nxml-mode/head: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: head 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/nxml-mode/header/h1: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:

    ...

    3 | # key: h1 4 | # -- 5 |

    $1

    -------------------------------------------------------------------------------- /snippets/nxml-mode/header/h2: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:

    ...

    3 | # key: h2 4 | # -- 5 |

    $1

    -------------------------------------------------------------------------------- /snippets/nxml-mode/header/h3: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:

    ...

    3 | # key: h3 4 | # -- 5 |

    $1

    -------------------------------------------------------------------------------- /snippets/nxml-mode/header/h4: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:

    ...

    3 | # key: h4 4 | # -- 5 |

    $1

    -------------------------------------------------------------------------------- /snippets/nxml-mode/header/h5: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
    ...
    3 | # key: h5 4 | # -- 5 |
    $1
    -------------------------------------------------------------------------------- /snippets/nxml-mode/header/h6: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
    ...
    3 | # key: h6 4 | # -- 5 |
    $1
    -------------------------------------------------------------------------------- /snippets/nxml-mode/hr: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
    3 | # key: hr 4 | # -- 5 |
    -------------------------------------------------------------------------------- /snippets/nxml-mode/href: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: href 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/nxml-mode/html: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: html 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/nxml-mode/img: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: img 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/nxml-mode/input: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: 3 | # key: input 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/nxml-mode/li: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
  • ...
  • 3 | # key: li 4 | # -- 5 |
  • $1
  • -------------------------------------------------------------------------------- /snippets/nxml-mode/link: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: 3 | # key: link 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/nxml-mode/meta/doctype: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: DocType XHTML 1.1 3 | # key: doctype 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/nxml-mode/meta/doctype.xhtml1_strict: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: DocType XHTML 1.0 Strict 3 | # key: doctype 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/nxml-mode/meta/doctype.xhtml1_transitional: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: DocType XHTML 1.0 Transitional 3 | # key: doctype 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/nxml-mode/meta/meta: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: 3 | # key: meta 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/nxml-mode/name: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: 3 | # key: name 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/nxml-mode/ol: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
      ...
    3 | # key: ol 4 | # -- 5 |
      6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/nxml-mode/p: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:

    ...

    3 | # key: p 4 | # -- 5 |

    $1

    -------------------------------------------------------------------------------- /snippets/nxml-mode/pre: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
    ...
    3 | # key: pre 4 | # -- 5 |
    6 |   $0
    7 | 
    -------------------------------------------------------------------------------- /snippets/nxml-mode/quote: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
    ...
    3 | # key: quote 4 | # -- 5 |
    6 | $1 7 |
    -------------------------------------------------------------------------------- /snippets/nxml-mode/span: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: span 4 | # -- 5 | $1 -------------------------------------------------------------------------------- /snippets/nxml-mode/style: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: 3 | # key: style 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/nxml-mode/table: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ...
    3 | # key: table 4 | # -- 5 | 6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/nxml-mode/tag.1l: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: tag 4 | # -- 5 | <${1:tag}>$2$0 -------------------------------------------------------------------------------- /snippets/nxml-mode/tag.2l: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: \n...\n 3 | # key: tag 4 | # -- 5 | <${1:tag}> 6 | $2 7 | $0 -------------------------------------------------------------------------------- /snippets/nxml-mode/td: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: td 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/nxml-mode/th: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: th 4 | # -- 5 | $2 -------------------------------------------------------------------------------- /snippets/nxml-mode/title: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: title 4 | # -- 5 | $1 -------------------------------------------------------------------------------- /snippets/nxml-mode/tr: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name: ... 3 | # key: tr 4 | # -- 5 | 6 | $0 7 | -------------------------------------------------------------------------------- /snippets/nxml-mode/ul: -------------------------------------------------------------------------------- 1 | # contributor: Anders Bach Nielsen 2 | # name:
      ...
    3 | # key: ul 4 | # -- 5 |
      6 | $0 7 |
    -------------------------------------------------------------------------------- /snippets/nxml-mode/xml: -------------------------------------------------------------------------------- 1 | # contributor: Seong-Kook Shin 2 | # name: 3 | # key: xml 4 | # -- 5 | -------------------------------------------------------------------------------- /snippets/objc-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | cc-mode 2 | -------------------------------------------------------------------------------- /snippets/objc-mode/prop: -------------------------------------------------------------------------------- 1 | # name: foo { ... } ; setFoo { ... } 2 | # key: prop 3 | # -- 4 | - (${1:id})${2:foo} 5 | { 6 | return $2; 7 | } 8 | 9 | - (void)set${2:$(capitalize text)}:($1)aValue 10 | { 11 | [$2 autorelease]; 12 | $2 = [aValue retain]; 13 | } 14 | $0 -------------------------------------------------------------------------------- /snippets/org-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/org-mode/begin_center: -------------------------------------------------------------------------------- 1 | # contributor: Seong-Kook Shin 2 | # name: #+BEGIN_CENTER ... #+END_CENTER 3 | # key: #center 4 | # expand-env: ((yas-indent-lin 'fixed) (yas-wrap-around-region t)) 5 | # -- 6 | #+BEGIN_CENTER 7 | `yas-selected-text`$0`(unless yas-selected-text "\n")`#+END_CENTER 8 | -------------------------------------------------------------------------------- /snippets/org-mode/begin_example: -------------------------------------------------------------------------------- 1 | # contributor: Seong-Kook Shin 2 | # name: #+BEGIN_EXAMPLE ... #+END_EXAMPLE 3 | # key: #example 4 | # expand-env: ((yas-indent-lin 'fixed) (yas-wrap-around-region t)) 5 | # -- 6 | #+BEGIN_EXAMPLE 7 | `yas-selected-text`$0`(unless yas-selected-text "\n")`#+END_EXAMPLE 8 | -------------------------------------------------------------------------------- /snippets/org-mode/begin_quote: -------------------------------------------------------------------------------- 1 | # contributor: Seong-Kook Shin 2 | # name: #+BEGIN_QUOTE ... #+END_QUOTE 3 | # key: #quote 4 | # expand-env: ((yas-indent-lin 'fixed) (yas-wrap-around-region t)) 5 | # -- 6 | #+BEGIN_QUOTE 7 | `yas-selected-text`$0`(unless yas-selected-text "\n")`#+END_QUOTE 8 | -------------------------------------------------------------------------------- /snippets/org-mode/begin_src: -------------------------------------------------------------------------------- 1 | # contributor: Seong-Kook Shin 2 | # name: #+BEGIN_SRC ... #+END_SRC 3 | # key: #src 4 | # expand-env: ((yas-indent-lin 'fixed)) 5 | # -- 6 | #+BEGIN_SRC $1 7 | `yas-selected-text`$0`(unless yas-selected-text "\n")`#+END_SRC 8 | -------------------------------------------------------------------------------- /snippets/org-mode/begin_verse: -------------------------------------------------------------------------------- 1 | # contributor: Seong-Kook Shin 2 | # name: #+BEGIN_VERSE ... #+END_VERSE 3 | # key: #verse 4 | # expand-env: ((yas-indent-lin 'fixed) (yas-wrap-around-region t)) 5 | # -- 6 | #+BEGIN_VERSE 7 | `yas-selected-text`$0`(unless yas-selected-text "\n")`#+END_VERSE 8 | -------------------------------------------------------------------------------- /snippets/org-mode/insert_contact: -------------------------------------------------------------------------------- 1 | # contributor: Seong-Kook Shin 2 | # name: @contact 3 | # key: @ 4 | # expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil)) 5 | # -- 6 | `(cinsk/org-insert-contact)` -------------------------------------------------------------------------------- /snippets/org-mode/man: -------------------------------------------------------------------------------- 1 | # contributor: Seong-Kook Shin 2 | # name: hyperlink to man page 3 | # key: man 4 | # -- 5 | [[man:$1][$1]$0 6 | -------------------------------------------------------------------------------- /snippets/perl-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/perl-mode/eval: -------------------------------------------------------------------------------- 1 | # name: eval { ... } if ($@) { ... } 2 | # key: eval 3 | # -- 4 | eval { 5 | ${1:# do something risky...} 6 | }; 7 | if (\$@) { 8 | ${2:# handle failure...} 9 | } -------------------------------------------------------------------------------- /snippets/perl-mode/for: -------------------------------------------------------------------------------- 1 | # name: for (...) { ... } 2 | # key: for 3 | # -- 4 | for (my \$${1:var} = 0; \$$1 < ${2:expression}; \$$1++) { 5 | ${3:# body...} 6 | } -------------------------------------------------------------------------------- /snippets/perl-mode/fore: -------------------------------------------------------------------------------- 1 | # name: foreach ... { ... } 2 | # key: fore 3 | # -- 4 | foreach my \$${1:x} (@${2:array}) { 5 | ${3:# body...} 6 | } -------------------------------------------------------------------------------- /snippets/perl-mode/if: -------------------------------------------------------------------------------- 1 | # name: if (...) { ... } 2 | # key: if 3 | # -- 4 | if ($1) { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/perl-mode/ife: -------------------------------------------------------------------------------- 1 | # name: if (...) { ... } else { ... } 2 | # key: ife 3 | # -- 4 | if ($1) { 5 | $2 6 | } else { 7 | $3 8 | } -------------------------------------------------------------------------------- /snippets/perl-mode/ifee: -------------------------------------------------------------------------------- 1 | # name: if, elsif, else ... 2 | # key: ifee 3 | # -- 4 | if ($1) { 5 | ${2:# body...} 6 | } elsif ($3) { 7 | ${4:# elsif...} 8 | } else { 9 | ${5:# else...} 10 | } -------------------------------------------------------------------------------- /snippets/perl-mode/sub: -------------------------------------------------------------------------------- 1 | # name: sub ... { ... } 2 | # key: sub 3 | # -- 4 | sub ${1:function_name} { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/perl-mode/unless: -------------------------------------------------------------------------------- 1 | # name: unless (...) { ... } 2 | # key: unless 3 | # -- 4 | unless ($1) { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/perl-mode/while: -------------------------------------------------------------------------------- 1 | # name: while (...) { ... } 2 | # key: while 3 | # -- 4 | while ($1) { 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/perl-mode/xfore: -------------------------------------------------------------------------------- 1 | # name: ... foreach ... 2 | # key: xfore 3 | # -- 4 | ${1:expression} foreach @${2:array}; -------------------------------------------------------------------------------- /snippets/perl-mode/xif: -------------------------------------------------------------------------------- 1 | # name: ... if ... 2 | # key: xif 3 | # -- 4 | ${1:expression} if ${2:condition} -------------------------------------------------------------------------------- /snippets/perl-mode/xunless: -------------------------------------------------------------------------------- 1 | # name: ... unless ... 2 | # key: xunless 3 | # -- 4 | ${1:expression} unless ${2:condition} -------------------------------------------------------------------------------- /snippets/perl-mode/xwhile: -------------------------------------------------------------------------------- 1 | # name: ... while ... 2 | # key: xwhile 3 | # -- 4 | ${1:expression} while ${2:condition}; -------------------------------------------------------------------------------- /snippets/python-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/python-mode/__: -------------------------------------------------------------------------------- 1 | # name: __...__ 2 | # key: __ 3 | # -- 4 | __${init}__ -------------------------------------------------------------------------------- /snippets/python-mode/class: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # name: class 3 | # contributor: Orestis Markou 4 | # contributor: Nishio Hirokazu 5 | # contributor: Yasser González Fernández 6 | # key: class 7 | # -- 8 | class ${1:ClassName}(${2:object}): 9 | """$3 10 | """ 11 | 12 | def __init__(self, $4): 13 | """$5 14 | ${4:$ 15 | (let* ((indent 16 | (concat "\n" (make-string (current-column) 32))) 17 | (args 18 | (mapconcat 19 | '(lambda (x) 20 | (if (not (string= (nth 0 x) "")) 21 | (concat "- " (char-to-string 96) (nth 0 x) 22 | (char-to-string 96) ":"))) 23 | (mapcar 24 | '(lambda (x) 25 | (mapcar 26 | (lambda (x) 27 | (replace-regexp-in-string "[[:blank:]]*$" "" 28 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) x)) 29 | (mapcar '(lambda (x) (split-string x "=")) 30 | (split-string text ","))) 31 | indent))) 32 | (if (string= args "") 33 | (make-string 3 34) 34 | (mapconcat 35 | 'identity 36 | (list "" "Arguments:" args (make-string 3 34)) 37 | indent))) 38 | } 39 | ${4:$ 40 | (mapconcat 41 | '(lambda (x) 42 | (if (not (string= (nth 0 x) "")) 43 | (concat "self._" (nth 0 x) " = " (nth 0 x)))) 44 | (mapcar 45 | '(lambda (x) 46 | (mapcar 47 | '(lambda (x) 48 | (replace-regexp-in-string "[[:blank:]]*$" "" 49 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) 50 | x)) 51 | (mapcar '(lambda (x) (split-string x "=")) 52 | (split-string text ","))) 53 | (concat "\n" (make-string (current-column) 32))) 54 | } 55 | $0 -------------------------------------------------------------------------------- /snippets/python-mode/def: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # name: def 3 | # contributor: Orestis Markou 4 | # contributor: Yasser González Fernández 5 | # key: def 6 | # -- 7 | def ${1:name}($2): 8 | """$3 9 | ${2:$ 10 | (let* 11 | ((indent 12 | (concat "\n" (make-string (current-column) 32))) 13 | (args 14 | (mapconcat 15 | '(lambda (x) 16 | (if (not (string= (nth 0 x) "")) 17 | (concat "- " (char-to-string 96) (nth 0 x) 18 | (char-to-string 96) ":"))) 19 | (mapcar 20 | '(lambda (x) 21 | (mapcar 22 | '(lambda (x) 23 | (replace-regexp-in-string "[[:blank:]]*$" "" 24 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) 25 | x)) 26 | (mapcar '(lambda (x) (split-string x "=")) 27 | (split-string text ","))) 28 | indent))) 29 | (if (string= args "") 30 | (make-string 3 34) 31 | (mapconcat 32 | 'identity 33 | (list "" "Arguments:" args (make-string 3 34)) 34 | indent))) 35 | } 36 | $0 -------------------------------------------------------------------------------- /snippets/python-mode/defm: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # name: defm 3 | # contributor: Yasser Gonz¨¢lez Fern¨¢ndez 4 | # key: defm 5 | # -- 6 | def ${1:name}(self, $2): 7 | """$3 8 | ${2:$ 9 | (let* ((indent 10 | (concat "\n" (make-string (current-column) 32))) 11 | (args 12 | (mapconcat 13 | '(lambda (x) 14 | (if (not (string= (nth 0 x) "")) 15 | (concat "- " (char-to-string 96) (nth 0 x) 16 | (char-to-string 96) ":"))) 17 | (mapcar 18 | '(lambda (x) 19 | (mapcar 20 | '(lambda (x) 21 | (replace-regexp-in-string "[[:blank:]]*$" "" 22 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) 23 | x)) 24 | (mapcar '(lambda (x) (split-string x "=")) 25 | (split-string text ","))) 26 | indent))) 27 | (if (string= args "") 28 | (make-string 3 34) 29 | (mapconcat 30 | 'identity 31 | (list "" "Arguments:" args (make-string 3 34)) 32 | indent))) 33 | } 34 | $0 -------------------------------------------------------------------------------- /snippets/python-mode/for: -------------------------------------------------------------------------------- 1 | # name: for ... in ... : ... 2 | # key: for 3 | # -- 4 | for ${var} in ${collection}: 5 | $0 -------------------------------------------------------------------------------- /snippets/python-mode/ifmain: -------------------------------------------------------------------------------- 1 | # name: if __name__ == '__main__': ... 2 | # key: ifmain 3 | # -- 4 | if __name__ == '__main__': 5 | $0 -------------------------------------------------------------------------------- /snippets/python-mode/prop: -------------------------------------------------------------------------------- 1 | # contributor: Mads D. Kristensen 2 | # name: prop 3 | # key: prop 4 | # -- 5 | def ${1:foo}(): 6 | doc = """${2:Doc string}""" 7 | def fget(self): 8 | return self._$1 9 | def fset(self, value): 10 | self._$1 = value 11 | def fdel(self): 12 | del self._$1 13 | return locals() 14 | $1 = property(**$1()) 15 | 16 | $0 -------------------------------------------------------------------------------- /snippets/python-mode/propg: -------------------------------------------------------------------------------- 1 | # contributor: Julio Carlos Menendez 2 | # name: _get_foo ... foo=property(...) 3 | # key: propg 4 | # -- 5 | def _get_${1:foo}(self): 6 | return self._$1 7 | 8 | $1 = property(_get_$1) 9 | 10 | $0 -------------------------------------------------------------------------------- /snippets/python-mode/propsg: -------------------------------------------------------------------------------- 1 | # contributor: Julio Carlos Menendez 2 | # name: _get_foo ... _set_foo ... foo=property(...) 3 | # key: propsg 4 | # -- 5 | def _set_${1:foo}(self, value): 6 | self._$1 = value 7 | 8 | def _get_$1(self): 9 | return self._$1 10 | 11 | $1 = property(_get_$1, _set_$1) 12 | 13 | $0 -------------------------------------------------------------------------------- /snippets/python-mode/while: -------------------------------------------------------------------------------- 1 | # name: while ... : ... 2 | # key: while 3 | # -- 4 | while ${condition}: 5 | $0 -------------------------------------------------------------------------------- /snippets/rst-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/rst-mode/chap: -------------------------------------------------------------------------------- 1 | # name: Chapter title 2 | # key: chap 3 | # -- 4 | ${1:Chapter} 5 | ${1:$(make-string (string-width text) ?\=)} 6 | 7 | $0 -------------------------------------------------------------------------------- /snippets/rst-mode/sec: -------------------------------------------------------------------------------- 1 | # name: Section title 2 | # key: sec 3 | # -- 4 | ${1:Section} 5 | ${1:$(make-string (string-width text) ?\-)} 6 | 7 | $0 -------------------------------------------------------------------------------- /snippets/rst-mode/tit: -------------------------------------------------------------------------------- 1 | # name: Document title 2 | # key: tit 3 | # -- 4 | ${1:$(make-string (string-width text) ?\=)} 5 | ${1:Title} 6 | ${1:$(make-string (string-width text) ?\=)} 7 | 8 | $0 -------------------------------------------------------------------------------- /snippets/ruby-mode/.yas-make-groups: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinsk/emacs-scripts/3d38a83727f28945e4624efe059f5245253d97d7/snippets/ruby-mode/.yas-make-groups -------------------------------------------------------------------------------- /snippets/ruby-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/all: -------------------------------------------------------------------------------- 1 | # name: all? { |...| ... } 2 | # key: all 3 | # -- 4 | all? { |${e}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/any: -------------------------------------------------------------------------------- 1 | # name: any? { |...| ... } 2 | # key: any 3 | # -- 4 | any? { |${e}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/classify: -------------------------------------------------------------------------------- 1 | # name: classify { |...| ... } 2 | # key: classify 3 | # -- 4 | classify { |${e}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/collect: -------------------------------------------------------------------------------- 1 | # name: collect { |...| ... } 2 | # key: collect 3 | # -- 4 | collect { |${e}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/deli: -------------------------------------------------------------------------------- 1 | # name: delete_if { |...| ... } 2 | # key: deli 3 | # -- 4 | delete_if { |${e} $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/det: -------------------------------------------------------------------------------- 1 | # name: detect { |...| ... } 2 | # key: det 3 | # -- 4 | detect { |${e}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/ea: -------------------------------------------------------------------------------- 1 | # name: each { |...| ... } 2 | # key: ea 3 | # -- 4 | each { |${e}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/eac: -------------------------------------------------------------------------------- 1 | # name: each_cons(...) { |...| ... } 2 | # key: eac 3 | # -- 4 | each_cons(${1:2}) { |${group}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/eai: -------------------------------------------------------------------------------- 1 | # name: each_index { |i| ... } 2 | # key: eai 3 | # -- 4 | each_index { |${i}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/eav: -------------------------------------------------------------------------------- 1 | # name: each_value { |val| ... } 2 | # key: eav 3 | # -- 4 | each_value { |${val}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/eawi: -------------------------------------------------------------------------------- 1 | # name: each_with_index { |e, i| ... } 2 | # key: eawi 3 | # -- 4 | each_with_index { |${e}, ${i}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/inject: -------------------------------------------------------------------------------- 1 | # name: inject(...) { |...| ... } 2 | # key: inject 3 | # -- 4 | inject(${1:0}) { |${2:injection}, ${3:element}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/reject: -------------------------------------------------------------------------------- 1 | # name: reject { |...| ... } 2 | # key: reject 3 | # -- 4 | reject { |${1:element}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/select: -------------------------------------------------------------------------------- 1 | # name: select { |...| ... } 2 | # key: select 3 | # -- 4 | select { |${1:element}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/collections/zip: -------------------------------------------------------------------------------- 1 | #name : zip(...) { |...| ... } 2 | # key: collectionszip 3 | # -- 4 | zip(${enums}) { |${row}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/control structure/forin: -------------------------------------------------------------------------------- 1 | # name: for ... in ...; ... end 2 | # key: forin 3 | # -- 4 | for ${1:element} in ${2:collection} 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/control structure/if: -------------------------------------------------------------------------------- 1 | # name: if ... end 2 | # key: if 3 | # -- 4 | if ${1:condition} 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/control structure/ife: -------------------------------------------------------------------------------- 1 | # name: if ... else ... end 2 | # key: ife 3 | # -- 4 | if ${1:condition} 5 | $2 6 | else 7 | $3 8 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/control structure/tim: -------------------------------------------------------------------------------- 1 | # name: times { |n| ... } 2 | # key: tim 3 | # -- 4 | times { |${n}| $0 } -------------------------------------------------------------------------------- /snippets/ruby-mode/control structure/until: -------------------------------------------------------------------------------- 1 | # name: until ... end 2 | # key: until 3 | # -- 4 | until ${condition} 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/control structure/upt: -------------------------------------------------------------------------------- 1 | # name: upto(...) { |n| ... } 2 | # key: upt 3 | # -- 4 | upto(${n}) { |${i}| 5 | $0 6 | } -------------------------------------------------------------------------------- /snippets/ruby-mode/control structure/when: -------------------------------------------------------------------------------- 1 | # name: when ... end 2 | # key: when 3 | # -- 4 | when ${condition} 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/control structure/while: -------------------------------------------------------------------------------- 1 | # name: while ... end 2 | # key: while 3 | # -- 4 | while ${condition} 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/definitions/Comp: -------------------------------------------------------------------------------- 1 | # name: include Comparable; def <=> ... end 2 | # key: Comp 3 | # -- 4 | include Comparable 5 | 6 | def <=> other 7 | $0 8 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/definitions/am: -------------------------------------------------------------------------------- 1 | # name: alias_method new, old 2 | # key: am 3 | # -- 4 | alias_method :${new_name}, :${old_name} -------------------------------------------------------------------------------- /snippets/ruby-mode/definitions/cla: -------------------------------------------------------------------------------- 1 | # name: class << self ... end 2 | # key: cla 3 | # -- 4 | class << ${self} 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/definitions/cls: -------------------------------------------------------------------------------- 1 | # name: class ... end 2 | # contributor: hitesh 3 | # key: cls 4 | # -- 5 | class ${1:`(let ((fn (capitalize (file-name-nondirectory 6 | (file-name-sans-extension 7 | (or (buffer-file-name) 8 | (buffer-name (current-buffer)))))))) 9 | (cond 10 | ((string-match "_" fn) (replace-match "" nil nil fn)) 11 | (t fn)))`} 12 | $0 13 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/definitions/mm: -------------------------------------------------------------------------------- 1 | # name: def method_missing ... end 2 | # key: mm 3 | # -- 4 | def method_missing(method, *args) 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/definitions/r: -------------------------------------------------------------------------------- 1 | # name: attr_reader ... 2 | # key: r 3 | # -- 4 | attr_reader : -------------------------------------------------------------------------------- /snippets/ruby-mode/definitions/rw: -------------------------------------------------------------------------------- 1 | # name: attr_accessor ... 2 | # key: rw 3 | # -- 4 | attr_accessor : -------------------------------------------------------------------------------- /snippets/ruby-mode/definitions/w: -------------------------------------------------------------------------------- 1 | # name: attr_writer ... 2 | # key: w 3 | # -- 4 | attr_writer : -------------------------------------------------------------------------------- /snippets/ruby-mode/general/#: -------------------------------------------------------------------------------- 1 | # name: # => 2 | # key: # 3 | # -- 4 | # => -------------------------------------------------------------------------------- /snippets/ruby-mode/general/=b: -------------------------------------------------------------------------------- 1 | # name: =begin rdoc ... =end 2 | # key: =b 3 | # -- 4 | =begin rdoc 5 | $0 6 | =end -------------------------------------------------------------------------------- /snippets/ruby-mode/general/app: -------------------------------------------------------------------------------- 1 | # name: if __FILE__ == $PROGRAM_NAME ... end 2 | # key: app 3 | # -- 4 | if __FILE__ == $PROGRAM_NAME 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/general/bm: -------------------------------------------------------------------------------- 1 | # name: Benchmark.bmbm(...) do ... end 2 | # key: bm 3 | # -- 4 | Benchmark.bmbm(${1:10}) do |x| 5 | $0 6 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/general/case: -------------------------------------------------------------------------------- 1 | # name: case ... end 2 | # key: case 3 | # -- 4 | case ${1:object} 5 | when ${2:condition} 6 | $0 7 | end -------------------------------------------------------------------------------- /snippets/ruby-mode/general/dee: -------------------------------------------------------------------------------- 1 | # name: deep_copy(...) 2 | # key: dee 3 | # -- 4 | Marshal.load(Marshal.dump($0)) -------------------------------------------------------------------------------- /snippets/ruby-mode/general/rb: -------------------------------------------------------------------------------- 1 | # name: /usr/bin/ruby -wKU 2 | # key: rb 3 | # -- 4 | #!/usr/bin/ruby -wKU -------------------------------------------------------------------------------- /snippets/ruby-mode/general/req: -------------------------------------------------------------------------------- 1 | # name: require "..." 2 | # key: req 3 | # -- 4 | require "$0" -------------------------------------------------------------------------------- /snippets/ruby-mode/general/rreq: -------------------------------------------------------------------------------- 1 | # name: require File.join(File.dirname(__FILE__), ...) 2 | # key: rreq 3 | # -- 4 | require File.join(File.dirname(__FILE__), $0) -------------------------------------------------------------------------------- /snippets/ruby-mode/general/y: -------------------------------------------------------------------------------- 1 | # name: :yields: arguments (rdoc) 2 | # key: y 3 | # -- 4 | :yields: $0 -------------------------------------------------------------------------------- /snippets/scala-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/scala-mode/act: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def act = { ..} 3 | # key: act 4 | # -- 5 | def act = { 6 | loop { 7 | react { 8 | $0 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /snippets/scala-mode/act.arg: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def act(arg: T) = { ..} 3 | # key: act 4 | # -- 5 | def act(${1:arg}: ${2:type}) = { 6 | loop { 7 | react { 8 | $0 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /snippets/scala-mode/actor: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: val a = actor { ..} 3 | # key: actor 4 | # -- 5 | val a = actor { 6 | loop { 7 | react { 8 | $0 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /snippets/scala-mode/ano: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: (args) => ... 3 | # key: ano 4 | # -- 5 | ($1) => ${2:body} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/app: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: object name extends Application 3 | # key: app 4 | # -- 5 | object ${1:name} extends Application { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/arr.new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: Array[T](..) 3 | # key: arr 4 | # -- 5 | Array[${1:value}](${2:args}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/arr.val-new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: val a = Array[T](..) 3 | # key: arr 4 | # -- 5 | val ${1:arr} = Array[${2:value}](${3:args}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/asof: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: asInstanceOf[T] 3 | # key: asof 4 | # -- 5 | asInstanceOf[${1:type}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/ass: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: assert(x === y) 3 | # key: ass 4 | # -- 5 | assert(${1:x} === ${2:y}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/ass.true: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: assert(true) 3 | # key: ass 4 | # -- 5 | assert(true) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/at.author: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: @author name 3 | # key: at 4 | # -- 5 | @author ${1:name} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/at.param: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: @param name description 3 | # key: at 4 | # -- 5 | @param ${1:name} ${2:description} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/at.return: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: @return description 3 | # key: at 4 | # -- 5 | @return ${1:description} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/at.version: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: @version number 3 | # key: at 4 | # -- 5 | @version ${1:0.1} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/bang: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: actor ! message 3 | # key: bang 4 | # -- 5 | ${1:actor} ! ${2:message} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/case: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: case pattern => 3 | # key: case 4 | # -- 5 | case ${1:pattern} => $0 -------------------------------------------------------------------------------- /snippets/scala-mode/case.match-all: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: case _ => 3 | # key: case 4 | # -- 5 | case _ => $0 -------------------------------------------------------------------------------- /snippets/scala-mode/cast: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: asInstanceOf[T] 3 | # key: cast 4 | # -- 5 | asInstanceOf[${1:type}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/cc: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: case class T(arg: A) 3 | # key: cc 4 | # -- 5 | case class ${1:name}(${2:arg}: ${3:type}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/cl: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: class T { .. } 3 | # key: cl 4 | # -- 5 | class ${1:name} { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/cl.abs: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: abstract class T { .. } 3 | # key: cl 4 | # -- 5 | abstract class ${1:name} { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/cl.abs-arg: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: abstract class T(args) { .. } 3 | # key: cl 4 | # -- 5 | abstract class ${1:name}(${2:args}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/cl.arg: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: class T(args) { .. } 3 | # key: cl 4 | # -- 5 | class ${1:name}(${2:args}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/clof: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: classOf[T] 3 | # key: clof 4 | # -- 5 | classOf[${1:type}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/co: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: case object T 3 | # key: co 4 | # -- 5 | case object ${1:name} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/cons: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: element1 :: element2 3 | # key: cons 4 | # -- 5 | ${1:element1} :: ${2:element2} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/cons.nil: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: element1 :: Nil 3 | # key: cons 4 | # -- 5 | ${1:element1} :: Nil $0 -------------------------------------------------------------------------------- /snippets/scala-mode/def.arg: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def f(arg: T) = ... 3 | # key: def 4 | # -- 5 | def ${1:name}(${2:args}) = $0 -------------------------------------------------------------------------------- /snippets/scala-mode/def.arg-body: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def f(arg: T) = {...} 3 | # key: def 4 | # -- 5 | def ${1:name}(${2:args}) = { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/def.arg-ret: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def f(arg: T): R = ... 3 | # key: def 4 | # -- 5 | def ${1:name}(${2:args}): ${3:Unit} = $0 -------------------------------------------------------------------------------- /snippets/scala-mode/def.arg-ret-body: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def f(arg: T): R = {...} 3 | # key: def 4 | # -- 5 | def ${1:name}(${2:args}): ${3:Unit} = { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/def.body: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def f = {...} 3 | # key: def 4 | # -- 5 | def ${1:name} = { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/def.ret: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def f: R = ... 3 | # key: def 4 | # -- 5 | def ${1:name}: ${2:Unit} = $0 -------------------------------------------------------------------------------- /snippets/scala-mode/def.ret-body: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def f: R = {...} 3 | # key: def 4 | # -- 5 | def ${1:name}: ${3:Unit} = { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/def.simple: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def f = ... 3 | # key: def 4 | # -- 5 | def ${1:name} = $0 -------------------------------------------------------------------------------- /snippets/scala-mode/doc.class: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: /** cls/trt/obj name */ 3 | # key: doc 4 | # -- 5 | /** 6 | * `(scala-mode-find-clstrtobj-name-doc)` 7 | * ${1:description} 8 | * $0 9 | */ -------------------------------------------------------------------------------- /snippets/scala-mode/doc.def: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: /** method name */ 3 | # key: doc 4 | # -- 5 | /** 6 | * `(scala-mode-def-and-args-doc)` 7 | */ -------------------------------------------------------------------------------- /snippets/scala-mode/doc.file: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: /** file name */ 3 | # key: doc 4 | # -- 5 | /** 6 | * `(scala-mode-file-doc)` 7 | * $0 8 | * @author ${1:name} 9 | * @version ${2:0.1} 10 | */ -------------------------------------------------------------------------------- /snippets/scala-mode/doc.file-scala: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: /** scala file */ 3 | # key: doc 4 | # -- 5 | /* __ *\ 6 | ** ________ ___ / / ___ Scala $3 ** 7 | ** / __/ __// _ | / / / _ | (c) 2005-`(format-time-string "%Y")` , LAMP/EPFL ** 8 | ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** 9 | ** /____/\___/_/ |_/____/_/ | | ** 10 | ** |/ ** 11 | \* */ 12 | /** 13 | * $0 14 | * @author ${1:name} 15 | * @version ${2:0.1} 16 | * $Id$ 17 | */ -------------------------------------------------------------------------------- /snippets/scala-mode/doc.file-scala-api: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: /** scala api file */ 3 | # key: doc 4 | # -- 5 | /* __ *\ 6 | ** ________ ___ / / ___ Scala API ** 7 | ** / __/ __// _ | / / / _ | (c) 2005-`(format-time-string "%Y")`, LAMP/EPFL ** 8 | ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** 9 | ** /____/\___/_/ |_/____/_/ | | ** 10 | ** |/ ** 11 | \* */ 12 | /** 13 | * $0 14 | * @author ${1:name} 15 | * @version ${2:0.1} 16 | * $Id$ 17 | */ -------------------------------------------------------------------------------- /snippets/scala-mode/doc.scaladoc: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: /** ... */ 3 | # key: doc 4 | # -- 5 | /** 6 | * ${1:description} 7 | * $0 8 | */ -------------------------------------------------------------------------------- /snippets/scala-mode/expect: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: expect(value) { ..} 3 | # key: expect 4 | # -- 5 | expect(${1:reply}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/ext: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: extends T 3 | # key: ext 4 | # -- 5 | extends $0 -------------------------------------------------------------------------------- /snippets/scala-mode/for.extract: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: x <- xs 3 | # key: for 4 | # -- 5 | ${1:x} <- ${2:xs} -------------------------------------------------------------------------------- /snippets/scala-mode/for.if: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: for (x <- xs if guard) { ... } 3 | # key: for 4 | # -- 5 | for (${1:x} <- ${2:xs} if ${3:guard}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/for.loop: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: for (x <- xs) { ... } 3 | # key: for 4 | # -- 5 | for (${1:x} <- ${2:xs}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/for.multi: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: for {x <- xs \ y <- ys} { yield } 3 | # key: for 4 | # -- 5 | for { 6 | ${1:x} <- ${2:xs} 7 | ${3:x} <- ${4:xs} 8 | } { 9 | yield $0 10 | } -------------------------------------------------------------------------------- /snippets/scala-mode/foreach: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: foreach(x => ..) 3 | # key: foreach 4 | # -- 5 | foreach(${1:x} => ${2:body}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/hmap.new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: new HashMap[K, V] 3 | # key: hmap 4 | # -- 5 | new HashMap[${1:key}, ${2:value}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/hmap.val-new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: val m = new HashMap[K, V] 3 | # key: hmap 4 | # -- 5 | val ${1:m} = new HashMap[${2:key}, ${3:value}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/hset.new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: new HashSet[K] 3 | # key: hset 4 | # -- 5 | new HashSet[${1:key}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/hset.val-new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: val m = new HashSet[K] 3 | # key: hset 4 | # -- 5 | val ${1:m} = new HashSet[${2:key}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/if: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: if (cond) { .. } 3 | # key: if 4 | # -- 5 | if (${1:condition}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/if.else: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: if (cond) { .. } else { .. } 3 | # key: if 4 | # -- 5 | if (${1:condition}) { 6 | $2 7 | } else { 8 | $0 9 | } -------------------------------------------------------------------------------- /snippets/scala-mode/imp: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: import .. 3 | # key: imp 4 | # -- 5 | import $0 -------------------------------------------------------------------------------- /snippets/scala-mode/intercept: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: intercept(classOf[T]) { ..} 3 | # key: intercept 4 | # -- 5 | intercept(classOf[${1:Exception]}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/isof: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: isInstanceOf[T] 3 | # key: isof 4 | # -- 5 | isInstanceOf[${1:type}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/ls.new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: List(..) 3 | # key: ls 4 | # -- 5 | List(${1:args}, ${2:args}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/ls.val-new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: val l = List(..) 3 | # key: ls 4 | # -- 5 | val ${1:l} = List(${2:args}, ${3:args}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/main: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: def main(args: Array[String]) = { ... } 3 | # key: main 4 | # -- 5 | def main(args: Array[String]) = { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/map: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: map(x => ..) 3 | # key: map 4 | # -- 5 | map(${1:x} => ${2:body}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/map.new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: Map(key -> value) 3 | # key: map 4 | # -- 5 | Map(${1:key} -> ${2:value}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/match: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: cc match { .. } 3 | # key: match 4 | # -- 5 | ${1:cc} match { 6 | case ${2:pattern} => $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/match.can: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: can match { case Full(res) => .. } 3 | # key: match 4 | # -- 5 | ${1:option} match { 6 | case Full(res) => $0 7 | 8 | case Empty => 9 | 10 | case Failure(msg, _, _) => 11 | 12 | } -------------------------------------------------------------------------------- /snippets/scala-mode/match.option: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: option match { case None => .. } 3 | # key: match 4 | # -- 5 | ${1:option} match { 6 | case None => $0 7 | case Some(res) => 8 | 9 | } -------------------------------------------------------------------------------- /snippets/scala-mode/mix: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: trait T { .. } 3 | # key: mix 4 | # -- 5 | trait ${1:name} { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/ob: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: object name extends T 3 | # key: ob 4 | # -- 5 | object ${1:name} extends ${2:type} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pac: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: package .. 3 | # key: pac 4 | # -- 5 | package $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pr.newline: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: println(..) 3 | # key: pr 4 | # -- 5 | println(${1:obj}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pr.simple: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: print(..) 3 | # key: pr 4 | # -- 5 | print(${1:obj}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pr.string: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: println("..") 3 | # key: pr 4 | # -- 5 | println("${1:msg}") $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pr.trace: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: println("obj: " + obj) 3 | # key: pr 4 | # -- 5 | println("${1:obj}: " + ${1:obj}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pri: -------------------------------------------------------------------------------- 1 | #Author : Jonas Bonèr 2 | #name : private 3 | # key: pri 4 | # -- 5 | private $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pri.param: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: private[this] 3 | # key: pri 4 | # -- 5 | private[${1:this}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pro: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: protected 3 | # key: pro 4 | # -- 5 | protected $0 -------------------------------------------------------------------------------- /snippets/scala-mode/pro.param: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: protected[this] 3 | # key: pro 4 | # -- 5 | protected[${1:this}] $0 -------------------------------------------------------------------------------- /snippets/scala-mode/suite: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: class T extends Suite { .. } 3 | # key: suite 4 | # -- 5 | import org.scalatest._ 6 | 7 | class ${1:name} extends Suite { 8 | $0 9 | } -------------------------------------------------------------------------------- /snippets/scala-mode/test: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: @Test def testX = ... 3 | # key: test 4 | # -- 5 | //@Test 6 | def test${1:name} = { 7 | $0 8 | } -------------------------------------------------------------------------------- /snippets/scala-mode/throw: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: throw new Exception 3 | # key: throw 4 | # -- 5 | throw new ${1:Exception}(${2:msg}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/tr: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: trait T { .. } 3 | # key: tr 4 | # -- 5 | trait ${1:name} { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/tr.ext: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: trait T extends C { .. } 3 | # key: tr 4 | # -- 5 | trait ${1:name} extends ${2:class} { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/tr.ext-with: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: trait T1 extends C with T2 { .. } 3 | # key: tr 4 | # -- 5 | trait ${1:name} extends ${2:class} with ${3:trait} { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/tr.with: -------------------------------------------------------------------------------- 1 | # Author: Anders Bach Nielsen 2 | # name: trait T1 with T2 { .. } 3 | # key: tr 4 | # -- 5 | trait ${1:name} with ${2:trait} { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/try: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: try { .. } catch { case e => ..} 3 | # key: try 4 | # -- 5 | try { 6 | $0 7 | } catch { 8 | case ${1:e}: ${2:Exception} => 9 | ${1:println(\"ERROR: \" + e) // TODO: handle exception}\n} 10 | } -------------------------------------------------------------------------------- /snippets/scala-mode/try.catch-finally: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: try { .. } catch { case e => ..} finally { ..} 3 | # key: try 4 | # -- 5 | try { 6 | $0 7 | } catch { 8 | case ${1:e}: ${2:Exception} => 9 | ${1:println(\"ERROR: \" + e) // TODO: handle exception}\n} 10 | } finally { 11 | 12 | } -------------------------------------------------------------------------------- /snippets/scala-mode/try.finally: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: try { .. } finally { .. } 3 | # key: try 4 | # -- 5 | try { 6 | 7 | } finally { 8 | $0 9 | } -------------------------------------------------------------------------------- /snippets/scala-mode/tup.arrow: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: element1 -> element2 3 | # key: tup 4 | # -- 5 | ${1:element1} -> ${2:element2} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/tup.paren: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: (element1, element2) 3 | # key: tup 4 | # -- 5 | (${1:element1}, ${2:element2}) $0 -------------------------------------------------------------------------------- /snippets/scala-mode/val: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: val name = .. 3 | # key: val 4 | # -- 5 | val ${1:name} = ${2:obj} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/val.new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: val name = new .. 3 | # key: val 4 | # -- 5 | val ${1:name} = new ${2:obj} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/val.ret: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: val name: T = .. 3 | # key: val 4 | # -- 5 | val ${1:name}: ${2:T} = ${3:obj} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/var: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: var name = .. 3 | # key: var 4 | # -- 5 | var ${1:name} = ${2:obj} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/var.new: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: var name = new .. 3 | # key: var 4 | # -- 5 | var ${1:name} = new ${2:obj} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/var.ret: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: var name: T = .. 3 | # key: var 4 | # -- 5 | var ${1:name}: ${2:T} = ${3:obj} $0 -------------------------------------------------------------------------------- /snippets/scala-mode/whi: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: while(cond) { .. } 3 | # key: whi 4 | # -- 5 | while (${1:condition}) { 6 | $0 7 | } -------------------------------------------------------------------------------- /snippets/scala-mode/with: -------------------------------------------------------------------------------- 1 | # Author: Jonas Bonèr 2 | # name: with T 3 | # key: with 4 | # -- 5 | with $0 -------------------------------------------------------------------------------- /snippets/snippet-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/snippet-mode/field: -------------------------------------------------------------------------------- 1 | # name: ${ ... } field 2 | # contributor: joaotavora 3 | # key: $f 4 | # key: field 5 | # -- 6 | \${${1:${2:n}:}$3${4:\$(${5:lisp-fn})}\}$0 -------------------------------------------------------------------------------- /snippets/snippet-mode/mirror: -------------------------------------------------------------------------------- 1 | # name: ${n:$(...)} mirror 2 | # key: $m 3 | # contributor: joaotavora 4 | # key: mirror 5 | # -- 6 | \${${2:n}:${4:\$(${5:reflection-fn})}\}$0 -------------------------------------------------------------------------------- /snippets/snippet-mode/vars: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Snippet header 3 | # contributor: joaotavora 4 | # key: vars 5 | # -- 6 | # name: $1${2: 7 | # key: ${3:trigger-key}}${4: 8 | # keybinding: ${5:keybinding}}${6: 9 | # expand-env: (${7:})} 10 | # contributor: $6 11 | # -- 12 | $0 -------------------------------------------------------------------------------- /snippets/sql-mode/.yas-parents: -------------------------------------------------------------------------------- 1 | text-mode 2 | -------------------------------------------------------------------------------- /snippets/sql-mode/column: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: , ColumnName ColumnType NOT NULL... 3 | # key: column 4 | # -- 5 | , ${1:Name} ${2:Type} ${3:NOT NULL} -------------------------------------------------------------------------------- /snippets/sql-mode/constraint: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: CONSTRAINT [..] PRIMARY KEY ... 3 | # key: constraint 4 | # -- 5 | CONSTRAINT [${1:PK_Name}] PRIMARY KEY ${2:CLUSTERED} ([${3:ColumnName}]) -------------------------------------------------------------------------------- /snippets/sql-mode/constraint.1: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: CONSTRAINT [..] FOREIGN KEY ... 3 | # key: constraint 4 | # -- 5 | CONSTRAINT [${1:FK_Name}] FOREIGN KEY ${2:CLUSTERED} ([${3:ColumnName}]) -------------------------------------------------------------------------------- /snippets/sql-mode/create: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: create table ... 3 | # key: create 4 | # -- 5 | CREATE TABLE [${1:dbo}].[${2:TableName}] 6 | ( 7 | ${3:Id} ${4:INT IDENTITY(1,1)} ${5:NOT NULL} 8 | $0 9 | CONSTRAINT [${6:PK_}] PRIMARY KEY ${7:CLUSTERED} ([$3]) 10 | ) 11 | GO -------------------------------------------------------------------------------- /snippets/sql-mode/create.1: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: create procedure ... 3 | # key: create 4 | # -- 5 | CREATE PROCEDURE [${1:dbo}].[${2:Name}] 6 | ( 7 | $3 $4 = ${5:NULL} ${6:OUTPUT} 8 | ) 9 | AS 10 | BEGIN 11 | $0 12 | END 13 | GO -------------------------------------------------------------------------------- /snippets/sql-mode/references: -------------------------------------------------------------------------------- 1 | # contributor: Alejandro Espinoza Esparza 2 | # name: REFERENCES ... 3 | # key: references 4 | # -- 5 | REFERENCES ${1:TableName}([${2:ColumnName}]) -------------------------------------------------------------------------------- /snippets/text-mode/email: -------------------------------------------------------------------------------- 1 | # name: (user's email) 2 | # key: email 3 | # -- 4 | `(replace-regexp-in-string "@" "@NOSPAM." user-mail-address)` -------------------------------------------------------------------------------- /snippets/text-mode/time: -------------------------------------------------------------------------------- 1 | # name: (current time) 2 | # key: time 3 | # -- 4 | `(current-time-string)` -------------------------------------------------------------------------------- /src/contacts.el: -------------------------------------------------------------------------------- 1 | ;;; contacts.el --- -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 2017 Seong-Kook Shin 4 | 5 | ;; Author: Seong-Kook Shin 6 | ;; Keywords: 7 | 8 | ;; This program is free software; you can redistribute it and/or modify 9 | ;; it under the terms of the GNU General Public License as published by 10 | ;; the Free Software Foundation, either version 3 of the License, or 11 | ;; (at your option) any later version. 12 | 13 | ;; This program is distributed in the hope that it will be useful, 14 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ;; GNU General Public License for more details. 17 | 18 | ;; You should have received a copy of the GNU General Public License 19 | ;; along with this program. If not, see . 20 | 21 | ;;; Commentary: 22 | 23 | ;; 24 | 25 | ;;; Code: 26 | 27 | 28 | (setq cinsk/contact-databases '(joyent-contacts)) 29 | 30 | (defun cinsk/update-contacts-database (decorator) 31 | (let ((database ())) 32 | (dolist (var cinsk/contact-databases) 33 | (let ((db (symbol-value var))) 34 | (dolist (rec db) 35 | (let ((key (car rec)) 36 | (fname (cadr rec)) 37 | (lname (caddr rec)) 38 | (email (cadddr rec))) 39 | (setq database (cons (cons (concat fname " " lname ", <" email ">") 40 | (apply decorator (list fname lname email))) 41 | database)))))) 42 | database)) 43 | 44 | (setq cinsk/contact-database (cinsk/update-contacts-database (lambda (f l e) (format "[[mailto:%s][%s %s]]" e f l)))) 45 | 46 | (setq cinsk/ido-completing-choices (mapcar (lambda (x) (car x)) cinsk/contact-database)) 47 | 48 | (defun cinsk/org-insert-contact () 49 | (interactive) 50 | (let ((contact (ido-completing-read "mailto: " cinsk/ido-completing-choices))) 51 | (insert (cdr (assoc contact cinsk/contact-database))))) 52 | 53 | (provide 'contacts) 54 | ;;; contacts.el ends here 55 | -------------------------------------------------------------------------------- /src/untabify.el: -------------------------------------------------------------------------------- 1 | ;;; untabify.el --- -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 2016 Seong-Kook Shin 4 | 5 | ;; Author: Seong-Kook Shin 6 | ;; Keywords: 7 | 8 | ;; This program is free software; you can redistribute it and/or modify 9 | ;; it under the terms of the GNU General Public License as published by 10 | ;; the Free Software Foundation, either version 3 of the License, or 11 | ;; (at your option) any later version. 12 | 13 | ;; This program is distributed in the hope that it will be useful, 14 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ;; GNU General Public License for more details. 17 | 18 | ;; You should have received a copy of the GNU General Public License 19 | ;; along with this program. If not, see . 20 | 21 | ;;; Commentary: 22 | 23 | ;; 24 | 25 | ;;; Code: 26 | 27 | ;; 28 | ;; TAB & space setting 29 | ;; 30 | (setq-default indent-tabs-mode nil) ; do not insert tab character. 31 | 32 | 33 | ;; These hook configuration ensures that all tab characters in C, C++ 34 | ;; source files are automatically converted to spaces on saving. 35 | (defvar untabify-remove-trailing-spaces-on-write-modes 36 | '(c-mode c++-mode java-mode emacs-lisp-mode lisp-mode nxml-mode) 37 | "List of major mode that needs to convert tab characters into spaces, 38 | and to remove trailing whitespaces") 39 | 40 | (defun untabify-remove-trailing-spaces-on-write () 41 | "Utility function that removes tabs and trailing whitespaces" 42 | (when (memq major-mode untabify-remove-trailing-spaces-on-write-modes) 43 | (untabify (point-min) (point-max)) 44 | (delete-trailing-whitespace)) 45 | ;; Should return nil so that if this function is registered into 46 | ;; `write-contents-functions', and if we need to propagate the control 47 | ;; to the other functions in `write-contents-functions'. 48 | ;; 49 | ;; Personally, this function should be registered into 50 | ;; `before-save-hook' anyway. 51 | nil) 52 | 53 | 54 | (provide 'untabify) 55 | ;;; untabify.el ends here 56 | --------------------------------------------------------------------------------