diff options
| -rw-r--r-- | oni-logview.el | 38 | ||||
| -rw-r--r-- | oni-outline.el | 38 | ||||
| -rw-r--r-- | oni-php/oni-php.el | 29 | ||||
| -rw-r--r-- | oni-sql.el | 43 |
4 files changed, 134 insertions, 14 deletions
diff --git a/oni-logview.el b/oni-logview.el new file mode 100644 index 0000000..bc2c526 --- /dev/null +++ b/oni-logview.el @@ -0,0 +1,38 @@ +;;; oni-logview.el --- LogView configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Tom Willemse + +;; Author: Tom Willemse <tom@ryuslash.org> +;; Keywords: local +;; Version: 2026.0402.162536 +;; Package-Requires: (logview) + +;; 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 <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; My logview configuration. + +;;; Code: + +(require 'map) +(require 'logview) + +(setf (map-elt logview-additional-submodes "Laravel") + '((format . "[TIMESTAMP] NAME.LEVEL:") + (levels . "RFC 5424") + (timestamp))) + +(provide 'oni-logview) +;;; oni-logview.el ends here diff --git a/oni-outline.el b/oni-outline.el new file mode 100644 index 0000000..4d12073 --- /dev/null +++ b/oni-outline.el @@ -0,0 +1,38 @@ +;;; oni-outline.el --- Outline mode configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Tom Willemse + +;; Author: Tom Willemse <tom@ryuslash.org> +;; Keywords: local +;; Version: 2026.0401.112746 + +;; 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 <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Configuration for ‘outline-minor-mode’. + +;;; Code: + +(require 'outline) + +(define-key outline-minor-mode-map + (kbd "TAB") + '(menu-item "" nil + :filter (lambda (&optional _) + (when (outline-on-heading-p) + 'outline-cycle)))) + +(provide 'oni-outline) +;;; oni-outline.el ends here diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 5964c34..36bf76f 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2026.0327.111947 +;; Version: 2026.0331.120917 ;; Package-Requires: (oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters rainbow-identifiers) ;; This program is free software; you can redistribute it and/or modify @@ -30,6 +30,7 @@ (require 'align) (require 'company) (require 'hydra) +(require 'map) (require 'project) (require 'whitespace) (require 'yasnippet) @@ -129,23 +130,23 @@ Do the insert N times." (indent-region start (point)) (goto-char insert-marker)))) -;; (defun oni-php-comment-dwim (func &rest args) -;; "See if a PHP documentation comment should be added and add it. -;; Otherwise call FUNC with ARGS. This is meant as advice around -;; ‘comment-dwim’ to make it smarter for PHP code." -;; (if (and (derived-mode-p 'php-mode) -;; (not (region-active-p)) -;; (looking-back (rx (minimal-match (zero-or-more blank))) (line-beginning-position)) -;; (looking-at (rx (minimal-match (zero-or-more (any whitespace "\n"))) -;; (or (regexp php-beginning-of-defun-regexp) -;; (regexp php--re-classlike-pattern))))) -;; (oni-php-doc-comment) -;; (apply func args))) +(defun oni-php-comment-dwim (func &rest args) + "See if a PHP documentation comment should be added and add it. +Otherwise call FUNC with ARGS. This is meant as advice around +‘comment-dwim’ to make it smarter for PHP code." + (if (and (derived-mode-p 'php-mode) + (not (region-active-p)) + (looking-back (rx (minimal-match (zero-or-more blank))) (line-beginning-position)) + (looking-at (rx (minimal-match (zero-or-more (any whitespace "\n"))) + (or (regexp php-beginning-of-defun-regexp) + (regexp php--re-classlike-pattern))))) + (oni-php-doc-comment) + (apply func args))) (defhydra php-mode-hydra (:color blue) ("a" align-current "Align current selection")) -;; (advice-add 'comment-dwim :around #'oni-php-comment-dwim) +(advice-add 'comment-dwim :around #'oni-php-comment-dwim) (add-hook 'php-mode-hook #'oni-php--set-require-final-newline) (add-hook 'php-mode-hook #'oni-php--whitespace-mode) diff --git a/oni-sql.el b/oni-sql.el new file mode 100644 index 0000000..4746025 --- /dev/null +++ b/oni-sql.el @@ -0,0 +1,43 @@ +;;; oni-sql.el --- Configuration for SQL-mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Tom Willemse + +;; Author: Tom Willemse <tom@ryuslash.org> +;; Keywords: local +;; Version: 2026.0401.124124 + +;; 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 <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Configuration for ‘sql-mode’. + +;;; Code: + +(require 'sql) + +(define-key sql-mode-map (kbd "C-c C-b") 'sql-set-sqli-buffer) + +(defun oni-sql-send-input () + (interactive nil sql-interactive-mode) + (outline-hide-body) + (comint-send-input)) + +(add-hook 'sql-mode-hook 'outline-minor-mode) +(add-hook 'sql-interactive-mode-hook 'outline-minor-mode) + +(define-key sql-interactive-mode-map (kbd "RET") 'oni-sqli-send-input) + +(provide 'oni-sql) +;;; oni-sql.el ends here |
