From 09a4099586657170cbdcff071b2d0fac5ed133b7 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 28 May 2026 02:12:40 -0700 Subject: oni-yasnippet: Move all snippets to ‘oni-yasnippet’ There is no real point in having them all separate. Having them all in a single place makes them much easier to manage. --- oni-bats.el | 55 +++++ oni-bats/Eldev | 13 -- oni-bats/oni-bats.el | 70 ------ oni-bats/snippets/bats-mode/test | 7 - oni-conf.el | 45 ++++ oni-conf/Eldev | 13 -- oni-conf/oni-conf.el | 62 ----- oni-conf/snippets/conf-mode/section | 8 - oni-csharp.el | 244 +++++++++++++++++++ oni-csharp/Eldev | 13 -- oni-csharp/oni-csharp.el | 259 --------------------- oni-csharp/snippets/csharp-mode/testm | 9 - oni-csharp/snippets/nxml-mode/Import | 6 - oni-css.el | 158 +++++++++++++ oni-css/Eldev | 13 -- oni-css/oni-css.el | 173 -------------- oni-css/snippets/css-mode/box-shadow | 5 - oni-elisp.el | 129 ++++++++++ oni-elisp/Eldev | 13 -- oni-elisp/oni-elisp.el | 144 ------------ oni-elisp/snippets/emacs-lisp-mode/cookie | 5 - oni-elisp/snippets/emacs-lisp-mode/depends-on | 5 - oni-elisp/snippets/emacs-lisp-mode/depends-on-git | 5 - oni-elisp/snippets/emacs-lisp-mode/face | 5 - oni-haml.el | 42 ++++ oni-haml/Eldev | 13 -- oni-haml/oni-haml.el | 59 ----- oni-haml/snippets/haml-mode/faq | 12 - oni-html.el | 43 ++++ oni-html/Eldev | 13 -- oni-html/oni-html.el | 60 ----- oni-html/snippets/html-mode/block | 7 - oni-html/snippets/html-mode/for | 8 - oni-html/snippets/html-mode/generic-block | 8 - oni-html/snippets/html-mode/script | 5 - oni-html/snippets/html-mode/trans-with-cap | 6 - oni-nxml.el | 53 +++++ oni-nxml/Eldev | 13 -- oni-nxml/oni-nxml.el | 69 ------ oni-nxml/snippets/nxml-mode/pencil-property | 7 - oni-nxml/snippets/nxml-mode/pencil-property-value | 5 - oni-nxml/snippets/nxml-mode/pencil-shortcut | 9 - oni-org/snippets/org-mode/codeblock | 7 - oni-org/snippets/org-mode/heading | 9 - oni-org/snippets/org-mode/project | 51 ---- oni-org/snippets/org-mode/snippet | 14 -- oni-org/snippets/org-mode/task | 10 - oni-php/snippets/php-mode/arrow-function | 6 - oni-php/snippets/php-mode/casts | 7 - oni-php/snippets/php-mode/class | 8 - oni-php/snippets/php-mode/constructor | 8 - oni-php/snippets/php-mode/factory | 6 - oni-php/snippets/php-mode/for | 7 - oni-php/snippets/php-mode/function-expression | 8 - oni-php/snippets/php-mode/function-statement | 11 - oni-php/snippets/php-mode/if-statement | 7 - oni-php/snippets/php-mode/logger-debug | 5 - oni-php/snippets/php-mode/logger-error | 5 - oni-php/snippets/php-mode/logger-info | 5 - oni-php/snippets/php-mode/logger-warning | 5 - oni-php/snippets/php-mode/mark-test-skipped | 6 - oni-php/snippets/php-mode/namespace | 5 - oni-php/snippets/php-mode/php | 5 - oni-php/snippets/php-mode/phpstan-ignore | 5 - oni-php/snippets/php-mode/strict-types | 5 - oni-php/snippets/php-mode/test-class | 14 -- oni-php/snippets/php-mode/test-comment | 9 - oni-php/snippets/php-mode/test-name | 8 - oni-php/snippets/php-mode/todo-comment | 5 - oni-php/snippets/php-mode/var | 5 - oni-php/snippets/php-mode/wpheader.php | 13 -- oni-php/snippets/php-ts-mode/.yas-parents | 1 - oni-python.el | 100 ++++++++ oni-python/Eldev | 13 -- oni-python/oni-python.el | 115 --------- oni-python/snippets/python-mode/defm_empty | 7 - oni-python/snippets/python-mode/form | 9 - oni-python/snippets/python-mode/form_valid | 8 - .../snippets/python-mode/form_valid_with_return | 8 - oni-python/snippets/python-mode/import_from | 6 - oni-python/snippets/python-mode/method | 7 - oni-python/snippets/python-mode/permission_guard | 9 - oni-python/snippets/python-mode/url | 5 - oni-ruby.el | 46 ++++ oni-ruby/Eldev | 13 -- oni-ruby/oni-ruby.el | 62 ----- oni-ruby/snippets/ruby-mode/ProductSeed | 5 - oni-ruby/snippets/ruby-mode/ProductSeedHW | 5 - oni-ruby/snippets/ruby-mode/ProductSeedHWGroup | 8 - oni-ruby/snippets/ruby-mode/describe | 7 - oni-ruby/snippets/ruby-mode/do | 6 - oni-ruby/snippets/ruby-mode/factory | 9 - oni-ruby/snippets/ruby-mode/fill_in | 5 - oni-ruby/snippets/ruby-mode/mod | 11 - oni-ruby/snippets/ruby-mode/reduce | 5 - oni-twig.el | 43 ++++ oni-twig/Eldev | 13 -- oni-twig/oni-twig.el | 59 ----- oni-twig/snippets/twig-mode/_self | 5 - oni-twig/snippets/twig-mode/blk | 7 - oni-twig/snippets/twig-mode/def | 7 - oni-twig/snippets/twig-mode/ext | 5 - oni-twig/snippets/twig-mode/for | 7 - oni-twig/snippets/twig-mode/if | 7 - oni-twig/snippets/twig-mode/ife | 9 - oni-twig/snippets/twig-mode/iif | 5 - oni-twig/snippets/twig-mode/imp | 7 - oni-twig/snippets/twig-mode/mac | 7 - oni-twig/snippets/twig-mode/set | 5 - oni-yasnippet.el | 63 ----- oni-yasnippet/oni-yasnippet.el | 78 +++++++ oni-yasnippet/snippets/bats-mode/test | 7 + oni-yasnippet/snippets/conf-mode/section | 8 + oni-yasnippet/snippets/csharp-mode/testm | 9 + oni-yasnippet/snippets/css-mode/box-shadow | 5 + oni-yasnippet/snippets/emacs-lisp-mode/cookie | 5 + oni-yasnippet/snippets/emacs-lisp-mode/depends-on | 5 + .../snippets/emacs-lisp-mode/depends-on-git | 5 + oni-yasnippet/snippets/emacs-lisp-mode/face | 5 + oni-yasnippet/snippets/haml-mode/faq | 12 + oni-yasnippet/snippets/html-mode/block | 7 + oni-yasnippet/snippets/html-mode/for | 8 + oni-yasnippet/snippets/html-mode/generic-block | 8 + oni-yasnippet/snippets/html-mode/script | 5 + oni-yasnippet/snippets/html-mode/trans-with-cap | 6 + oni-yasnippet/snippets/nxml-mode/Import | 6 + oni-yasnippet/snippets/nxml-mode/pencil-property | 7 + .../snippets/nxml-mode/pencil-property-value | 5 + oni-yasnippet/snippets/nxml-mode/pencil-shortcut | 9 + oni-yasnippet/snippets/org-mode/codeblock | 7 + oni-yasnippet/snippets/org-mode/heading | 9 + oni-yasnippet/snippets/org-mode/project | 51 ++++ oni-yasnippet/snippets/org-mode/snippet | 14 ++ oni-yasnippet/snippets/org-mode/task | 10 + oni-yasnippet/snippets/php-mode/arrow-function | 6 + oni-yasnippet/snippets/php-mode/casts | 7 + oni-yasnippet/snippets/php-mode/class | 8 + oni-yasnippet/snippets/php-mode/constructor | 8 + oni-yasnippet/snippets/php-mode/factory | 6 + oni-yasnippet/snippets/php-mode/for | 7 + .../snippets/php-mode/function-expression | 8 + oni-yasnippet/snippets/php-mode/function-statement | 11 + oni-yasnippet/snippets/php-mode/if-statement | 7 + oni-yasnippet/snippets/php-mode/logger-debug | 5 + oni-yasnippet/snippets/php-mode/logger-error | 5 + oni-yasnippet/snippets/php-mode/logger-info | 5 + oni-yasnippet/snippets/php-mode/logger-warning | 5 + oni-yasnippet/snippets/php-mode/mark-test-skipped | 6 + oni-yasnippet/snippets/php-mode/namespace | 5 + oni-yasnippet/snippets/php-mode/php | 5 + oni-yasnippet/snippets/php-mode/phpstan-ignore | 5 + oni-yasnippet/snippets/php-mode/strict-types | 5 + oni-yasnippet/snippets/php-mode/test-class | 14 ++ oni-yasnippet/snippets/php-mode/test-comment | 9 + oni-yasnippet/snippets/php-mode/test-name | 8 + oni-yasnippet/snippets/php-mode/todo-comment | 5 + oni-yasnippet/snippets/php-mode/var | 5 + oni-yasnippet/snippets/php-mode/wpheader.php | 13 ++ oni-yasnippet/snippets/php-ts-mode/.yas-parents | 1 + oni-yasnippet/snippets/python-mode/defm_empty | 7 + oni-yasnippet/snippets/python-mode/form | 9 + oni-yasnippet/snippets/python-mode/form_valid | 8 + .../snippets/python-mode/form_valid_with_return | 8 + oni-yasnippet/snippets/python-mode/import_from | 6 + oni-yasnippet/snippets/python-mode/method | 7 + .../snippets/python-mode/permission_guard | 9 + oni-yasnippet/snippets/python-mode/url | 5 + oni-yasnippet/snippets/ruby-mode/ProductSeed | 5 + oni-yasnippet/snippets/ruby-mode/ProductSeedHW | 5 + .../snippets/ruby-mode/ProductSeedHWGroup | 8 + oni-yasnippet/snippets/ruby-mode/describe | 7 + oni-yasnippet/snippets/ruby-mode/do | 6 + oni-yasnippet/snippets/ruby-mode/factory | 9 + oni-yasnippet/snippets/ruby-mode/fill_in | 5 + oni-yasnippet/snippets/ruby-mode/mod | 11 + oni-yasnippet/snippets/ruby-mode/reduce | 5 + oni-yasnippet/snippets/twig-mode/_self | 5 + oni-yasnippet/snippets/twig-mode/blk | 7 + oni-yasnippet/snippets/twig-mode/def | 7 + oni-yasnippet/snippets/twig-mode/ext | 5 + oni-yasnippet/snippets/twig-mode/for | 7 + oni-yasnippet/snippets/twig-mode/if | 7 + oni-yasnippet/snippets/twig-mode/ife | 9 + oni-yasnippet/snippets/twig-mode/iif | 5 + oni-yasnippet/snippets/twig-mode/imp | 7 + oni-yasnippet/snippets/twig-mode/mac | 7 + oni-yasnippet/snippets/twig-mode/set | 5 + 187 files changed, 1609 insertions(+), 1911 deletions(-) create mode 100644 oni-bats.el delete mode 100644 oni-bats/Eldev delete mode 100644 oni-bats/oni-bats.el delete mode 100644 oni-bats/snippets/bats-mode/test create mode 100644 oni-conf.el delete mode 100644 oni-conf/Eldev delete mode 100644 oni-conf/oni-conf.el delete mode 100644 oni-conf/snippets/conf-mode/section create mode 100644 oni-csharp.el delete mode 100644 oni-csharp/Eldev delete mode 100644 oni-csharp/oni-csharp.el delete mode 100644 oni-csharp/snippets/csharp-mode/testm delete mode 100644 oni-csharp/snippets/nxml-mode/Import create mode 100644 oni-css.el delete mode 100644 oni-css/Eldev delete mode 100644 oni-css/oni-css.el delete mode 100644 oni-css/snippets/css-mode/box-shadow create mode 100644 oni-elisp.el delete mode 100644 oni-elisp/Eldev delete mode 100644 oni-elisp/oni-elisp.el delete mode 100644 oni-elisp/snippets/emacs-lisp-mode/cookie delete mode 100644 oni-elisp/snippets/emacs-lisp-mode/depends-on delete mode 100644 oni-elisp/snippets/emacs-lisp-mode/depends-on-git delete mode 100644 oni-elisp/snippets/emacs-lisp-mode/face create mode 100644 oni-haml.el delete mode 100644 oni-haml/Eldev delete mode 100644 oni-haml/oni-haml.el delete mode 100644 oni-haml/snippets/haml-mode/faq create mode 100644 oni-html.el delete mode 100644 oni-html/Eldev delete mode 100644 oni-html/oni-html.el delete mode 100644 oni-html/snippets/html-mode/block delete mode 100644 oni-html/snippets/html-mode/for delete mode 100644 oni-html/snippets/html-mode/generic-block delete mode 100644 oni-html/snippets/html-mode/script delete mode 100644 oni-html/snippets/html-mode/trans-with-cap create mode 100644 oni-nxml.el delete mode 100644 oni-nxml/Eldev delete mode 100644 oni-nxml/oni-nxml.el delete mode 100644 oni-nxml/snippets/nxml-mode/pencil-property delete mode 100644 oni-nxml/snippets/nxml-mode/pencil-property-value delete mode 100644 oni-nxml/snippets/nxml-mode/pencil-shortcut delete mode 100644 oni-org/snippets/org-mode/codeblock delete mode 100644 oni-org/snippets/org-mode/heading delete mode 100644 oni-org/snippets/org-mode/project delete mode 100644 oni-org/snippets/org-mode/snippet delete mode 100644 oni-org/snippets/org-mode/task delete mode 100644 oni-php/snippets/php-mode/arrow-function delete mode 100644 oni-php/snippets/php-mode/casts delete mode 100644 oni-php/snippets/php-mode/class delete mode 100644 oni-php/snippets/php-mode/constructor delete mode 100644 oni-php/snippets/php-mode/factory delete mode 100644 oni-php/snippets/php-mode/for delete mode 100644 oni-php/snippets/php-mode/function-expression delete mode 100644 oni-php/snippets/php-mode/function-statement delete mode 100644 oni-php/snippets/php-mode/if-statement delete mode 100644 oni-php/snippets/php-mode/logger-debug delete mode 100644 oni-php/snippets/php-mode/logger-error delete mode 100644 oni-php/snippets/php-mode/logger-info delete mode 100644 oni-php/snippets/php-mode/logger-warning delete mode 100644 oni-php/snippets/php-mode/mark-test-skipped delete mode 100644 oni-php/snippets/php-mode/namespace delete mode 100644 oni-php/snippets/php-mode/php delete mode 100644 oni-php/snippets/php-mode/phpstan-ignore delete mode 100644 oni-php/snippets/php-mode/strict-types delete mode 100644 oni-php/snippets/php-mode/test-class delete mode 100644 oni-php/snippets/php-mode/test-comment delete mode 100644 oni-php/snippets/php-mode/test-name delete mode 100644 oni-php/snippets/php-mode/todo-comment delete mode 100644 oni-php/snippets/php-mode/var delete mode 100644 oni-php/snippets/php-mode/wpheader.php delete mode 100644 oni-php/snippets/php-ts-mode/.yas-parents create mode 100644 oni-python.el delete mode 100644 oni-python/Eldev delete mode 100644 oni-python/oni-python.el delete mode 100644 oni-python/snippets/python-mode/defm_empty delete mode 100644 oni-python/snippets/python-mode/form delete mode 100644 oni-python/snippets/python-mode/form_valid delete mode 100644 oni-python/snippets/python-mode/form_valid_with_return delete mode 100644 oni-python/snippets/python-mode/import_from delete mode 100644 oni-python/snippets/python-mode/method delete mode 100644 oni-python/snippets/python-mode/permission_guard delete mode 100644 oni-python/snippets/python-mode/url create mode 100644 oni-ruby.el delete mode 100644 oni-ruby/Eldev delete mode 100644 oni-ruby/oni-ruby.el delete mode 100644 oni-ruby/snippets/ruby-mode/ProductSeed delete mode 100644 oni-ruby/snippets/ruby-mode/ProductSeedHW delete mode 100644 oni-ruby/snippets/ruby-mode/ProductSeedHWGroup delete mode 100644 oni-ruby/snippets/ruby-mode/describe delete mode 100644 oni-ruby/snippets/ruby-mode/do delete mode 100644 oni-ruby/snippets/ruby-mode/factory delete mode 100644 oni-ruby/snippets/ruby-mode/fill_in delete mode 100644 oni-ruby/snippets/ruby-mode/mod delete mode 100644 oni-ruby/snippets/ruby-mode/reduce create mode 100644 oni-twig.el delete mode 100644 oni-twig/Eldev delete mode 100644 oni-twig/oni-twig.el delete mode 100644 oni-twig/snippets/twig-mode/_self delete mode 100644 oni-twig/snippets/twig-mode/blk delete mode 100644 oni-twig/snippets/twig-mode/def delete mode 100644 oni-twig/snippets/twig-mode/ext delete mode 100644 oni-twig/snippets/twig-mode/for delete mode 100644 oni-twig/snippets/twig-mode/if delete mode 100644 oni-twig/snippets/twig-mode/ife delete mode 100644 oni-twig/snippets/twig-mode/iif delete mode 100644 oni-twig/snippets/twig-mode/imp delete mode 100644 oni-twig/snippets/twig-mode/mac delete mode 100644 oni-twig/snippets/twig-mode/set delete mode 100644 oni-yasnippet.el create mode 100644 oni-yasnippet/oni-yasnippet.el create mode 100644 oni-yasnippet/snippets/bats-mode/test create mode 100644 oni-yasnippet/snippets/conf-mode/section create mode 100644 oni-yasnippet/snippets/csharp-mode/testm create mode 100644 oni-yasnippet/snippets/css-mode/box-shadow create mode 100644 oni-yasnippet/snippets/emacs-lisp-mode/cookie create mode 100644 oni-yasnippet/snippets/emacs-lisp-mode/depends-on create mode 100644 oni-yasnippet/snippets/emacs-lisp-mode/depends-on-git create mode 100644 oni-yasnippet/snippets/emacs-lisp-mode/face create mode 100644 oni-yasnippet/snippets/haml-mode/faq create mode 100644 oni-yasnippet/snippets/html-mode/block create mode 100644 oni-yasnippet/snippets/html-mode/for create mode 100644 oni-yasnippet/snippets/html-mode/generic-block create mode 100644 oni-yasnippet/snippets/html-mode/script create mode 100644 oni-yasnippet/snippets/html-mode/trans-with-cap create mode 100644 oni-yasnippet/snippets/nxml-mode/Import create mode 100644 oni-yasnippet/snippets/nxml-mode/pencil-property create mode 100644 oni-yasnippet/snippets/nxml-mode/pencil-property-value create mode 100644 oni-yasnippet/snippets/nxml-mode/pencil-shortcut create mode 100644 oni-yasnippet/snippets/org-mode/codeblock create mode 100644 oni-yasnippet/snippets/org-mode/heading create mode 100644 oni-yasnippet/snippets/org-mode/project create mode 100644 oni-yasnippet/snippets/org-mode/snippet create mode 100644 oni-yasnippet/snippets/org-mode/task create mode 100644 oni-yasnippet/snippets/php-mode/arrow-function create mode 100644 oni-yasnippet/snippets/php-mode/casts create mode 100644 oni-yasnippet/snippets/php-mode/class create mode 100644 oni-yasnippet/snippets/php-mode/constructor create mode 100644 oni-yasnippet/snippets/php-mode/factory create mode 100644 oni-yasnippet/snippets/php-mode/for create mode 100644 oni-yasnippet/snippets/php-mode/function-expression create mode 100644 oni-yasnippet/snippets/php-mode/function-statement create mode 100644 oni-yasnippet/snippets/php-mode/if-statement create mode 100644 oni-yasnippet/snippets/php-mode/logger-debug create mode 100644 oni-yasnippet/snippets/php-mode/logger-error create mode 100644 oni-yasnippet/snippets/php-mode/logger-info create mode 100644 oni-yasnippet/snippets/php-mode/logger-warning create mode 100644 oni-yasnippet/snippets/php-mode/mark-test-skipped create mode 100644 oni-yasnippet/snippets/php-mode/namespace create mode 100644 oni-yasnippet/snippets/php-mode/php create mode 100644 oni-yasnippet/snippets/php-mode/phpstan-ignore create mode 100644 oni-yasnippet/snippets/php-mode/strict-types create mode 100644 oni-yasnippet/snippets/php-mode/test-class create mode 100644 oni-yasnippet/snippets/php-mode/test-comment create mode 100644 oni-yasnippet/snippets/php-mode/test-name create mode 100644 oni-yasnippet/snippets/php-mode/todo-comment create mode 100644 oni-yasnippet/snippets/php-mode/var create mode 100644 oni-yasnippet/snippets/php-mode/wpheader.php create mode 100644 oni-yasnippet/snippets/php-ts-mode/.yas-parents create mode 100644 oni-yasnippet/snippets/python-mode/defm_empty create mode 100644 oni-yasnippet/snippets/python-mode/form create mode 100644 oni-yasnippet/snippets/python-mode/form_valid create mode 100644 oni-yasnippet/snippets/python-mode/form_valid_with_return create mode 100644 oni-yasnippet/snippets/python-mode/import_from create mode 100644 oni-yasnippet/snippets/python-mode/method create mode 100644 oni-yasnippet/snippets/python-mode/permission_guard create mode 100644 oni-yasnippet/snippets/python-mode/url create mode 100644 oni-yasnippet/snippets/ruby-mode/ProductSeed create mode 100644 oni-yasnippet/snippets/ruby-mode/ProductSeedHW create mode 100644 oni-yasnippet/snippets/ruby-mode/ProductSeedHWGroup create mode 100644 oni-yasnippet/snippets/ruby-mode/describe create mode 100644 oni-yasnippet/snippets/ruby-mode/do create mode 100644 oni-yasnippet/snippets/ruby-mode/factory create mode 100644 oni-yasnippet/snippets/ruby-mode/fill_in create mode 100644 oni-yasnippet/snippets/ruby-mode/mod create mode 100644 oni-yasnippet/snippets/ruby-mode/reduce create mode 100644 oni-yasnippet/snippets/twig-mode/_self create mode 100644 oni-yasnippet/snippets/twig-mode/blk create mode 100644 oni-yasnippet/snippets/twig-mode/def create mode 100644 oni-yasnippet/snippets/twig-mode/ext create mode 100644 oni-yasnippet/snippets/twig-mode/for create mode 100644 oni-yasnippet/snippets/twig-mode/if create mode 100644 oni-yasnippet/snippets/twig-mode/ife create mode 100644 oni-yasnippet/snippets/twig-mode/iif create mode 100644 oni-yasnippet/snippets/twig-mode/imp create mode 100644 oni-yasnippet/snippets/twig-mode/mac create mode 100644 oni-yasnippet/snippets/twig-mode/set diff --git a/oni-bats.el b/oni-bats.el new file mode 100644 index 0000000..eaaea14 --- /dev/null +++ b/oni-bats.el @@ -0,0 +1,55 @@ +;;; oni-bats.el --- Configuration for bats-mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.002728 +;; Package-Requires: (bats-mode oni-sh) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Configuration for ‘bats-mode’. + +;; This configuration pulls in ‘oni-sh’ because ‘bats-mode’ is derived from +;; ‘sh-mode’. Add the following to your init file in case you want to use this +;; configuration: +;; +;; (with-eval-after-load 'bats-mode (require 'oni-bats)) + +;;; Code: + +(require 'autoinsert) +(require 'oni-sh) + +(defconst oni-bats-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-bats’ was loaded from.") + +(defun oni-bats-disable-shfmt-on-save-mode () + "Disable ‘shfmt-on-save-mode’." + (shfmt-on-save-mode -1)) + +(add-hook 'bats-mode-hook #'oni-bats-disable-shfmt-on-save-mode) + +;;;###autoload +(with-eval-after-load 'autoinsert + (add-to-list 'auto-insert-alist '(bats-mode nil "#!/usr/bin/env bats\n\n"))) + +(provide 'oni-bats) +;;; oni-bats.el ends here diff --git a/oni-bats/Eldev b/oni-bats/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-bats/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-bats/oni-bats.el b/oni-bats/oni-bats.el deleted file mode 100644 index 2c2b9f7..0000000 --- a/oni-bats/oni-bats.el +++ /dev/null @@ -1,70 +0,0 @@ -;;; oni-bats.el --- Configuration for bats-mode -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2021.1201.134023 -;; Package-Requires: (bats-mode oni-sh oni-yasnippet) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Configuration for ‘bats-mode’. - -;; This configuration pulls in ‘oni-sh’ because ‘bats-mode’ is derived from -;; ‘sh-mode’. Add the following to your init file in case you want to use this -;; configuration: -;; -;; (with-eval-after-load 'bats-mode (require 'oni-bats)) - -;;; Code: - -(require 'autoinsert) -(require 'oni-sh) -(require 'yasnippet) - -(defconst oni-bats-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-bats’ was loaded from.") - -(defconst oni-bats-snippets-dir - (expand-file-name "snippets" oni-bats-root) - "The directory where ‘oni-bats’ stores its snippets.") - -(defun oni-bats-disable-shfmt-on-save-mode () - "Disable ‘shfmt-on-save-mode’." - (shfmt-on-save-mode -1)) - -(defun oni-bats-snippets-initialize () - "Initialize the snippets for ‘oni-bats’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-bats-snippets-dir t)) - (yas-load-directory oni-bats-snippets-dir)) - -(add-hook 'bats-mode-hook #'oni-bats-disable-shfmt-on-save-mode) - -;;;###autoload -(with-eval-after-load 'autoinsert - (add-to-list 'auto-insert-alist '(bats-mode nil "#!/usr/bin/env bats\n\n"))) - -(with-eval-after-load 'bats-mode - (with-eval-after-load 'yasnippet - (oni-bats-snippets-initialize))) - -(provide 'oni-bats) -;;; oni-bats.el ends here diff --git a/oni-bats/snippets/bats-mode/test b/oni-bats/snippets/bats-mode/test deleted file mode 100644 index 8a2f028..0000000 --- a/oni-bats/snippets/bats-mode/test +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: test -# key: test -# -- -@test "$1" { - $0 -} \ No newline at end of file diff --git a/oni-conf.el b/oni-conf.el new file mode 100644 index 0000000..787d6fc --- /dev/null +++ b/oni-conf.el @@ -0,0 +1,45 @@ +;;; oni-conf.el --- Conf-mode configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.002815 + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Configuration for the different ‘conf-mode’ variations. + +;;; Code: + +(defconst oni-conf-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-conf’ was loaded from.") + +(defun oni-conf--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + +(add-hook 'conf-mode-hook 'oni-conf--auto-fill-mode) + +;;;###autoload +(add-to-list 'auto-mode-alist `(,(rx ".service" string-end) . conf-mode)) + +(provide 'oni-conf) +;;; oni-conf.el ends here diff --git a/oni-conf/Eldev b/oni-conf/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-conf/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-conf/oni-conf.el b/oni-conf/oni-conf.el deleted file mode 100644 index b3787cb..0000000 --- a/oni-conf/oni-conf.el +++ /dev/null @@ -1,62 +0,0 @@ -;;; oni-conf.el --- Conf-mode configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2021.1201.134001 -;; Package-Requires: (oni-yasnippet) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Configuration for the different ‘conf-mode’ variations. - -;;; Code: - -(require 'yasnippet) - -(defconst oni-conf-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-conf’ was loaded from.") - -(defconst oni-conf-snippets-dir - (expand-file-name "snippets" oni-conf-root) - "The directory where ‘oni-conf’ stores its snippets.") - -(defun oni-conf-snippets-initialize () - "Initialize the snippets for ‘oni-conf’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-conf-snippets-dir t)) - (yas-load-directory oni-conf-snippets-dir)) - -(defun oni-conf--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." - (setq-local comment-auto-fill-only-comments t) - (auto-fill-mode)) - -(add-hook 'conf-mode-hook 'oni-conf--auto-fill-mode) - -;;;###autoload -(add-to-list 'auto-mode-alist `(,(rx ".service" string-end) . conf-mode)) - -(with-eval-after-load 'conf-mode - (with-eval-after-load 'yasnippet - (oni-conf-snippets-initialize))) - -(provide 'oni-conf) -;;; oni-conf.el ends here diff --git a/oni-conf/snippets/conf-mode/section b/oni-conf/snippets/conf-mode/section deleted file mode 100644 index 496e4fd..0000000 --- a/oni-conf/snippets/conf-mode/section +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: Xorg Section -# key: Section -# -- -Section "$1" - Identifier "$2" - $0 -EndSection diff --git a/oni-csharp.el b/oni-csharp.el new file mode 100644 index 0000000..09e4e0a --- /dev/null +++ b/oni-csharp.el @@ -0,0 +1,244 @@ +;;; oni-csharp.el --- C# Configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.002902 +;; Package-Requires: (csharp-mode oni-company oni-flycheck oni-hydra oni-lsp oni-smartparens) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My C# configuration. This configuration enables ‘rainbow-delimiters-mode’. + +;;; Code: + +(require 'company) +(require 'csharp-mode) +(require 'hydra) + +(defconst oni-csharp-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-csharp’ was loaded from.") + +(defcustom oni-csharp-devenv-executable + "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\devenv.com\"" + "The location of the devenv.com executable." + :group 'oni-csharp) + +(defvar oni-csharp--projects (make-hash-table :test 'equal)) + +(defhydra oni-csharp-hydra (:color teal :hint nil) + " +^Compile^ +^^------------ +_cp_: Project +_cs_: Solution +^^ +" + ("cp" oni-csharp-compile-project) + ("cs" oni-csharp-compile-solution)) + +(defun oni-csharp-compile-solution () + (interactive) + (let ((compile-command (concat oni-csharp-devenv-executable " /Build Debug " (oni-csharp-locate-dominating-file-wildcard "*.sln")))) + (compile compile-command))) + +(defun oni-csharp-locate-dominating-file-wildcard (filename) + (let (file-list + (default-directory default-directory)) + (while (and (null file-list) + (string-prefix-p (projectile-project-root) default-directory)) + (setq file-list (file-expand-wildcards filename t) + default-directory (file-name-directory (directory-file-name default-directory)))) + (car file-list))) + +(defun oni-csharp-compile-project () + (interactive) + (let ((compile-command (concat oni-csharp-devenv-executable " /Build Debug " (oni-csharp-locate-dominating-file-wildcard "*.sln") " /project " (oni-csharp-locate-dominating-file-wildcard "*.csproj")))) + (compile compile-command))) + +(defun oni-csharp--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + +(defun oni-csharp--update-style () + "Set style rules according to personal (or recommended) preference." + (c-set-offset 'arglist-intro '+) + (c-set-offset 'arglist-cont-nonempty '+)) + +(add-hook 'csharp-mode-hook 'abbrev-mode) +(add-hook 'csharp-mode-hook 'company-mode) +(add-hook 'csharp-mode-hook 'display-fill-column-indicator-mode) +(add-hook 'csharp-mode-hook 'electric-indent-local-mode) +(add-hook 'csharp-mode-hook 'flycheck-mode) +(add-hook 'csharp-mode-hook 'lsp) +(add-hook 'csharp-mode-hook 'oni-csharp--auto-fill-mode) +(add-hook 'csharp-mode-hook 'oni-csharp--update-style) +(add-hook 'csharp-mode-hook 'rainbow-delimiters-mode) +(add-hook 'csharp-mode-hook 'smartparens-mode) + +(define-key csharp-mode-map (kbd "C-c SPC") 'oni-csharp-hydra/body) + +(define-abbrev csharp-mode-abbrev-table "and" "&&" nil :system t) +(define-abbrev csharp-mode-abbrev-table "or" "||" nil :system t) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.xaml\\'" . nxml-mode)) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.targets\\'" . nxml-mode)) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.proj\\'". nxml-mode)) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.csproj\\'" . nxml-mode)) + +(with-eval-after-load 'autoinsert + (add-to-list 'auto-insert-alist + `(,(rx ".proj" string-end) + nil + "\n " _ "\n"))) + +(with-eval-after-load 'lsp-csharp + (when (eq system-type 'windows-nt) + (setq lsp-csharp-omnisharp-roslyn-server-dir + (expand-file-name "~/scoop/apps/omnisharp/current")))) + +(with-eval-after-load 'compile + (add-to-list 'compilation-error-regexp-alist + `(,(rx (minimal-match (one-or-more digit)) ">" + (group (any alpha) + ":\\" + (minimal-match (one-or-more (any alpha "\\" ".")))) + "(" + (group (minimal-match (one-or-more digit))) + "," + (group (minimal-match (one-or-more digit))) + "," + (group (minimal-match (one-or-more digit))) + "," + (group (minimal-match (one-or-more digit))) + "): " + (group "error" (one-or-more any))) + 1 (2 . 4) (3 . 5) 2 6))) + +;;; Solution mode + +(defun oni-csharp-collect-project-names () + "Go through the current buffer and collect all the project names." + (interactive) + (clrhash oni-csharp--projects) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward + (rx bol + "Project(\"{" + (group (minimal-match (1+ (or alphanumeric "-")))) + "}\") = \"" + (group (minimal-match (1+ any))) + "\", \"" + (minimal-match (1+ any)) + "\", \"{" + (group (minimal-match (1+ any))) + "}\"" + eol) + nil + :noerror) + (puthash (match-string-no-properties 3) + (match-string-no-properties 2) + oni-csharp--projects)))) + +(defun oni-csharp-display-project-names () + "Display the project names in the current buffer." + (interactive) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward + (rx bol + (zero-or-more whitespace) + (group + "{" + (group (minimal-match (one-or-more (or alphanumeric "-")))) + "}") + " = " + (group + "{" + (group (minimal-match (one-or-more (or alphanumeric "-")))) + "}") + eol) + nil + :noerror) + (add-text-properties + (match-beginning 1) (match-end 1) + (list 'display (gethash (match-string 2) oni-csharp--projects) + 'face 'font-lock-variable-name-face + 'help-echo (buffer-substring-no-properties + (match-beginning 1) (match-end 1)) + 'intangile nil)) + (add-text-properties + (match-beginning 3) (match-end 3) + (list 'display (gethash (match-string 4) oni-csharp--projects) + 'face 'font-lock-variable-name-face + 'help-echo (buffer-substring-no-properties + (match-beginning 3) (match-end 3))))))) + +(define-derived-mode csharp-solution-mode prog-mode "Sln" + "A major mode for viewing and editing C# ‘.sln’ files." + (oni-csharp-collect-project-names) + (oni-csharp-display-project-names)) + +;;;###autoload +(add-to-list 'auto-mode-alist `(,(rx ".sln" eos) . csharp-solution-mode)) + +(defun oni-csharp-add-file-to-project () + (interactive) + (let* ((file-name (buffer-file-name)) + (project-dir (locate-dominating-file file-name + (lambda (file) + (if (file-directory-p file) + (directory-files file nil (rx ".csproj" eos)) + (string-suffix-p ".csproj" file))))) + (project-files (directory-files project-dir nil (rx ".csproj" eos))) + (project-file (cl-case (length project-files) + (0 (error "No project files found in %s" project-dir)) + (1 (car project-files)) + (t (completing-read "Which project file? " project-files)))) + (relative-file-name (file-relative-name file-name project-dir)) + (project-file-absolute-path (expand-file-name project-file project-dir))) + (with-current-buffer (find-file-noselect project-file-absolute-path) + (save-excursion + (re-search-forward (rx "") + (re-search-backward (rx "")) + (forward-line) + (let ((start (line-beginning-position))) + (re-search-forward (rx "")) + (forward-line -1) + (indent-region start (line-end-position)) + (sort-lines nil start (line-end-position))) + (save-buffer))))) + +(provide 'oni-csharp) +;;; oni-csharp.el ends here diff --git a/oni-csharp/Eldev b/oni-csharp/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-csharp/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-csharp/oni-csharp.el b/oni-csharp/oni-csharp.el deleted file mode 100644 index 8451d93..0000000 --- a/oni-csharp/oni-csharp.el +++ /dev/null @@ -1,259 +0,0 @@ -;;; oni-csharp.el --- C# Configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2023.0525.001714 -;; Package-Requires: (csharp-mode oni-company oni-flycheck oni-yasnippet oni-hydra oni-lsp oni-smartparens) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My C# configuration. This configuration enables ‘rainbow-delimiters-mode’. - -;;; Code: - -(require 'company) -(require 'csharp-mode) -(require 'hydra) -(require 'yasnippet) - -(defconst oni-csharp-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-csharp’ was loaded from.") - -(defconst oni-csharp-snippets-dir - (expand-file-name "snippets" oni-csharp-root) - "The directory where ‘oni-csharp’ stores its snippets.") - -(defcustom oni-csharp-devenv-executable - "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\devenv.com\"" - "The location of the devenv.com executable." - :group 'oni-csharp) - -(defvar oni-csharp--projects (make-hash-table :test 'equal)) - -(defhydra oni-csharp-hydra (:color teal :hint nil) - " -^Compile^ -^^------------ -_cp_: Project -_cs_: Solution -^^ -" - ("cp" oni-csharp-compile-project) - ("cs" oni-csharp-compile-solution)) - -(defun oni-csharp-compile-solution () - (interactive) - (let ((compile-command (concat oni-csharp-devenv-executable " /Build Debug " (oni-csharp-locate-dominating-file-wildcard "*.sln")))) - (compile compile-command))) - -(defun oni-csharp-locate-dominating-file-wildcard (filename) - (let (file-list - (default-directory default-directory)) - (while (and (null file-list) - (string-prefix-p (projectile-project-root) default-directory)) - (setq file-list (file-expand-wildcards filename t) - default-directory (file-name-directory (directory-file-name default-directory)))) - (car file-list))) - -(defun oni-csharp-compile-project () - (interactive) - (let ((compile-command (concat oni-csharp-devenv-executable " /Build Debug " (oni-csharp-locate-dominating-file-wildcard "*.sln") " /project " (oni-csharp-locate-dominating-file-wildcard "*.csproj")))) - (compile compile-command))) - -(defun oni-csharp--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." - (setq-local comment-auto-fill-only-comments t) - (auto-fill-mode)) - -(defun oni-csharp-snippets-initialize () - "Initialize the snippets for ‘oni-csharp’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-csharp-snippets-dir t)) - (yas-load-directory oni-csharp-snippets-dir)) - -(defun oni-csharp--update-style () - "Set style rules according to personal (or recommended) preference." - (c-set-offset 'arglist-intro '+) - (c-set-offset 'arglist-cont-nonempty '+)) - -(add-hook 'csharp-mode-hook 'abbrev-mode) -(add-hook 'csharp-mode-hook 'company-mode) -(add-hook 'csharp-mode-hook 'display-fill-column-indicator-mode) -(add-hook 'csharp-mode-hook 'electric-indent-local-mode) -(add-hook 'csharp-mode-hook 'flycheck-mode) -(add-hook 'csharp-mode-hook 'lsp) -(add-hook 'csharp-mode-hook 'oni-csharp--auto-fill-mode) -(add-hook 'csharp-mode-hook 'oni-csharp--update-style) -(add-hook 'csharp-mode-hook 'rainbow-delimiters-mode) -(add-hook 'csharp-mode-hook 'smartparens-mode) - -(define-key csharp-mode-map (kbd "C-c SPC") 'oni-csharp-hydra/body) - -(define-abbrev csharp-mode-abbrev-table "and" "&&" nil :system t) -(define-abbrev csharp-mode-abbrev-table "or" "||" nil :system t) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.xaml\\'" . nxml-mode)) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.targets\\'" . nxml-mode)) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.proj\\'". nxml-mode)) - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.csproj\\'" . nxml-mode)) - -(with-eval-after-load 'autoinsert - (add-to-list 'auto-insert-alist - `(,(rx ".proj" string-end) - nil - "\n " _ "\n"))) - -(with-eval-after-load 'lsp-csharp - (when (eq system-type 'windows-nt) - (setq lsp-csharp-omnisharp-roslyn-server-dir - (expand-file-name "~/scoop/apps/omnisharp/current")))) - -(with-eval-after-load 'compile - (add-to-list 'compilation-error-regexp-alist - `(,(rx (minimal-match (one-or-more digit)) ">" - (group (any alpha) - ":\\" - (minimal-match (one-or-more (any alpha "\\" ".")))) - "(" - (group (minimal-match (one-or-more digit))) - "," - (group (minimal-match (one-or-more digit))) - "," - (group (minimal-match (one-or-more digit))) - "," - (group (minimal-match (one-or-more digit))) - "): " - (group "error" (one-or-more any))) - 1 (2 . 4) (3 . 5) 2 6))) - -(with-eval-after-load 'csharp-mode - (with-eval-after-load 'yasnippet - (oni-csharp-snippets-initialize))) - -;;; Solution mode - -(defun oni-csharp-collect-project-names () - "Go through the current buffer and collect all the project names." - (interactive) - (clrhash oni-csharp--projects) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward - (rx bol - "Project(\"{" - (group (minimal-match (1+ (or alphanumeric "-")))) - "}\") = \"" - (group (minimal-match (1+ any))) - "\", \"" - (minimal-match (1+ any)) - "\", \"{" - (group (minimal-match (1+ any))) - "}\"" - eol) - nil - :noerror) - (puthash (match-string-no-properties 3) - (match-string-no-properties 2) - oni-csharp--projects)))) - -(defun oni-csharp-display-project-names () - "Display the project names in the current buffer." - (interactive) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward - (rx bol - (zero-or-more whitespace) - (group - "{" - (group (minimal-match (one-or-more (or alphanumeric "-")))) - "}") - " = " - (group - "{" - (group (minimal-match (one-or-more (or alphanumeric "-")))) - "}") - eol) - nil - :noerror) - (add-text-properties - (match-beginning 1) (match-end 1) - (list 'display (gethash (match-string 2) oni-csharp--projects) - 'face 'font-lock-variable-name-face - 'help-echo (buffer-substring-no-properties - (match-beginning 1) (match-end 1)) - 'intangile nil)) - (add-text-properties - (match-beginning 3) (match-end 3) - (list 'display (gethash (match-string 4) oni-csharp--projects) - 'face 'font-lock-variable-name-face - 'help-echo (buffer-substring-no-properties - (match-beginning 3) (match-end 3))))))) - -(define-derived-mode csharp-solution-mode prog-mode "Sln" - "A major mode for viewing and editing C# ‘.sln’ files." - (oni-csharp-collect-project-names) - (oni-csharp-display-project-names)) - -;;;###autoload -(add-to-list 'auto-mode-alist `(,(rx ".sln" eos) . csharp-solution-mode)) - -(defun oni-csharp-add-file-to-project () - (interactive) - (let* ((file-name (buffer-file-name)) - (project-dir (locate-dominating-file file-name - (lambda (file) - (if (file-directory-p file) - (directory-files file nil (rx ".csproj" eos)) - (string-suffix-p ".csproj" file))))) - (project-files (directory-files project-dir nil (rx ".csproj" eos))) - (project-file (cl-case (length project-files) - (0 (error "No project files found in %s" project-dir)) - (1 (car project-files)) - (t (completing-read "Which project file? " project-files)))) - (relative-file-name (file-relative-name file-name project-dir)) - (project-file-absolute-path (expand-file-name project-file project-dir))) - (with-current-buffer (find-file-noselect project-file-absolute-path) - (save-excursion - (re-search-forward (rx "") - (re-search-backward (rx "")) - (forward-line) - (let ((start (line-beginning-position))) - (re-search-forward (rx "")) - (forward-line -1) - (indent-region start (line-end-position)) - (sort-lines nil start (line-end-position))) - (save-buffer))))) - -(provide 'oni-csharp) -;;; oni-csharp.el ends here diff --git a/oni-csharp/snippets/csharp-mode/testm b/oni-csharp/snippets/csharp-mode/testm deleted file mode 100644 index 4bd243d..0000000 --- a/oni-csharp/snippets/csharp-mode/testm +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: Test Method -# key: testm -# -- -[TestMethod] -public void ${1:TestMethod}() -{ - $0 -} \ No newline at end of file diff --git a/oni-csharp/snippets/nxml-mode/Import b/oni-csharp/snippets/nxml-mode/Import deleted file mode 100644 index bddbf3f..0000000 --- a/oni-csharp/snippets/nxml-mode/Import +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: Import -# key: imp -# condition: (string-suffix-p ".proj" (buffer-file-name)) -# -- - diff --git a/oni-css.el b/oni-css.el new file mode 100644 index 0000000..91fc11b --- /dev/null +++ b/oni-css.el @@ -0,0 +1,158 @@ +;;; oni-css.el --- CSS configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.003008 +;; Package-Requires: (oni-company oni-hydra rainbow-mode prettier-js) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Configuration for `css-mode' and `scss-mode'. + +;;; Code: + +(require 'align) +(require 'css-mode) +(require 'hydra) + +(eval-when-compile + (require 'compile) + (require 'grep)) + +(defconst oni-css-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-css’ was loaded from.") + +(defun oni-css-property-important-p () + "Return whether or not the current property is important." + (save-excursion + (beginning-of-line) + (re-search-forward "!important" (line-end-position) :noerror))) + +(defun oni-css-add-important () + "Add an important flag to the property on the current line." + (interactive) + (unless (oni-css-property-important-p) + (save-excursion + (end-of-line) + (when (re-search-backward ";" (line-beginning-position) :noerror) + (insert " !important"))))) + +(defun oni-css-remove-important () + "Remove the important flag from the property on the current line." + (interactive) + (when (oni-css-property-important-p) + (save-excursion + (end-of-line) + (when (re-search-backward " !important" (line-beginning-position) :noerror) + (replace-match ""))))) + +(defun oni-css-mode-init--toggle-important () + "Toggle the important flag on the property on the current line." + (interactive) + (if (oni-css-property-important-p) + (oni-css-remove-important) + (oni-css-add-important))) + +(defun oni-css--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + +(defhydra css-mode-hydra (:color blue) + ("!" oni-css-mode-init--toggle-important)) + +(setq css-indent-offset 2) + +(add-hook 'css-mode-hook 'company-mode) +(add-hook 'css-mode-hook 'display-fill-column-indicator-mode) +(add-hook 'css-mode-hook 'electric-indent-local-mode) +(add-hook 'css-mode-hook 'electric-pair-local-mode) +(add-hook 'css-mode-hook 'oni-css--auto-fill-mode) +(add-hook 'css-mode-hook 'prettier-js-mode) +(add-hook 'css-mode-hook 'rainbow-mode) + +(with-eval-after-load 'compile + (let ((scss-error-regexp + (rx (and bol + (zero-or-more space) "on line " + (group (one-or-more digit)) " of " + (group (one-or-more (or word punct (syntax symbol)))) + eol)))) + + (add-to-list 'compilation-error-regexp-alist + (list scss-error-regexp 2 1 nil 2 2)))) + +(define-key css-mode-map (kbd "C-c m") #'css-mode-hydra/body) + +;; Align CSS files like so: + +;; body { color: #ffffff; } +;; .some-class { background-color: #ffffff; } +;; #some-id { width: 200px; } + +;; .some-more-class { +;; color: #ffffff; +;; background-color: #ffffff; +;; width: 200px; +;; } + +;; Keep these in order. They are each added to the _front_ of the +;; list and are applied in order. Changing their order will change +;; the results. +(add-to-list 'align-rules-list + `(css-closing-brace + (regexp . ,(rx (group (0+ whitespace)) "}" eol)) + (group . (1)) + (modes . '(scss-mode css-mode)))) + +(add-to-list 'align-rules-list + `(css-colons + (regexp . ,(rx bol + (0+ whitespace) + (1+ (any (?a . ?z) ?- ?$)) + ":" + (group (0+ whitespace)) + (0+ nonl) + ";" + eol)) + (group . (1)) + (modes . '(scss-mode css-mode)) + (repeat . t))) + +(add-to-list 'align-rules-list + `(css-opening-brace + (regexp . ,(rx bol + (0+ whitespace) + (0+ (any ?# ?. ?, ?\s ?& ?: ?- + (?a . ?z) (?A . ?Z) (?0 . ?9))) + (any (?a . ?z) (?A . ?Z) (?0 . ?9)) + (group (0+ whitespace)) + "{" + (0+ nonl))) + (group . (1)) + (modes . '(scss-mode css-mode)))) + +;;;###autoload +(with-eval-after-load 'grep + (add-to-list 'grep-files-aliases '("css" . "*.css *.less *.sass *.scss"))) + +(provide 'oni-css) +;;; oni-css.el ends here diff --git a/oni-css/Eldev b/oni-css/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-css/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-css/oni-css.el b/oni-css/oni-css.el deleted file mode 100644 index cf58284..0000000 --- a/oni-css/oni-css.el +++ /dev/null @@ -1,173 +0,0 @@ -;;; oni-css.el --- CSS configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2025.0617.123504 -;; Package-Requires: (oni-company oni-hydra rainbow-mode oni-yasnippet prettier-js) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Configuration for `css-mode' and `scss-mode'. - -;;; Code: - -(require 'align) -(require 'css-mode) -(require 'hydra) -(require 'yasnippet) - -(eval-when-compile - (require 'compile) - (require 'grep)) - -(defconst oni-css-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-css’ was loaded from.") - -(defconst oni-css-snippets-dir - (expand-file-name "snippets" oni-css-root) - "The directory where ‘oni-css’ stores its snippets.") - -(defun oni-css-property-important-p () - "Return whether or not the current property is important." - (save-excursion - (beginning-of-line) - (re-search-forward "!important" (line-end-position) :noerror))) - -(defun oni-css-add-important () - "Add an important flag to the property on the current line." - (interactive) - (unless (oni-css-property-important-p) - (save-excursion - (end-of-line) - (when (re-search-backward ";" (line-beginning-position) :noerror) - (insert " !important"))))) - -(defun oni-css-snippets-initialize () - "Initialize the snippets for ‘oni-css’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-css-snippets-dir t)) - (yas-load-directory oni-css-snippets-dir)) - -(defun oni-css-remove-important () - "Remove the important flag from the property on the current line." - (interactive) - (when (oni-css-property-important-p) - (save-excursion - (end-of-line) - (when (re-search-backward " !important" (line-beginning-position) :noerror) - (replace-match ""))))) - -(defun oni-css-mode-init--toggle-important () - "Toggle the important flag on the property on the current line." - (interactive) - (if (oni-css-property-important-p) - (oni-css-remove-important) - (oni-css-add-important))) - -(defun oni-css--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." - (setq-local comment-auto-fill-only-comments t) - (auto-fill-mode)) - -(defhydra css-mode-hydra (:color blue) - ("!" oni-css-mode-init--toggle-important)) - -(setq css-indent-offset 2) - -(add-hook 'css-mode-hook 'company-mode) -(add-hook 'css-mode-hook 'display-fill-column-indicator-mode) -(add-hook 'css-mode-hook 'electric-indent-local-mode) -(add-hook 'css-mode-hook 'electric-pair-local-mode) -(add-hook 'css-mode-hook 'oni-css--auto-fill-mode) -(add-hook 'css-mode-hook 'prettier-js-mode) -(add-hook 'css-mode-hook 'rainbow-mode) - -(with-eval-after-load 'compile - (let ((scss-error-regexp - (rx (and bol - (zero-or-more space) "on line " - (group (one-or-more digit)) " of " - (group (one-or-more (or word punct (syntax symbol)))) - eol)))) - - (add-to-list 'compilation-error-regexp-alist - (list scss-error-regexp 2 1 nil 2 2)))) - -(define-key css-mode-map (kbd "C-c m") #'css-mode-hydra/body) - -;; Align CSS files like so: - -;; body { color: #ffffff; } -;; .some-class { background-color: #ffffff; } -;; #some-id { width: 200px; } - -;; .some-more-class { -;; color: #ffffff; -;; background-color: #ffffff; -;; width: 200px; -;; } - -;; Keep these in order. They are each added to the _front_ of the -;; list and are applied in order. Changing their order will change -;; the results. -(add-to-list 'align-rules-list - `(css-closing-brace - (regexp . ,(rx (group (0+ whitespace)) "}" eol)) - (group . (1)) - (modes . '(scss-mode css-mode)))) - -(add-to-list 'align-rules-list - `(css-colons - (regexp . ,(rx bol - (0+ whitespace) - (1+ (any (?a . ?z) ?- ?$)) - ":" - (group (0+ whitespace)) - (0+ nonl) - ";" - eol)) - (group . (1)) - (modes . '(scss-mode css-mode)) - (repeat . t))) - -(add-to-list 'align-rules-list - `(css-opening-brace - (regexp . ,(rx bol - (0+ whitespace) - (0+ (any ?# ?. ?, ?\s ?& ?: ?- - (?a . ?z) (?A . ?Z) (?0 . ?9))) - (any (?a . ?z) (?A . ?Z) (?0 . ?9)) - (group (0+ whitespace)) - "{" - (0+ nonl))) - (group . (1)) - (modes . '(scss-mode css-mode)))) - -;;;###autoload -(with-eval-after-load 'grep - (add-to-list 'grep-files-aliases '("css" . "*.css *.less *.sass *.scss"))) - -(with-eval-after-load 'css-mode - (with-eval-after-load 'yasnippet - (oni-css-snippets-initialize))) - -(provide 'oni-css) -;;; oni-css.el ends here diff --git a/oni-css/snippets/css-mode/box-shadow b/oni-css/snippets/css-mode/box-shadow deleted file mode 100644 index 82fe9d5..0000000 --- a/oni-css/snippets/css-mode/box-shadow +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: box-shadow -# key: boxshadow -# -- -box-shadow: ${1:offset-x} ${2:offset-y}${3: [blur-radius]}${4: [spread-radius]}${5: [color]}; \ No newline at end of file diff --git a/oni-elisp.el b/oni-elisp.el new file mode 100644 index 0000000..152061d --- /dev/null +++ b/oni-elisp.el @@ -0,0 +1,129 @@ +;;; oni-elisp.el --- Emacs Lisp configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.003032 +;; Package-Requires: (oni-company oni-flycheck oni-paredit oni-hydra rainbow-delimiters nameless erefactor flycheck-relint elisp-format) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My configuration for working in Emacs Lisp. + +;;; Code: + +(require 'checkdoc) +(require 'flycheck-relint) +(require 'hydra) + +(let ((byte-compile-not-obsolete-funcs '(preceding-sexp))) + (require 'erefactor)) + +(require 'ielm) + +(defconst oni-elisp-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-elisp’ was loaded from.") + +(font-lock-add-keywords + 'emacs-lisp-mode + `((,(rx symbol-start + (group (or "t" + "nil" + (and (optional "-") + digit + (minimal-match (zero-or-more (any digit ?.)))))) + symbol-end) + 1 font-lock-constant-face))) + +(defun oni-elisp-auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments and inhibit for Package-Requires." + (setq-local comment-auto-fill-only-comments t) + (setq-local auto-fill-inhibit-regexp (rx line-start ";; Package-Requires: ")) + (auto-fill-mode)) + +(defun oni-elisp-setup-ielm-mode-line () + "Clean up the mode-line for ielm buffers." + (setq mode-line-buffer-identification + (list (propertize "Interactive Emacs Lisp Mode" 'face 'mode-line-buffer-id)) + mode-line-format + '("%e" + mode-line-front-space + mode-line-remote + mode-line-frame-identification + mode-line-buffer-identification + " on " + (:eval (buffer-name ielm-working-buffer)) + mode-line-end-spaces))) + +(defun oni-elisp-ielm-remove-paredit-newline-keys () + "Disable ‘C-j’ and ‘RET’ keybindings from ‘paredit-mode’." + (let ((oldmap (map-elt minor-mode-map-alist 'paredit-mode)) + (newmap (make-sparse-keymap))) + (set-keymap-parent newmap oldmap) + (define-key newmap (kbd "RET") nil) + (define-key newmap (kbd "C-j") nil) + (make-local-variable 'minor-mode-overriding-map-alist) + (push `(paredit-mode . ,newmap) minor-mode-overriding-map-alist))) + +(defhydra oni-elisp-hydra (:color teal :hint nil) + " +^Eval^ +^^---------- +_eb_: Buffer +" + ("eb" eval-buffer)) + +(add-hook 'emacs-lisp-mode-hook #'oni-elisp-auto-fill-mode) +(add-hook 'emacs-lisp-mode-hook 'company-mode) +(add-hook 'emacs-lisp-mode-hook 'display-fill-column-indicator-mode) +(add-hook 'emacs-lisp-mode-hook 'electric-quote-local-mode) +(add-hook 'emacs-lisp-mode-hook 'erefactor-lazy-highlight-turn-on) +(add-hook 'emacs-lisp-mode-hook 'flycheck-mode) +(add-hook 'emacs-lisp-mode-hook 'nameless-mode) +(add-hook 'emacs-lisp-mode-hook 'paredit-mode) +(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode) + +(add-hook 'ielm-mode-hook #'oni-elisp-ielm-remove-paredit-newline-keys) +(add-hook 'ielm-mode-hook #'oni-elisp-setup-ielm-mode-line) +(add-hook 'ielm-mode-hook 'company-mode) +(add-hook 'ielm-mode-hook 'paredit-mode) + +(setq ielm-prompt "λ> ") + +(define-key emacs-lisp-mode-map (kbd "C-c r") erefactor-map) +(define-key emacs-lisp-mode-map (kbd "C-c SPC") 'oni-elisp-hydra/body) + +;;;###autoload +(add-to-list 'auto-mode-alist '("/Cask\\'" . emacs-lisp-mode)) + +(add-to-list 'display-buffer-alist + '("\\`\\*ielm\\*\\'" display-buffer-in-side-window + (side . bottom) + (slot . 0) + (window-height . 0.33))) + +(flycheck-relint-setup) + +(add-hook 'emacs-lisp-mode-hook 'checkdoc-minor-mode) + +(setq checkdoc-spellcheck-documentation-flag t) + +(provide 'oni-elisp) +;;; oni-elisp.el ends here diff --git a/oni-elisp/Eldev b/oni-elisp/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-elisp/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-elisp/oni-elisp.el b/oni-elisp/oni-elisp.el deleted file mode 100644 index 2c4122c..0000000 --- a/oni-elisp/oni-elisp.el +++ /dev/null @@ -1,144 +0,0 @@ -;;; oni-elisp.el --- Emacs Lisp configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2024.1101.071725 -;; Package-Requires: (oni-company oni-flycheck oni-paredit oni-yasnippet oni-hydra rainbow-delimiters nameless erefactor flycheck-relint elisp-format) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My configuration for working in Emacs Lisp. - -;;; Code: - -(require 'checkdoc) -(require 'flycheck-relint) -(require 'hydra) -(require 'yasnippet) - -(let ((byte-compile-not-obsolete-funcs '(preceding-sexp))) - (require 'erefactor)) - -(require 'ielm) - -(defconst oni-elisp-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-elisp’ was loaded from.") - -(defconst oni-elisp-snippets-dir - (expand-file-name "snippets" oni-elisp-root) - "The directory where ‘oni-elisp’ stores its snippets.") - -(font-lock-add-keywords - 'emacs-lisp-mode - `((,(rx symbol-start - (group (or "t" - "nil" - (and (optional "-") - digit - (minimal-match (zero-or-more (any digit ?.)))))) - symbol-end) - 1 font-lock-constant-face))) - -(defun oni-elisp-snippets-initialize () - "Initialize the snippets for ‘oni-elisp’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-elisp-snippets-dir t)) - (yas-load-directory oni-elisp-snippets-dir)) - -(defun oni-elisp-auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments and inhibit for Package-Requires." - (setq-local comment-auto-fill-only-comments t) - (setq-local auto-fill-inhibit-regexp (rx line-start ";; Package-Requires: ")) - (auto-fill-mode)) - -(defun oni-elisp-setup-ielm-mode-line () - "Clean up the mode-line for ielm buffers." - (setq mode-line-buffer-identification - (list (propertize "Interactive Emacs Lisp Mode" 'face 'mode-line-buffer-id)) - mode-line-format - '("%e" - mode-line-front-space - mode-line-remote - mode-line-frame-identification - mode-line-buffer-identification - " on " - (:eval (buffer-name ielm-working-buffer)) - mode-line-end-spaces))) - -(defun oni-elisp-ielm-remove-paredit-newline-keys () - "Disable ‘C-j’ and ‘RET’ keybindings from ‘paredit-mode’." - (let ((oldmap (map-elt minor-mode-map-alist 'paredit-mode)) - (newmap (make-sparse-keymap))) - (set-keymap-parent newmap oldmap) - (define-key newmap (kbd "RET") nil) - (define-key newmap (kbd "C-j") nil) - (make-local-variable 'minor-mode-overriding-map-alist) - (push `(paredit-mode . ,newmap) minor-mode-overriding-map-alist))) - -(defhydra oni-elisp-hydra (:color teal :hint nil) - " -^Eval^ -^^---------- -_eb_: Buffer -" - ("eb" eval-buffer)) - -(add-hook 'emacs-lisp-mode-hook #'oni-elisp-auto-fill-mode) -(add-hook 'emacs-lisp-mode-hook 'company-mode) -(add-hook 'emacs-lisp-mode-hook 'display-fill-column-indicator-mode) -(add-hook 'emacs-lisp-mode-hook 'electric-quote-local-mode) -(add-hook 'emacs-lisp-mode-hook 'erefactor-lazy-highlight-turn-on) -(add-hook 'emacs-lisp-mode-hook 'flycheck-mode) -(add-hook 'emacs-lisp-mode-hook 'nameless-mode) -(add-hook 'emacs-lisp-mode-hook 'paredit-mode) -(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode) - -(add-hook 'ielm-mode-hook #'oni-elisp-ielm-remove-paredit-newline-keys) -(add-hook 'ielm-mode-hook #'oni-elisp-setup-ielm-mode-line) -(add-hook 'ielm-mode-hook 'company-mode) -(add-hook 'ielm-mode-hook 'paredit-mode) - -(setq ielm-prompt "λ> ") - -(define-key emacs-lisp-mode-map (kbd "C-c r") erefactor-map) -(define-key emacs-lisp-mode-map (kbd "C-c SPC") 'oni-elisp-hydra/body) - -;;;###autoload -(add-to-list 'auto-mode-alist '("/Cask\\'" . emacs-lisp-mode)) - -(add-to-list 'display-buffer-alist - '("\\`\\*ielm\\*\\'" display-buffer-in-side-window - (side . bottom) - (slot . 0) - (window-height . 0.33))) - -(with-eval-after-load 'elisp-mode - (with-eval-after-load 'yasnippet - (oni-elisp-snippets-initialize))) - -(flycheck-relint-setup) - -(add-hook 'emacs-lisp-mode-hook 'checkdoc-minor-mode) - -(setq checkdoc-spellcheck-documentation-flag t) - -(provide 'oni-elisp) -;;; oni-elisp.el ends here diff --git a/oni-elisp/snippets/emacs-lisp-mode/cookie b/oni-elisp/snippets/emacs-lisp-mode/cookie deleted file mode 100644 index 6fafd3c..0000000 --- a/oni-elisp/snippets/emacs-lisp-mode/cookie +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: with-eval-after-load-cookie -# key: cookie -# -- -;;;###autoload(with-eval-after-load '${1:`(string-remove-prefix "oni-" (string-remove-suffix ".el" (buffer-name)))`-mode} (require '`(string-remove-suffix ".el" (buffer-name))`)) \ No newline at end of file diff --git a/oni-elisp/snippets/emacs-lisp-mode/depends-on b/oni-elisp/snippets/emacs-lisp-mode/depends-on deleted file mode 100644 index 4f99d92..0000000 --- a/oni-elisp/snippets/emacs-lisp-mode/depends-on +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: depends-on -# key: do -# -- -(depends-on "$1")$0 \ No newline at end of file diff --git a/oni-elisp/snippets/emacs-lisp-mode/depends-on-git b/oni-elisp/snippets/emacs-lisp-mode/depends-on-git deleted file mode 100644 index 1da2f31..0000000 --- a/oni-elisp/snippets/emacs-lisp-mode/depends-on-git +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: depends-on-git -# key: do -# -- -(depends-on "$1" :git "../" :files ("$1.el"))$0 \ No newline at end of file diff --git a/oni-elisp/snippets/emacs-lisp-mode/face b/oni-elisp/snippets/emacs-lisp-mode/face deleted file mode 100644 index 9fdbbb2..0000000 --- a/oni-elisp/snippets/emacs-lisp-mode/face +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: face -# key: face -# -- - `($1 ((t (${2::foreground} $0)))) \ No newline at end of file diff --git a/oni-haml.el b/oni-haml.el new file mode 100644 index 0000000..fee9c1d --- /dev/null +++ b/oni-haml.el @@ -0,0 +1,42 @@ +;;; oni-haml.el --- HAML configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.003052 + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My configuration for ‘haml-mode’. + +;;; Code: + +(defconst oni-haml-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-haml’ was loaded from.") + +(defun oni-haml--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + +(add-hook 'haml-mode-hook 'oni-haml--auto-fill-mode) + +(provide 'oni-haml) +;;; oni-haml.el ends here diff --git a/oni-haml/Eldev b/oni-haml/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-haml/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-haml/oni-haml.el b/oni-haml/oni-haml.el deleted file mode 100644 index 98b3322..0000000 --- a/oni-haml/oni-haml.el +++ /dev/null @@ -1,59 +0,0 @@ -;;; oni-haml.el --- HAML configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2021.1201.134032 -;; Package-Requires: (oni-yasnippet) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My configuration for ‘haml-mode’. - -;;; Code: - -(require 'yasnippet) - -(defconst oni-haml-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-haml’ was loaded from.") - -(defconst oni-haml-snippets-dir - (expand-file-name "snippets" oni-haml-root) - "The directory where ‘oni-haml’ stores its snippets.") - -(defun oni-haml-snippets-initialize () - "Initialize the snippets for ‘oni-haml’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-haml-snippets-dir t)) - (yas-load-directory oni-haml-snippets-dir)) - -(defun oni-haml--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." - (setq-local comment-auto-fill-only-comments t) - (auto-fill-mode)) - -(add-hook 'haml-mode-hook 'oni-haml--auto-fill-mode) - -(with-eval-after-load 'haml-mode - (with-eval-after-load 'yasnippet - (oni-haml-snippets-initialize))) - -(provide 'oni-haml) -;;; oni-haml.el ends here diff --git a/oni-haml/snippets/haml-mode/faq b/oni-haml/snippets/haml-mode/faq deleted file mode 100644 index 4d1a9e2..0000000 --- a/oni-haml/snippets/haml-mode/faq +++ /dev/null @@ -1,12 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: FAQ Question & Answer -# key: faq -# expand-env: ((yas-indent-line 'fixed)) -# -- -%dt - = link_to '#' do - .expand_icon - $1 -%dd - %p - $0 \ No newline at end of file diff --git a/oni-html.el b/oni-html.el new file mode 100644 index 0000000..f06f8a5 --- /dev/null +++ b/oni-html.el @@ -0,0 +1,43 @@ +;;; oni-html.el --- HTML configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.003123 + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; HTML configuration + +;;; Code: + +(defconst oni-html-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-html’ was loaded from.") + +(defun oni-html--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + +(add-hook 'html-mode-hook 'electric-pair-local-mode) +(add-hook 'html-mode-hook 'oni-html--auto-fill-mode) + +(provide 'oni-html) +;;; oni-html.el ends here diff --git a/oni-html/Eldev b/oni-html/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-html/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-html/oni-html.el b/oni-html/oni-html.el deleted file mode 100644 index 68318ae..0000000 --- a/oni-html/oni-html.el +++ /dev/null @@ -1,60 +0,0 @@ -;;; oni-html.el --- HTML configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2021.1201.134113 -;; Package-Requires: (oni-yasnippet) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; HTML configuration - -;;; Code: - -(require 'yasnippet) - -(defconst oni-html-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-html’ was loaded from.") - -(defconst oni-html-snippets-dir - (expand-file-name "snippets" oni-html-root) - "The directory where ‘oni-html’ stores its snippets.") - -(defun oni-html-snippets-initialize () - "Initialize the snippets for ‘oni-html’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-html-snippets-dir t)) - (yas-load-directory oni-html-snippets-dir)) - -(defun oni-html--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." - (setq-local comment-auto-fill-only-comments t) - (auto-fill-mode)) - -(add-hook 'html-mode-hook 'electric-pair-local-mode) -(add-hook 'html-mode-hook 'oni-html--auto-fill-mode) - -(with-eval-after-load 'sgml-mode - (with-eval-after-load 'yasnippet - (oni-html-snippets-initialize))) - -(provide 'oni-html) -;;; oni-html.el ends here diff --git a/oni-html/snippets/html-mode/block b/oni-html/snippets/html-mode/block deleted file mode 100644 index 6510011..0000000 --- a/oni-html/snippets/html-mode/block +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: block -# key: block -# -- -{% block $1 %} - $0 -{% endblock %} \ No newline at end of file diff --git a/oni-html/snippets/html-mode/for b/oni-html/snippets/html-mode/for deleted file mode 100644 index 01d9c44..0000000 --- a/oni-html/snippets/html-mode/for +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: for -# key: for -# condition: pony-tpl-minor-mode -# -- -{% for $1 in $2 %} - $0 -{% endfor %} \ No newline at end of file diff --git a/oni-html/snippets/html-mode/generic-block b/oni-html/snippets/html-mode/generic-block deleted file mode 100644 index 82d40c7..0000000 --- a/oni-html/snippets/html-mode/generic-block +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: Template Block -# key: % -# condition: pony-tpl-minor-mode -# -- -{% $1 %} - $0 -{% end$1 %} \ No newline at end of file diff --git a/oni-html/snippets/html-mode/script b/oni-html/snippets/html-mode/script deleted file mode 100644 index e50dbf5..0000000 --- a/oni-html/snippets/html-mode/script +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: script -# key: script -# -- - \ No newline at end of file diff --git a/oni-html/snippets/html-mode/trans-with-cap b/oni-html/snippets/html-mode/trans-with-cap deleted file mode 100644 index 4f20a33..0000000 --- a/oni-html/snippets/html-mode/trans-with-cap +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: trans with cap -# key: trans -# condition: pony-tpl-minor-mode -# -- -{% trans "$1"|capfirst %} \ No newline at end of file diff --git a/oni-nxml.el b/oni-nxml.el new file mode 100644 index 0000000..4e97269 --- /dev/null +++ b/oni-nxml.el @@ -0,0 +1,53 @@ +;;; oni-nxml.el --- NXML configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.003150 +;; Package-Requires: (reformatter) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; NXML configuration + +;;; Code: + +(defconst oni-nxml-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-nxml’ was loaded from.") + +(defun oni-nxml--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + +(add-hook 'nxml-mode-hook 'oni-nxml--auto-fill-mode) + +(reformatter-define oni-nxml-xmllint + :program "xmllint" + :args '("--nonet" "--format" "-") + :lighter "") + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.targets\\'" . nxml-mode)) +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.proj\\'" . nxml-mode)) + +(provide 'oni-nxml) +;;; oni-nxml.el ends here diff --git a/oni-nxml/Eldev b/oni-nxml/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-nxml/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-nxml/oni-nxml.el b/oni-nxml/oni-nxml.el deleted file mode 100644 index 4ecce90..0000000 --- a/oni-nxml/oni-nxml.el +++ /dev/null @@ -1,69 +0,0 @@ -;;; oni-nxml.el --- NXML configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2021.1201.134152 -;; Package-Requires: (oni-yasnippet reformatter) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; NXML configuration - -;;; Code: - -(require 'yasnippet) - -(defconst oni-nxml-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-nxml’ was loaded from.") - -(defconst oni-nxml-snippets-dir - (expand-file-name "snippets" oni-nxml-root) - "The directory where ‘oni-nxml’ stores its snippets.") - -(defun oni-nxml-snippets-initialize () - "Initialize the snippets for ‘oni-nxml’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-nxml-snippets-dir t)) - (yas-load-directory oni-nxml-snippets-dir)) - -(defun oni-nxml--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." - (setq-local comment-auto-fill-only-comments t) - (auto-fill-mode)) - -(add-hook 'nxml-mode-hook 'oni-nxml--auto-fill-mode) - -(reformatter-define oni-nxml-xmllint - :program "xmllint" - :args '("--nonet" "--format" "-") - :lighter "") - -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.targets\\'" . nxml-mode)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.proj\\'" . nxml-mode)) - -(with-eval-after-load 'nxml-mode - (with-eval-after-load 'yasnippet - (oni-nxml-snippets-initialize))) - -(provide 'oni-nxml) -;;; oni-nxml.el ends here diff --git a/oni-nxml/snippets/nxml-mode/pencil-property b/oni-nxml/snippets/nxml-mode/pencil-property deleted file mode 100644 index 7fafcb8..0000000 --- a/oni-nxml/snippets/nxml-mode/pencil-property +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: PencilProperty -# key: p -# -- -$4 \ No newline at end of file diff --git a/oni-nxml/snippets/nxml-mode/pencil-property-value b/oni-nxml/snippets/nxml-mode/pencil-property-value deleted file mode 100644 index 5da3d10..0000000 --- a/oni-nxml/snippets/nxml-mode/pencil-property-value +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: PropertyValue -# key: pv -# -- -$2 \ No newline at end of file diff --git a/oni-nxml/snippets/nxml-mode/pencil-shortcut b/oni-nxml/snippets/nxml-mode/pencil-shortcut deleted file mode 100644 index e760d27..0000000 --- a/oni-nxml/snippets/nxml-mode/pencil-shortcut +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: Shortcut -# key: s -# -- - - $0 - \ No newline at end of file diff --git a/oni-org/snippets/org-mode/codeblock b/oni-org/snippets/org-mode/codeblock deleted file mode 100644 index a200b08..0000000 --- a/oni-org/snippets/org-mode/codeblock +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: codeblock -# key: code -# -- -#+begin_src $1 - $0 -#+end_src \ No newline at end of file diff --git a/oni-org/snippets/org-mode/heading b/oni-org/snippets/org-mode/heading deleted file mode 100644 index a472f06..0000000 --- a/oni-org/snippets/org-mode/heading +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: Heading -# key: - -#+end_html - -#+INCLUDE: "dlmenu.inc" - -* About - - ${5:A short description about $1} - - | $0Status | $6 | - | Language | $7 | - | License | ${8:GPLv3} | - -* Why? - - ${9:Why did you even think of writing $1?} - -* Features - - ${10:$1 does...} - -* Dependencies - - ${11:$1 needs to have...} - -* Download - - ${12:To download $1...} - -* Install - - ${13:To install $1...} - -* Usage - - ${14:Using $1...} \ No newline at end of file diff --git a/oni-org/snippets/org-mode/snippet b/oni-org/snippets/org-mode/snippet deleted file mode 100644 index 67f15d5..0000000 --- a/oni-org/snippets/org-mode/snippet +++ /dev/null @@ -1,14 +0,0 @@ -# -*- mode: snippet -*- -# name: snippet -# key: snippet -# -- -#+TITLE: ${1:snippet-name} -#+OPTIONS: toc:nil - -* $1 - - ${2:A short description abount $1} - - #+BEGIN_SRC $3 :tangle yes -$0 - #+END_SRC \ No newline at end of file diff --git a/oni-org/snippets/org-mode/task b/oni-org/snippets/org-mode/task deleted file mode 100644 index af229d1..0000000 --- a/oni-org/snippets/org-mode/task +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# name: task -# key: todo -# -- -* TODO ${1:What is the outcome?} -:PROPERTIES: -:CREATED: [`(format-time-string "%Y-%m-%d %a %H:%M")`] -:END: - -$0 diff --git a/oni-php/snippets/php-mode/arrow-function b/oni-php/snippets/php-mode/arrow-function deleted file mode 100644 index 3b44e01..0000000 --- a/oni-php/snippets/php-mode/arrow-function +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: arrow-function -# key: f -# condition: (oni-php-in-expression-context-p) -# -- -fn($1): $2 => $3 \ No newline at end of file diff --git a/oni-php/snippets/php-mode/casts b/oni-php/snippets/php-mode/casts deleted file mode 100644 index 2850d72..0000000 --- a/oni-php/snippets/php-mode/casts +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: casts -# key: casts -# -- -protected $casts = [ - '$1' => $0, -]; \ No newline at end of file diff --git a/oni-php/snippets/php-mode/class b/oni-php/snippets/php-mode/class deleted file mode 100644 index 26a58a1..0000000 --- a/oni-php/snippets/php-mode/class +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: class -# key: cls -# -- -class ${1:`(file-name-nondirectory (file-name-sans-extension buffer-file-name))`} -{ - $0 -} \ No newline at end of file diff --git a/oni-php/snippets/php-mode/constructor b/oni-php/snippets/php-mode/constructor deleted file mode 100644 index f919e6c..0000000 --- a/oni-php/snippets/php-mode/constructor +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: constructor -# key: constructor -# -- -public function __construct($1) -{ - $0 -} \ No newline at end of file diff --git a/oni-php/snippets/php-mode/factory b/oni-php/snippets/php-mode/factory deleted file mode 100644 index 534f227..0000000 --- a/oni-php/snippets/php-mode/factory +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: factory -# key: f -# condition: (and (oni-php-in-test-file) (oni-php-in-static-call-context-p)) -# -- -factory()->create([$0]); \ No newline at end of file diff --git a/oni-php/snippets/php-mode/for b/oni-php/snippets/php-mode/for deleted file mode 100644 index 1adae91..0000000 --- a/oni-php/snippets/php-mode/for +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: for -# key: for -# -- -for (${1:$i = 0}; ${2:$i < $3}; ${4:$i++}) { - $0 -} \ No newline at end of file diff --git a/oni-php/snippets/php-mode/function-expression b/oni-php/snippets/php-mode/function-expression deleted file mode 100644 index fa59b03..0000000 --- a/oni-php/snippets/php-mode/function-expression +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: function expression -# key: f -# condition: (oni-php-in-expression-context-p) -# -- -function ($1) ${2:use ($3)} { - $0 -} \ No newline at end of file diff --git a/oni-php/snippets/php-mode/function-statement b/oni-php/snippets/php-mode/function-statement deleted file mode 100644 index 9c44aef..0000000 --- a/oni-php/snippets/php-mode/function-statement +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: snippet -*- -# name: function statement -# key: f -# condition: (oni-php-in-expression-context-p) -# -- -/** - * $5 - */ -${1:private} function $2($3): ${4:void} { - $0 -} \ No newline at end of file diff --git a/oni-php/snippets/php-mode/if-statement b/oni-php/snippets/php-mode/if-statement deleted file mode 100644 index 6033e3a..0000000 --- a/oni-php/snippets/php-mode/if-statement +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: if statement -# key: ? -# -- -if ($1) { - $2 -} \ No newline at end of file diff --git a/oni-php/snippets/php-mode/logger-debug b/oni-php/snippets/php-mode/logger-debug deleted file mode 100644 index d0e0b7e..0000000 --- a/oni-php/snippets/php-mode/logger-debug +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: logger.debug -# key: ld -# -- -logger()->debug('$1'${2:, [ $3 ]}); \ No newline at end of file diff --git a/oni-php/snippets/php-mode/logger-error b/oni-php/snippets/php-mode/logger-error deleted file mode 100644 index 19344aa..0000000 --- a/oni-php/snippets/php-mode/logger-error +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: logger-error -# key: le -# -- -logger()->error('$1'${2:, [ $3 ]}); \ No newline at end of file diff --git a/oni-php/snippets/php-mode/logger-info b/oni-php/snippets/php-mode/logger-info deleted file mode 100644 index 9491d24..0000000 --- a/oni-php/snippets/php-mode/logger-info +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: logger.info -# key: li -# -- -logger()->info('$1'${2:, [ $3 ]}); \ No newline at end of file diff --git a/oni-php/snippets/php-mode/logger-warning b/oni-php/snippets/php-mode/logger-warning deleted file mode 100644 index 3945490..0000000 --- a/oni-php/snippets/php-mode/logger-warning +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: logger.warning -# key: lw -# -- -logger()->warning('$1'${2, [ $3 ]}); \ No newline at end of file diff --git a/oni-php/snippets/php-mode/mark-test-skipped b/oni-php/snippets/php-mode/mark-test-skipped deleted file mode 100644 index ce4761d..0000000 --- a/oni-php/snippets/php-mode/mark-test-skipped +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: mark test skipped -# key: @s -# condition: (string-suffix-p "Test.php" buffer-file-name) -# -- -$this->markTestSkipped("${1:Don't skip your tests.}"); \ No newline at end of file diff --git a/oni-php/snippets/php-mode/namespace b/oni-php/snippets/php-mode/namespace deleted file mode 100644 index 7a5b5e1..0000000 --- a/oni-php/snippets/php-mode/namespace +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: namespace -# key: ns -# -- -namespace ${1:`(oni-php-generate-namespace)`}; \ No newline at end of file diff --git a/oni-php/snippets/php-mode/php b/oni-php/snippets/php-mode/php deleted file mode 100644 index 12f7492..0000000 --- a/oni-php/snippets/php-mode/php +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: +;; Keywords: local +;; Version: 2026.0527.003213 +;; Package-Requires: (oni-company oni-flycheck oni-hydra oni-lsp rainbow-delimiters reformatter) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; My Python configuration. +;; +;; It features: +;; - Completion +;; - Syntax checking +;; - Right margin +;; - Delimiter balancing +;; - Automatic reformatting +;; - Delimiter highlighting + +;;; Code: + +(require 'company) +(require 'hydra) +(require 'python) +(require 'reformatter) +(require 'whitespace) + +;; Don't mind if treesit can't be loaded, maybe this Emacs doesn't have it. +(require 'treesit nil t) + +(autoload 'hl-indent-mode "hl-indent-mode") + +(defconst oni-python-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-python’ was loaded from.") + +(defun oni-python-set-fill-column () + "Set the `fill-column' and `comment-fill-column' for the current buffer. + +The values are taken from the PEP8 coding standard for Python." + (setq-local fill-column 80) + (setq-local comment-fill-column 72)) + +(defun oni-python-whitespace-mode () + "Set the `whitespace-style' to show the relevat whitespace. +In Python buffers it should show any tabs being used and and used +for indentation." + (setq-local whitespace-style '(face tabs)) + (whitespace-mode)) + +;;;###autoload +(defun oni-python--enable-hooks (hook) + (add-hook hook 'company-mode) + (add-hook hook 'display-fill-column-indicator-mode) + (add-hook hook 'electric-indent-local-mode) + (add-hook hook 'electric-pair-local-mode) + (add-hook hook 'flycheck-mode) + (add-hook hook 'lsp) + (add-hook hook 'oni-python-set-fill-column) + (add-hook hook 'oni-python-whitespace-mode) + (add-hook hook 'python-black-on-save-mode) + (add-hook hook 'rainbow-delimiters-mode)) + +(reformatter-define python-black + :program "black" + :args `("--line-length" ,(number-to-string fill-column) "-") + :lighter "" + :group 'python-black) + +(define-key python-mode-map (kbd "C-c r") 'python-refactor-hydra/body) + +(oni-python--enable-hooks 'python-mode-hook) + +;;;###autoload +(when (and (functionp 'treesit-available-p) + (treesit-available-p) + (require 'treesit) + (treesit-ready-p 'python)) + (add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode)) + (oni-python--enable-hooks 'python-ts-mode-hook)) + +(provide 'oni-python) +;;; oni-python.el ends here diff --git a/oni-python/Eldev b/oni-python/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-python/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-python/oni-python.el b/oni-python/oni-python.el deleted file mode 100644 index 9e8c9c2..0000000 --- a/oni-python/oni-python.el +++ /dev/null @@ -1,115 +0,0 @@ -;;; oni-python.el --- Python configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2024.0621.092608 -;; Package-Requires: (oni-yasnippet oni-company oni-flycheck oni-hydra oni-lsp rainbow-delimiters reformatter) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; My Python configuration. -;; -;; It features: -;; - Completion -;; - Syntax checking -;; - Right margin -;; - Delimiter balancing -;; - Automatic reformatting -;; - Delimiter highlighting - -;;; Code: - -(require 'company) -(require 'hydra) -(require 'python) -(require 'reformatter) -(require 'whitespace) -(require 'yasnippet) - -;; Don't mind if treesit can't be loaded, maybe this Emacs doesn't have it. -(require 'treesit nil t) - -(autoload 'hl-indent-mode "hl-indent-mode") - -(defconst oni-python-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-python’ was loaded from.") - -(defconst oni-python-snippets-dir - (expand-file-name "snippets" oni-python-root) - "The directory where ‘oni-python’ stores its snippets.") - -(defun oni-python-set-fill-column () - "Set the `fill-column' and `comment-fill-column' for the current buffer. - -The values are taken from the PEP8 coding standard for Python." - (setq-local fill-column 80) - (setq-local comment-fill-column 72)) - -(defun oni-python-snippets-initialize () - "Initialize the snippets for ‘oni-python’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-python-snippets-dir)) - (yas-load-directory oni-python-snippets-dir)) - -(defun oni-python-whitespace-mode () - "Set the `whitespace-style' to show the relevat whitespace. -In Python buffers it should show any tabs being used and and used -for indentation." - (setq-local whitespace-style '(face tabs)) - (whitespace-mode)) - -;;;###autoload -(defun oni-python--enable-hooks (hook) - (add-hook hook 'company-mode) - (add-hook hook 'display-fill-column-indicator-mode) - (add-hook hook 'electric-indent-local-mode) - (add-hook hook 'electric-pair-local-mode) - (add-hook hook 'flycheck-mode) - (add-hook hook 'lsp) - (add-hook hook 'oni-python-set-fill-column) - (add-hook hook 'oni-python-whitespace-mode) - (add-hook hook 'python-black-on-save-mode) - (add-hook hook 'rainbow-delimiters-mode)) - -(reformatter-define python-black - :program "black" - :args `("--line-length" ,(number-to-string fill-column) "-") - :lighter "" - :group 'python-black) - -(define-key python-mode-map (kbd "C-c r") 'python-refactor-hydra/body) - -(oni-python--enable-hooks 'python-mode-hook) - -;;;###autoload -(when (and (functionp 'treesit-available-p) - (treesit-available-p) - (require 'treesit) - (treesit-ready-p 'python)) - (add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode)) - (oni-python--enable-hooks 'python-ts-mode-hook)) - -(with-eval-after-load 'python - (with-eval-after-load 'yasnippet - (oni-python-snippets-initialize))) - -(provide 'oni-python) -;;; oni-python.el ends here diff --git a/oni-python/snippets/python-mode/defm_empty b/oni-python/snippets/python-mode/defm_empty deleted file mode 100644 index baa976e..0000000 --- a/oni-python/snippets/python-mode/defm_empty +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# name: Empty Defmethod -# key: defm -# -- -def ${1:name}(self, *args, **kwargs): - '''$2''' - return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).$1(*args, **kwargs) \ No newline at end of file diff --git a/oni-python/snippets/python-mode/form b/oni-python/snippets/python-mode/form deleted file mode 100644 index 225d5e4..0000000 --- a/oni-python/snippets/python-mode/form +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: Model Form -# key: form -# -- -class ${1:Model}Form(forms.ModelForm): - '''Form for the $1 model.''' - - class Meta: - model = $1 \ No newline at end of file diff --git a/oni-python/snippets/python-mode/form_valid b/oni-python/snippets/python-mode/form_valid deleted file mode 100644 index c5a7e58..0000000 --- a/oni-python/snippets/python-mode/form_valid +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: Record form -# key: defm -# -- -@record_activity(model=${1:`(progn (re-search-backward "^[ \t]*model = \\([a-zA-Z_].*\\)$") (match-string 1))`}) -def form_valid(self, form): - '''Make sure any changes to the $1 model get logged.''' - return super(${2:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).form_valid(form) \ No newline at end of file diff --git a/oni-python/snippets/python-mode/form_valid_with_return b/oni-python/snippets/python-mode/form_valid_with_return deleted file mode 100644 index fac23bc..0000000 --- a/oni-python/snippets/python-mode/form_valid_with_return +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: form_valid with return -# key: formvalid -# -- -def form_valid(self, form): - rv = super(`(let ((name (python-info-current-defun))) (substring name 0 (cl-position ?. name)))`, self).form_valid(form) - $0 - return rv \ No newline at end of file diff --git a/oni-python/snippets/python-mode/import_from b/oni-python/snippets/python-mode/import_from deleted file mode 100644 index d9cc4e2..0000000 --- a/oni-python/snippets/python-mode/import_from +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# name: from ... import ... -# contributor: Tom Willemse -# key: from -# -- -from ${1:module} import ${2:class_or_module} diff --git a/oni-python/snippets/python-mode/method b/oni-python/snippets/python-mode/method deleted file mode 100644 index 7c033cf..0000000 --- a/oni-python/snippets/python-mode/method +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: method -# key: defm -# -- -def $1(self$2): - '''$3''' - $0 \ No newline at end of file diff --git a/oni-python/snippets/python-mode/permission_guard b/oni-python/snippets/python-mode/permission_guard deleted file mode 100644 index ab53895..0000000 --- a/oni-python/snippets/python-mode/permission_guard +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: Permission guard -# key: defm -# -- -@method_decorator(permission_required('$1', - raise_exception=True)) -def dispatch(self, *args, **kwargs): - '''Make sure the user has the $1 permission.''' - return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).dispatch(*args, **kwargs) \ No newline at end of file diff --git a/oni-python/snippets/python-mode/url b/oni-python/snippets/python-mode/url deleted file mode 100644 index 00ade72..0000000 --- a/oni-python/snippets/python-mode/url +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet -*- -# name: url -# key: url -# -- -url(r'^$1', $2, name='$3'), \ No newline at end of file diff --git a/oni-ruby.el b/oni-ruby.el new file mode 100644 index 0000000..04ccab9 --- /dev/null +++ b/oni-ruby.el @@ -0,0 +1,46 @@ +;;; oni-ruby.el --- Ruby configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.003231 +;; Package-Requires: (ruby-mode) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Ruby configuration. + +;;; Code: + +(defconst oni-ruby-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-ruby’ was loaded from.") + +(defun oni-ruby--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + +(add-hook 'ruby-mode-hook 'display-fill-column-indicator-mode) +(add-hook 'ruby-mode-hook 'electric-indent-local-mode) +(add-hook 'ruby-mode-hook 'electric-pair-local-mode) +(add-hook 'ruby-mode-hook 'oni-ruby--auto-fill-mode) + +(provide 'oni-ruby) +;;; oni-ruby.el ends here diff --git a/oni-ruby/Eldev b/oni-ruby/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-ruby/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-ruby/oni-ruby.el b/oni-ruby/oni-ruby.el deleted file mode 100644 index 056a2a6..0000000 --- a/oni-ruby/oni-ruby.el +++ /dev/null @@ -1,62 +0,0 @@ -;;; oni-ruby.el --- Ruby configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2021.1201.134041 -;; Package-Requires: (ruby-mode oni-yasnippet) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Ruby configuration. - -;;; Code: - -(require 'yasnippet) - -(defconst oni-ruby-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-ruby’ was loaded from.") - -(defconst oni-ruby-snippets-dir - (expand-file-name "snippets" oni-ruby-root) - "The directory where ‘oni-ruby’ stores its snippets.") - -(defun oni-ruby-snippets-initialize () - "Initialize the snippets for ‘oni-ruby’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-ruby-snippets-dir)) - (yas-load-directory oni-ruby-snippets-dir)) - -(defun oni-ruby--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." - (setq-local comment-auto-fill-only-comments t) - (auto-fill-mode)) - -(add-hook 'ruby-mode-hook 'display-fill-column-indicator-mode) -(add-hook 'ruby-mode-hook 'electric-indent-local-mode) -(add-hook 'ruby-mode-hook 'electric-pair-local-mode) -(add-hook 'ruby-mode-hook 'oni-ruby--auto-fill-mode) - -(with-eval-after-load 'ruby-mode - (with-eval-after-load 'yasnippet - (oni-ruby-snippets-initialize))) - -(provide 'oni-ruby) -;;; oni-ruby.el ends here diff --git a/oni-ruby/snippets/ruby-mode/ProductSeed b/oni-ruby/snippets/ruby-mode/ProductSeed deleted file mode 100644 index 7e836c2..0000000 --- a/oni-ruby/snippets/ruby-mode/ProductSeed +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: ProductSeed -# key: pseed -# -- -Product.find_or_create_by_name(parent_id: $1, name: '$2', description: '$3', price: '$4') \ No newline at end of file diff --git a/oni-ruby/snippets/ruby-mode/ProductSeedHW b/oni-ruby/snippets/ruby-mode/ProductSeedHW deleted file mode 100644 index 843b32e..0000000 --- a/oni-ruby/snippets/ruby-mode/ProductSeedHW +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: ProductSeedWithHW -# key: pseed -# -- -Product.find_or_create_by_name(parent_id: $1, name: '$2', description: '$3', price: '$4', width_in_cm: '$5', height_in_cm: '$6', width_in_mm: '${5:$(round (* 10 (string-to-int yas-text)))}', height_in_mm: '${6:$(round (* 10 (string-to-int yas-text)))}') \ No newline at end of file diff --git a/oni-ruby/snippets/ruby-mode/ProductSeedHWGroup b/oni-ruby/snippets/ruby-mode/ProductSeedHWGroup deleted file mode 100644 index 25594c5..0000000 --- a/oni-ruby/snippets/ruby-mode/ProductSeedHWGroup +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: ProductSeedWithHWGroup -# key: pseed -# -- -Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Small', price: '20.00', width_in_cm: '25.00', height_in_cm: '21.00', width_in_mm: '250', height_in_mm: '210') -Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Medium', price: '20.00', width_in_cm: '30.00', height_in_cm: '25.80', width_in_mm: '300', height_in_mm: '258') -Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Large', price: '20.00', width_in_cm: '35.00', height_in_cm: '30.00', width_in_mm: '350', height_in_mm: '300') -Product.find_or_create_by_name(parent_id: $1, name: '$2', description: 'Extra large', price: '20.00', width_in_cm: '40.00', height_in_cm: '34.00', width_in_mm: '400', height_in_mm: '340') diff --git a/oni-ruby/snippets/ruby-mode/describe b/oni-ruby/snippets/ruby-mode/describe deleted file mode 100644 index acd3a6b..0000000 --- a/oni-ruby/snippets/ruby-mode/describe +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: describe -# key: desc -# -- -describe '$1' do - $0 -end \ No newline at end of file diff --git a/oni-ruby/snippets/ruby-mode/do b/oni-ruby/snippets/ruby-mode/do deleted file mode 100644 index 3c556fc..0000000 --- a/oni-ruby/snippets/ruby-mode/do +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -# name: do -# key: do -# -- -do$0 -end \ No newline at end of file diff --git a/oni-ruby/snippets/ruby-mode/factory b/oni-ruby/snippets/ruby-mode/factory deleted file mode 100644 index 619b2e5..0000000 --- a/oni-ruby/snippets/ruby-mode/factory +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -# name: factory -# key: factory -# -- -FactoryGirl.define do - factory :${1:`(file-name-sans-extension (file-name-nondirectory buffer-file-name))`} do - $0 - end -end \ No newline at end of file diff --git a/oni-ruby/snippets/ruby-mode/fill_in b/oni-ruby/snippets/ruby-mode/fill_in deleted file mode 100644 index 854b029..0000000 --- a/oni-ruby/snippets/ruby-mode/fill_in +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: fill_in -# key: fin -# -- -fill_in '$1', with: $2 \ No newline at end of file diff --git a/oni-ruby/snippets/ruby-mode/mod b/oni-ruby/snippets/ruby-mode/mod deleted file mode 100644 index 9af7d23..0000000 --- a/oni-ruby/snippets/ruby-mode/mod +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: module ... end -# key: mod -# group: definitions -# -- -module ${1:`(let ((fn (capitalize (file-name-nondirectory - (directory-file-name - default-directory))))) - (replace-regexp-in-string "_" "" fn t t))`} - $0 -end \ No newline at end of file diff --git a/oni-ruby/snippets/ruby-mode/reduce b/oni-ruby/snippets/ruby-mode/reduce deleted file mode 100644 index 3d4bfe4..0000000 --- a/oni-ruby/snippets/ruby-mode/reduce +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: reduce -# key: reduce -# -- -reduce { |a, e| $0 } \ No newline at end of file diff --git a/oni-twig.el b/oni-twig.el new file mode 100644 index 0000000..5f569d8 --- /dev/null +++ b/oni-twig.el @@ -0,0 +1,43 @@ +;;; oni-twig.el --- Twig configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0527.003251 +;; Package-Requires: (twig-mode) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Configuration for ‘twig-mode’. + +;;; Code: + +(defconst oni-twig-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-twig’ was loaded from.") + +(defun oni-twig--auto-fill-mode () + "Enable ‘auto-fill-mode’ only for comments." + (setq-local comment-auto-fill-only-comments t) + (auto-fill-mode)) + +(add-hook 'twig-mode-hook 'oni-twig--auto-fill-mode) + +(provide 'oni-twig) +;;; oni-twig.el ends here diff --git a/oni-twig/Eldev b/oni-twig/Eldev deleted file mode 100644 index 1ba3134..0000000 --- a/oni-twig/Eldev +++ /dev/null @@ -1,13 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t -*- - -;; Uncomment some calls below as needed for your project. -(eldev-use-package-archive 'gnu-elpa) -;(eldev-use-package-archive 'nongnu-elpa) -(eldev-use-package-archive 'melpa) -(eldev-use-package-archive `("oni" . ,(expand-file-name "../bin"))) - -(eldev-use-plugin 'autoloads) - -(setf eldev-files-to-package - `(:or ,eldev-files-to-package - '("*.el" "./snippets/**/*"))) diff --git a/oni-twig/oni-twig.el b/oni-twig/oni-twig.el deleted file mode 100644 index ed147bf..0000000 --- a/oni-twig/oni-twig.el +++ /dev/null @@ -1,59 +0,0 @@ -;;; oni-twig.el --- Twig configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2021.1201.134109 -;; Package-Requires: (twig-mode oni-yasnippet) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Configuration for ‘twig-mode’. - -;;; Code: - -(require 'yasnippet) - -(defconst oni-twig-root - (file-name-directory - (or load-file-name - (buffer-file-name))) - "The directory where ‘oni-twig’ was loaded from.") - -(defconst oni-twig-snippets-dir - (expand-file-name "snippets" oni-twig-root) - "The directory where ‘oni-twig’ stores its snippets.") - -(defun oni-twig-snippets-initialize () - "Initialize the snippets for ‘oni-twig’." - (when (boundp 'yas-snippet-dirs) - (add-to-list 'yas-snippet-dirs oni-twig-snippets-dir)) - (yas-load-directory oni-twig-snippets-dir)) - -(defun oni-twig--auto-fill-mode () - "Enable ‘auto-fill-mode’ only for comments." - (setq-local comment-auto-fill-only-comments t) - (auto-fill-mode)) - -(add-hook 'twig-mode-hook 'oni-twig--auto-fill-mode) - -(with-eval-after-load 'twig-mode - (with-eval-after-load 'yasnippet - (oni-twig-snippets-initialize))) - -(provide 'oni-twig) -;;; oni-twig.el ends here diff --git a/oni-twig/snippets/twig-mode/_self b/oni-twig/snippets/twig-mode/_self deleted file mode 100644 index c441690..0000000 --- a/oni-twig/snippets/twig-mode/_self +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: _self -# key: _self -# -- -{% import _self as ${1:`(file-name-nondirectory (file-name-sans-extension buffer-file-name))`} %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/blk b/oni-twig/snippets/twig-mode/blk deleted file mode 100644 index bb100a3..0000000 --- a/oni-twig/snippets/twig-mode/blk +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: block -# key: blk -# -- -{% block $1 %} - $0 -{% endblock %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/def b/oni-twig/snippets/twig-mode/def deleted file mode 100644 index 78dead4..0000000 --- a/oni-twig/snippets/twig-mode/def +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: default value -# key: def -# -- -{% if $1 is not defined %} - {% set $1 = $2 %} -{% endif %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/ext b/oni-twig/snippets/twig-mode/ext deleted file mode 100644 index 501cae8..0000000 --- a/oni-twig/snippets/twig-mode/ext +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: extends -# key: ext -# -- -{% extends "$1" %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/for b/oni-twig/snippets/twig-mode/for deleted file mode 100644 index 01c0cc5..0000000 --- a/oni-twig/snippets/twig-mode/for +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: for -# key: for -# -- -{% for $1 in $2 %} - `yas-selected-text`$0 -{% endfor %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/if b/oni-twig/snippets/twig-mode/if deleted file mode 100644 index a9385d9..0000000 --- a/oni-twig/snippets/twig-mode/if +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: if -# key: if -# -- -{% if $1 %} - $0 -{% endif %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/ife b/oni-twig/snippets/twig-mode/ife deleted file mode 100644 index a4d18f3..0000000 --- a/oni-twig/snippets/twig-mode/ife +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: if...else -# key: ife -# -- -{% if $1 %} - $0 -{% else %} - -{% endif %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/iif b/oni-twig/snippets/twig-mode/iif deleted file mode 100644 index df26b61..0000000 --- a/oni-twig/snippets/twig-mode/iif +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: Inline if -# key: iif -# -- -{% if $1 %}$0{% endif %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/imp b/oni-twig/snippets/twig-mode/imp deleted file mode 100644 index 01ceb69..0000000 --- a/oni-twig/snippets/twig-mode/imp +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: import -# key: imp -# -- -{% import "${1:module}" as ${1:$(if (string-match "/\\\\([^/]*\\\\)$" yas-text) - (match-string 1 yas-text) - yas-text)} %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/mac b/oni-twig/snippets/twig-mode/mac deleted file mode 100644 index d4e480a..0000000 --- a/oni-twig/snippets/twig-mode/mac +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: macro -# key: mac -# -- -{% macro ${1:name}(${2:args}) %} - $0 -{% endmacro %} \ No newline at end of file diff --git a/oni-twig/snippets/twig-mode/set b/oni-twig/snippets/twig-mode/set deleted file mode 100644 index 715c828..0000000 --- a/oni-twig/snippets/twig-mode/set +++ /dev/null @@ -1,5 +0,0 @@ -# -*- mode: snippet; require-final-newline: nil -*- -# name: set -# key: set -# -- -{% set $1 = $2 %} \ No newline at end of file diff --git a/oni-yasnippet.el b/oni-yasnippet.el deleted file mode 100644 index 584d909..0000000 --- a/oni-yasnippet.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; oni-yasnippet.el --- Yasnippet configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Tom Willemse - -;; Author: Tom Willemse -;; Keywords: local -;; Version: 2023.1212.085307 -;; Package-Requires: (yasnippet yasnippet-snippets diminish) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Yasnippet configuration. To use this configuratin you should put the -;; following two lines in your init file: -;; -;; (with-eval-after-load 'yasnippet (require 'oni-yasnippet)) -;; (yas-global-mode) - - -;;; Code: - -(require 'yasnippet) -(require 'diminish) - -(defun oni-yasnippet-remove-snippet-by-name (name mode) - "Remove the snippet NAME from MODE's snippet tables." - (and-let* ((mode-table (gethash mode yas--tables)) - (uuidhash-table (yas--table-uuidhash mode-table)) - (hash-table (yas--table-hash mode-table)) - (snippet (gethash name uuidhash-table)) - (key (yas--template-key snippet))) - (remhash key hash-table) - (remhash name uuidhash-table))) - -(defun oni-yasnippet-cleanup-snippets () - "Remove some snippets that I don't like." - (oni-yasnippet-remove-snippet-by-name "defun" 'lisp-interaction-mode)) - -(with-eval-after-load 'yasnippet (diminish 'yas-minor-mode)) - -(setq-default yas-buffer-local-condition yas-not-string-or-comment-condition) - -(define-key yas-minor-mode-map (kbd "") nil) -(define-key yas-minor-mode-map (kbd "C-\\") 'yas-expand) -(define-key yas-minor-mode-map (kbd "SPC") yas-maybe-expand) -(define-key yas-minor-mode-map (kbd "TAB") nil) - -(add-hook 'yas-after-reload-hook #'oni-yasnippet-cleanup-snippets) - -(provide 'oni-yasnippet) -;;; oni-yasnippet.el ends here diff --git a/oni-yasnippet/oni-yasnippet.el b/oni-yasnippet/oni-yasnippet.el new file mode 100644 index 0000000..11e96f7 --- /dev/null +++ b/oni-yasnippet/oni-yasnippet.el @@ -0,0 +1,78 @@ +;;; oni-yasnippet.el --- Yasnippet configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2026.0528.021141 +;; Package-Requires: (yasnippet yasnippet-snippets diminish) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Yasnippet configuration. To use this configuratin you should put the +;; following two lines in your init file: +;; +;; (with-eval-after-load 'yasnippet (require 'oni-yasnippet)) +;; (yas-global-mode) + + +;;; Code: + +(require 'yasnippet) +(require 'diminish) + +(defconst oni-yasnippet-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-yasnippet’ was loaded from.") + +(defconst oni-yasnippet-snippets-dir + (expand-file-name "snippets" oni-yasnippet-root)) + +(defun oni-yasnippet-snippets-initialize () + "Initialize the snippets for ‘oni-yasnippet’." + (when (boundp 'yas-snippet-dirs) + (add-to-list 'yas-snippet-dirs oni-yasnippet-snippets-dir t))) + +(defun oni-yasnippet-remove-snippet-by-name (name mode) + "Remove the snippet NAME from MODE's snippet tables." + (and-let* ((mode-table (gethash mode yas--tables)) + (uuidhash-table (yas--table-uuidhash mode-table)) + (hash-table (yas--table-hash mode-table)) + (snippet (gethash name uuidhash-table)) + (key (yas--template-key snippet))) + (remhash key hash-table) + (remhash name uuidhash-table))) + +(defun oni-yasnippet-cleanup-snippets () + "Remove some snippets that I don't like." + (oni-yasnippet-remove-snippet-by-name "defun" 'lisp-interaction-mode)) + +(with-eval-after-load 'yasnippet (diminish 'yas-minor-mode)) + +(setq-default yas-buffer-local-condition yas-not-string-or-comment-condition) + +(define-key yas-minor-mode-map (kbd "") nil) +(define-key yas-minor-mode-map (kbd "C-\\") 'yas-expand) +(define-key yas-minor-mode-map (kbd "SPC") yas-maybe-expand) +(define-key yas-minor-mode-map (kbd "TAB") nil) + +(add-hook 'yas-minor-mode-hook #'oni-yasnippet-snippets-initialize) +(add-hook 'yas-after-reload-hook #'oni-yasnippet-cleanup-snippets) + +(provide 'oni-yasnippet) +;;; oni-yasnippet.el ends here diff --git a/oni-yasnippet/snippets/bats-mode/test b/oni-yasnippet/snippets/bats-mode/test new file mode 100644 index 0000000..8a2f028 --- /dev/null +++ b/oni-yasnippet/snippets/bats-mode/test @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: test +# key: test +# -- +@test "$1" { + $0 +} \ No newline at end of file diff --git a/oni-yasnippet/snippets/conf-mode/section b/oni-yasnippet/snippets/conf-mode/section new file mode 100644 index 0000000..496e4fd --- /dev/null +++ b/oni-yasnippet/snippets/conf-mode/section @@ -0,0 +1,8 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: Xorg Section +# key: Section +# -- +Section "$1" + Identifier "$2" + $0 +EndSection diff --git a/oni-yasnippet/snippets/csharp-mode/testm b/oni-yasnippet/snippets/csharp-mode/testm new file mode 100644 index 0000000..4bd243d --- /dev/null +++ b/oni-yasnippet/snippets/csharp-mode/testm @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Test Method +# key: testm +# -- +[TestMethod] +public void ${1:TestMethod}() +{ + $0 +} \ No newline at end of file diff --git a/oni-yasnippet/snippets/css-mode/box-shadow b/oni-yasnippet/snippets/css-mode/box-shadow new file mode 100644 index 0000000..82fe9d5 --- /dev/null +++ b/oni-yasnippet/snippets/css-mode/box-shadow @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: box-shadow +# key: boxshadow +# -- +box-shadow: ${1:offset-x} ${2:offset-y}${3: [blur-radius]}${4: [spread-radius]}${5: [color]}; \ No newline at end of file diff --git a/oni-yasnippet/snippets/emacs-lisp-mode/cookie b/oni-yasnippet/snippets/emacs-lisp-mode/cookie new file mode 100644 index 0000000..6fafd3c --- /dev/null +++ b/oni-yasnippet/snippets/emacs-lisp-mode/cookie @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: with-eval-after-load-cookie +# key: cookie +# -- +;;;###autoload(with-eval-after-load '${1:`(string-remove-prefix "oni-" (string-remove-suffix ".el" (buffer-name)))`-mode} (require '`(string-remove-suffix ".el" (buffer-name))`)) \ No newline at end of file diff --git a/oni-yasnippet/snippets/emacs-lisp-mode/depends-on b/oni-yasnippet/snippets/emacs-lisp-mode/depends-on new file mode 100644 index 0000000..4f99d92 --- /dev/null +++ b/oni-yasnippet/snippets/emacs-lisp-mode/depends-on @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: depends-on +# key: do +# -- +(depends-on "$1")$0 \ No newline at end of file diff --git a/oni-yasnippet/snippets/emacs-lisp-mode/depends-on-git b/oni-yasnippet/snippets/emacs-lisp-mode/depends-on-git new file mode 100644 index 0000000..1da2f31 --- /dev/null +++ b/oni-yasnippet/snippets/emacs-lisp-mode/depends-on-git @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: depends-on-git +# key: do +# -- +(depends-on "$1" :git "../" :files ("$1.el"))$0 \ No newline at end of file diff --git a/oni-yasnippet/snippets/emacs-lisp-mode/face b/oni-yasnippet/snippets/emacs-lisp-mode/face new file mode 100644 index 0000000..9fdbbb2 --- /dev/null +++ b/oni-yasnippet/snippets/emacs-lisp-mode/face @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: face +# key: face +# -- + `($1 ((t (${2::foreground} $0)))) \ No newline at end of file diff --git a/oni-yasnippet/snippets/haml-mode/faq b/oni-yasnippet/snippets/haml-mode/faq new file mode 100644 index 0000000..4d1a9e2 --- /dev/null +++ b/oni-yasnippet/snippets/haml-mode/faq @@ -0,0 +1,12 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: FAQ Question & Answer +# key: faq +# expand-env: ((yas-indent-line 'fixed)) +# -- +%dt + = link_to '#' do + .expand_icon + $1 +%dd + %p + $0 \ No newline at end of file diff --git a/oni-yasnippet/snippets/html-mode/block b/oni-yasnippet/snippets/html-mode/block new file mode 100644 index 0000000..6510011 --- /dev/null +++ b/oni-yasnippet/snippets/html-mode/block @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: block +# key: block +# -- +{% block $1 %} + $0 +{% endblock %} \ No newline at end of file diff --git a/oni-yasnippet/snippets/html-mode/for b/oni-yasnippet/snippets/html-mode/for new file mode 100644 index 0000000..01d9c44 --- /dev/null +++ b/oni-yasnippet/snippets/html-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# condition: pony-tpl-minor-mode +# -- +{% for $1 in $2 %} + $0 +{% endfor %} \ No newline at end of file diff --git a/oni-yasnippet/snippets/html-mode/generic-block b/oni-yasnippet/snippets/html-mode/generic-block new file mode 100644 index 0000000..82d40c7 --- /dev/null +++ b/oni-yasnippet/snippets/html-mode/generic-block @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Template Block +# key: % +# condition: pony-tpl-minor-mode +# -- +{% $1 %} + $0 +{% end$1 %} \ No newline at end of file diff --git a/oni-yasnippet/snippets/html-mode/script b/oni-yasnippet/snippets/html-mode/script new file mode 100644 index 0000000..e50dbf5 --- /dev/null +++ b/oni-yasnippet/snippets/html-mode/script @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: script +# key: script +# -- + \ No newline at end of file diff --git a/oni-yasnippet/snippets/html-mode/trans-with-cap b/oni-yasnippet/snippets/html-mode/trans-with-cap new file mode 100644 index 0000000..4f20a33 --- /dev/null +++ b/oni-yasnippet/snippets/html-mode/trans-with-cap @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: trans with cap +# key: trans +# condition: pony-tpl-minor-mode +# -- +{% trans "$1"|capfirst %} \ No newline at end of file diff --git a/oni-yasnippet/snippets/nxml-mode/Import b/oni-yasnippet/snippets/nxml-mode/Import new file mode 100644 index 0000000..bddbf3f --- /dev/null +++ b/oni-yasnippet/snippets/nxml-mode/Import @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Import +# key: imp +# condition: (string-suffix-p ".proj" (buffer-file-name)) +# -- + diff --git a/oni-yasnippet/snippets/nxml-mode/pencil-property b/oni-yasnippet/snippets/nxml-mode/pencil-property new file mode 100644 index 0000000..7fafcb8 --- /dev/null +++ b/oni-yasnippet/snippets/nxml-mode/pencil-property @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: PencilProperty +# key: p +# -- +$4 \ No newline at end of file diff --git a/oni-yasnippet/snippets/nxml-mode/pencil-property-value b/oni-yasnippet/snippets/nxml-mode/pencil-property-value new file mode 100644 index 0000000..5da3d10 --- /dev/null +++ b/oni-yasnippet/snippets/nxml-mode/pencil-property-value @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: PropertyValue +# key: pv +# -- +$2 \ No newline at end of file diff --git a/oni-yasnippet/snippets/nxml-mode/pencil-shortcut b/oni-yasnippet/snippets/nxml-mode/pencil-shortcut new file mode 100644 index 0000000..e760d27 --- /dev/null +++ b/oni-yasnippet/snippets/nxml-mode/pencil-shortcut @@ -0,0 +1,9 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: Shortcut +# key: s +# -- + + $0 + \ No newline at end of file diff --git a/oni-yasnippet/snippets/org-mode/codeblock b/oni-yasnippet/snippets/org-mode/codeblock new file mode 100644 index 0000000..a200b08 --- /dev/null +++ b/oni-yasnippet/snippets/org-mode/codeblock @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: codeblock +# key: code +# -- +#+begin_src $1 + $0 +#+end_src \ No newline at end of file diff --git a/oni-yasnippet/snippets/org-mode/heading b/oni-yasnippet/snippets/org-mode/heading new file mode 100644 index 0000000..a472f06 --- /dev/null +++ b/oni-yasnippet/snippets/org-mode/heading @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Heading +# key: + +#+end_html + +#+INCLUDE: "dlmenu.inc" + +* About + + ${5:A short description about $1} + + | $0Status | $6 | + | Language | $7 | + | License | ${8:GPLv3} | + +* Why? + + ${9:Why did you even think of writing $1?} + +* Features + + ${10:$1 does...} + +* Dependencies + + ${11:$1 needs to have...} + +* Download + + ${12:To download $1...} + +* Install + + ${13:To install $1...} + +* Usage + + ${14:Using $1...} \ No newline at end of file diff --git a/oni-yasnippet/snippets/org-mode/snippet b/oni-yasnippet/snippets/org-mode/snippet new file mode 100644 index 0000000..67f15d5 --- /dev/null +++ b/oni-yasnippet/snippets/org-mode/snippet @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: snippet +# key: snippet +# -- +#+TITLE: ${1:snippet-name} +#+OPTIONS: toc:nil + +* $1 + + ${2:A short description abount $1} + + #+BEGIN_SRC $3 :tangle yes +$0 + #+END_SRC \ No newline at end of file diff --git a/oni-yasnippet/snippets/org-mode/task b/oni-yasnippet/snippets/org-mode/task new file mode 100644 index 0000000..af229d1 --- /dev/null +++ b/oni-yasnippet/snippets/org-mode/task @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: task +# key: todo +# -- +* TODO ${1:What is the outcome?} +:PROPERTIES: +:CREATED: [`(format-time-string "%Y-%m-%d %a %H:%M")`] +:END: + +$0 diff --git a/oni-yasnippet/snippets/php-mode/arrow-function b/oni-yasnippet/snippets/php-mode/arrow-function new file mode 100644 index 0000000..3b44e01 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/arrow-function @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: arrow-function +# key: f +# condition: (oni-php-in-expression-context-p) +# -- +fn($1): $2 => $3 \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/casts b/oni-yasnippet/snippets/php-mode/casts new file mode 100644 index 0000000..2850d72 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/casts @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: casts +# key: casts +# -- +protected $casts = [ + '$1' => $0, +]; \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/class b/oni-yasnippet/snippets/php-mode/class new file mode 100644 index 0000000..26a58a1 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/class @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: class +# key: cls +# -- +class ${1:`(file-name-nondirectory (file-name-sans-extension buffer-file-name))`} +{ + $0 +} \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/constructor b/oni-yasnippet/snippets/php-mode/constructor new file mode 100644 index 0000000..f919e6c --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/constructor @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: constructor +# key: constructor +# -- +public function __construct($1) +{ + $0 +} \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/factory b/oni-yasnippet/snippets/php-mode/factory new file mode 100644 index 0000000..534f227 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/factory @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: factory +# key: f +# condition: (and (oni-php-in-test-file) (oni-php-in-static-call-context-p)) +# -- +factory()->create([$0]); \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/for b/oni-yasnippet/snippets/php-mode/for new file mode 100644 index 0000000..1adae91 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# -- +for (${1:$i = 0}; ${2:$i < $3}; ${4:$i++}) { + $0 +} \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/function-expression b/oni-yasnippet/snippets/php-mode/function-expression new file mode 100644 index 0000000..fa59b03 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/function-expression @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: function expression +# key: f +# condition: (oni-php-in-expression-context-p) +# -- +function ($1) ${2:use ($3)} { + $0 +} \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/function-statement b/oni-yasnippet/snippets/php-mode/function-statement new file mode 100644 index 0000000..9c44aef --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/function-statement @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: function statement +# key: f +# condition: (oni-php-in-expression-context-p) +# -- +/** + * $5 + */ +${1:private} function $2($3): ${4:void} { + $0 +} \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/if-statement b/oni-yasnippet/snippets/php-mode/if-statement new file mode 100644 index 0000000..6033e3a --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/if-statement @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if statement +# key: ? +# -- +if ($1) { + $2 +} \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/logger-debug b/oni-yasnippet/snippets/php-mode/logger-debug new file mode 100644 index 0000000..d0e0b7e --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/logger-debug @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: logger.debug +# key: ld +# -- +logger()->debug('$1'${2:, [ $3 ]}); \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/logger-error b/oni-yasnippet/snippets/php-mode/logger-error new file mode 100644 index 0000000..19344aa --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/logger-error @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: logger-error +# key: le +# -- +logger()->error('$1'${2:, [ $3 ]}); \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/logger-info b/oni-yasnippet/snippets/php-mode/logger-info new file mode 100644 index 0000000..9491d24 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/logger-info @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: logger.info +# key: li +# -- +logger()->info('$1'${2:, [ $3 ]}); \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/logger-warning b/oni-yasnippet/snippets/php-mode/logger-warning new file mode 100644 index 0000000..3945490 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/logger-warning @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: logger.warning +# key: lw +# -- +logger()->warning('$1'${2, [ $3 ]}); \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/mark-test-skipped b/oni-yasnippet/snippets/php-mode/mark-test-skipped new file mode 100644 index 0000000..ce4761d --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/mark-test-skipped @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: mark test skipped +# key: @s +# condition: (string-suffix-p "Test.php" buffer-file-name) +# -- +$this->markTestSkipped("${1:Don't skip your tests.}"); \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/namespace b/oni-yasnippet/snippets/php-mode/namespace new file mode 100644 index 0000000..7a5b5e1 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/namespace @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: namespace +# key: ns +# -- +namespace ${1:`(oni-php-generate-namespace)`}; \ No newline at end of file diff --git a/oni-yasnippet/snippets/php-mode/php b/oni-yasnippet/snippets/php-mode/php new file mode 100644 index 0000000..12f7492 --- /dev/null +++ b/oni-yasnippet/snippets/php-mode/php @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: