diff options
| -rw-r--r-- | oni-compilation.el | 4 | ||||
| -rw-r--r-- | oni-dired.el | 4 | ||||
| -rw-r--r-- | oni-elfeed.el | 7 | ||||
| -rw-r--r-- | oni-eshell.el | 5 | ||||
| -rw-r--r-- | oni-gui/icons/wakatime.svg | 4 | ||||
| -rw-r--r-- | oni-gui/oni-gui.el | 15 | ||||
| -rw-r--r-- | oni-logview.el | 38 | ||||
| -rw-r--r-- | oni-org/oni-org.el | 38 | ||||
| -rw-r--r-- | oni-outline.el | 38 | ||||
| -rw-r--r-- | oni-php/oni-php.el | 114 | ||||
| -rwxr-xr-x | oni-php/scripts/find-php-class | 5 | ||||
| -rw-r--r-- | oni-php/snippets/php-mode/class | 8 | ||||
| -rw-r--r-- | oni-php/snippets/php-mode/factory | 6 | ||||
| -rw-r--r-- | oni-php/snippets/php-mode/logger-warning | 5 | ||||
| -rw-r--r-- | oni-php/snippets/php-mode/mark-test-skipped | 6 | ||||
| -rw-r--r-- | oni-php/snippets/php-mode/namespace | 6 | ||||
| -rw-r--r-- | oni-php/snippets/php-ts-mode/.yas-parents | 1 | ||||
| -rw-r--r-- | oni-project.el | 4 | ||||
| -rw-r--r-- | oni-sql.el | 43 |
19 files changed, 310 insertions, 41 deletions
diff --git a/oni-compilation.el b/oni-compilation.el index 888ad09..f83e8fb 100644 --- a/oni-compilation.el +++ b/oni-compilation.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2021.0919.230646 +;; Version: 2026.0121.162911 ;; Package-Requires: (oni-alert xterm-color) ;; This program is free software; you can redistribute it and/or modify @@ -51,7 +51,7 @@ ALIST and PLIST contain extra information about the buffer." BUFFER is the `compilation-mode' buffer and STATUS is the exit status of the process." - (when (string= (buffer-name buffer) "*compilation*") + (when (string-match-p (rx "*compilation*" "*Chanced Tests*") (buffer-name buffer)) (if (string= (string-trim status) "finished") (alert "Compilation finished succesfully") (alert "Compilation finished with an error")))) diff --git a/oni-dired.el b/oni-dired.el index aa4a96c..1720065 100644 --- a/oni-dired.el +++ b/oni-dired.el @@ -4,7 +4,8 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2021.1123.003414 +;; Version: 2026.0310.090659 +;; Package-Requires: (oni-diff-hl) ;; 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 @@ -38,6 +39,7 @@ (add-hook 'dired-mode-hook #'oni-dired--add-wdired-keybinding) (add-hook 'dired-mode-hook 'hl-line-mode) +(add-hook 'dired-mode-hook 'diff-hl-dired-mode) (add-to-list 'dired-guess-shell-alist-user `(,(rx ".pdf" eos) "zathura")) diff --git a/oni-elfeed.el b/oni-elfeed.el index d2aecf0..ca72c1f 100644 --- a/oni-elfeed.el +++ b/oni-elfeed.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2025.0916.224624 +;; Version: 2026.0316.235056 ;; Package-Requires: (elfeed olivetti) ;; This program is free software; you can redistribute it and/or modify @@ -102,7 +102,10 @@ ("https://me.literatelisp.eu/this-week-in-guix.xml" guix) "https://apisyouwonthate.com/rss/" "https://sophiebits.com/atom.xml" - "https://signal.org/blog/rss.xml")) + "https://signal.org/blog/rss.xml" + ("https://pivot-to-ai.com/feed/" ai) + "https://pluralistic.net/feed/" + ("https://phpreads.com/feed" php))) (add-hook 'elfeed-new-entry-hook (elfeed-make-tagger :before "2 weeks ago" diff --git a/oni-eshell.el b/oni-eshell.el index 6e01ad1..dae024b 100644 --- a/oni-eshell.el +++ b/oni-eshell.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2025.1222.160029 +;; Version: 2026.0407.092049 ;; Package-Requires: (eshell-fringe-status esh-autosuggest xterm-color eshell-syntax-highlighting) ;; This program is free software; you can redistribute it and/or modify @@ -132,7 +132,8 @@ DIRECTORY should be a directory that exists within CURRENT-PATH." (zero-or-more any))) (matches (directory-files current-path nil dir-rx))) (when (= (length matches) 1) - (throw 'result current-directory)))))) + (throw 'result current-directory)))) + directory)) (defun oni-eshell-shorten-directory (directory) "Shorten DIRECTORY to the shortest unique names of each directory." diff --git a/oni-gui/icons/wakatime.svg b/oni-gui/icons/wakatime.svg new file mode 100644 index 0000000..132fd9b --- /dev/null +++ b/oni-gui/icons/wakatime.svg @@ -0,0 +1,4 @@ +<svg width="340" height="340" viewBox="0 0 340 340" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M170 20C87.156 20 20 87.156 20 170C20 252.844 87.156 320 170 320C252.844 320 320 252.844 320 170C320 87.156 252.844 20 170 20V20V20Z" stroke="white" stroke-width="40"/> +<path d="M190.183 213.541C188.74 215.443 186.576 216.667 184.151 216.667C183.913 216.667 183.677 216.651 183.443 216.627C183.042 216.579 182.823 216.545 182.606 216.497C182.337 216.434 182.137 216.375 181.94 216.308C181.561 216.176 181.392 216.109 181.228 216.035C180.843 215.849 180.707 215.778 180.572 215.701C180.205 215.478 180.109 215.412 180.014 215.345C179.856 215.233 179.698 215.117 179.547 214.992C179.251 214.746 179.147 214.65 179.044 214.552C178.731 214.241 178.531 214.018 178.341 213.785C177.982 213.331 177.69 212.888 177.438 212.415L168.6 198.214L159.766 212.415C158.38 214.939 155.874 216.667 152.995 216.667C150.106 216.667 147.588 214.926 146.243 212.346L107.607 156.061C106.337 154.529 105.556 152.499 105.556 150.258C105.556 145.514 109.043 141.665 113.344 141.665C116.127 141.665 118.564 143.282 119.942 145.708L152.555 193.9L161.735 178.952C163.058 176.288 165.626 174.478 168.575 174.478C171.273 174.478 173.652 175.996 175.049 178.298L184.517 193.839L235.684 120.583C237.075 118.226 239.475 116.667 242.213 116.667C246.514 116.667 250 120.514 250 125.258C250 127.332 249.337 129.232 248.23 130.715L190.183 213.541V213.541Z" fill="white" stroke="white" stroke-width="10"/> +</svg> diff --git a/oni-gui/oni-gui.el b/oni-gui/oni-gui.el index b3700c5..38e3ab5 100644 --- a/oni-gui/oni-gui.el +++ b/oni-gui/oni-gui.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2025.0115.143051 +;; Version: 2026.0310.095909 ;; Package-Requires: (oni-ui oni-hydra yoshi-theme diminish) ;; This program is free software; you can redistribute it and/or modify @@ -28,6 +28,7 @@ (require 'hydra) (require 'oni-ui) +(require 'map) (defconst oni-gui-root (file-name-directory @@ -39,13 +40,13 @@ (expand-file-name "icons" oni-gui-root) "The directory where ‘oni-gui’ stores its icons.") -(add-to-list 'default-frame-alist '(font . "Fantasque Sans Mono-15")) -(add-to-list 'default-frame-alist '(internal-border-width . 15)) +(setf (map-elt default-frame-alist 'font) "Fantasque Sans Mono-15") +(setf (map-elt default-frame-alist 'internal-border-width) 15) (defun oni-gui-setup-faces (frame) "Setup faces for FRAME." (set-face-attribute 'fixed-pitch frame :font "Fantasque Sans Mono-15") - (set-face-attribute 'variable-pitch frame :font "Comic Neue-15")) + (set-face-attribute 'variable-pitch frame :font "Dosis-16")) (defun oni-gui-setup-fontsets (frame) "Setup fontsets for FRAME. @@ -96,9 +97,11 @@ If FRAME is nil, they’re set for the current frame." `([,(cdr char-regexp) 0 font-shape-gstring]))))) (with-eval-after-load 'isearch - (diminish 'isearch-mode (propertize " " 'display `(image :type svg :file ,(expand-file-name "search.svg" oni-gui-icons-dir) :ascent center :margin (5 . 0))))) + (diminish 'isearch-mode (propertize " " 'display `(image :type svg :file ,(expand-file-name "search.svg" oni-gui-icons-dir) :ascent center :margin (5 . 0) :height 16)))) (with-eval-after-load 'autorevert - (diminish 'auto-revert-mode (propertize " " 'display `(image :type svg :file ,(expand-file-name "recycle.svg" oni-gui-icons-dir) :ascent center :margin (5 . 0))))) + (diminish 'auto-revert-mode (propertize " " 'display `(image :type svg :file ,(expand-file-name "recycle.svg" oni-gui-icons-dir) :ascent center :margin (5 . 0) :height 16)))) +(with-eval-after-load 'wakatime-mode + (diminish 'wakatime-mode (propertize " " 'display `(image :type svg :file ,(expand-file-name "wakatime.svg" oni-gui-icons-dir) :ascent center :margin (5 . 0) :height 16)))) (defhydra oni-gui-hydra (:color teal :hint nil) " 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-org/oni-org.el b/oni-org/oni-org.el index d2df96b..444a508 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2026.0105.140349 +;; Version: 2026.0324.011543 ;; Package-Requires: (oni-yasnippet oni-hydra org org-edna diminish olivetti org-pretty-table) ;; This program is free software; you can redistribute it and/or modify @@ -1040,6 +1040,42 @@ CLOSED: %(setq oni-org--capture-D-date (format-time-string (org-time-stamp-forma %:link" :immediate-finish t)) +(defun oni-org-find-new-note-file () + (let ((title (read-string "Title: "))) + (find-file (expand-file-name (format "reference/%s-%s.org" + (format-time-string "%Y%m%d%H%M%S") + (replace-regexp-in-string (rx whitespace) "-" (downcase title))) + oni-org-todo-dir)) + (setq-local oni-org--capture-page-title title))) + +(oni-org--map-put org-capture-templates "p" + '("A note page." plain (function oni-org-find-new-note-file) "#+TITLE: %(with-current-buffer (org-capture-get :buffer) oni-org--capture-page-title) +#+DATE: %U + +%?" + :after-finalize (lambda () (when org-note-abort + (delete-file (buffer-file-name (org-capture-get :buffer)) t) + (kill-buffer (org-capture-get :buffer)))))) + +(defun oni-org-insert-link (title entry) + (interactive + (let ((collection (mapcar + (lambda (entry) + (list (org-mem-entry-title entry) + entry)) + (seq-filter (lambda (entry) + (not (string-search "archive" (org-mem-entry-file entry)))) + (org-mem-all-entries))))) + (assoc (completing-read "To: " collection) collection))) + (insert (if (> (org-mem-entry-level entry) 0) + (format "[[file:%s::%s][%s]]" + (file-relative-name (org-mem-entry-file entry)) + title + title) + (format "[[file:%s][%s]]" + (file-relative-name (org-mem-entry-file entry)) + title)))) + ;;; Mastodon post dynamic block (defun oni-org-dblock-write-mastodon-post (params) 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 88af7af..1415d2b 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,8 +4,8 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2026.0107.143829 -;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters rainbow-identifiers) +;; Version: 2026.0407.170526 +;; 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 ;; it under the terms of the GNU General Public License as published by @@ -30,7 +30,8 @@ (require 'align) (require 'company) (require 'hydra) -(require 'php-mode) +(require 'map) +(require 'project) (require 'whitespace) (require 'yasnippet) @@ -79,7 +80,7 @@ nil for some reason." (defun oni-php-add-use (class) "Try to add a use statement for CLASS under point." - (interactive (list (symbol-name (symbol-at-point)))) + (interactive (list (thing-at-point 'symbol))) (let* ((default-directory (project-root (project-current))) (classes (read (shell-command-to-string (concat (expand-file-name "find-php-class" oni-php-scripts-dir) " " class)))) (class (cond @@ -97,19 +98,31 @@ nil for some reason." (forward-line) (insert "\n")) - (unless (search-backward class nil t) + (unless (re-search-backward (rx "use " (literal class) ";") nil t) (let ((start (point))) (insert "use " class ";\n") (pulse-momentary-highlight-region start (point))))))) +(defun oni-php--syntax-in-string-p (syntax) + "Does SYNTAX indicate point is inside a string?" + (nth 3 syntax)) + +(defun oni-php--syntax-in-comment-p (syntax) + "Does SYNTAX indicate point is inside a comment?" + (nth 4 syntax)) + +(defun oni-php--in-string-or-comment-p () + "Return whether or not point is within a string or comment." + (let ((syntax (syntax-ppss))) + (or (oni-php--syntax-in-string-p syntax) + (oni-php--syntax-in-comment-p syntax)))) + (defun oni-php-insert-dot-dwim (N) "Insert either a concatenation or access operator depending on context. Do the insert N times." (interactive "p") - (if (or (let ((syntax (syntax-ppss))) - (or (nth 3 syntax) - (nth 4 syntax))) + (if (or (oni-php--in-string-or-comment-p) (save-excursion (skip-syntax-backward " ") (nth 3 (syntax-ppss (1- (point))))) @@ -117,7 +130,11 @@ Do the insert N times." (skip-syntax-forward " ") (nth 3 (syntax-ppss (1+ (point)))))) (self-insert-command N) - (dotimes (_ N) (insert "->")))) + (let ((op (if (looking-back (rx (or "$" ")") (zero-or-more (any whitespace "\n" alnum "(" ")" "->"))) + (save-excursion (backward-paragraph) (point))) + "->" + "::"))) + (dotimes (_ N) (insert op))))) (defun oni-php-doc-comment () "Insert a PHP documentation comment at point." @@ -129,17 +146,52 @@ Do the insert N times." (indent-region start (point)) (goto-char insert-marker)))) +(defun oni-php-doc-use-comment () + "Insert a PHP documentation comment for a use statement." + (interactive) + (let ((start (point)) + (class (save-excursion + (save-match-data + (search-forward-regexp (rx "use " (group (minimal-match (zero-or-more alnum))) ";")) + (match-string 1))))) + (insert "/**\n * @use " class) + (let ((insert-marker (point-marker))) + (insert "\n */") + (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) - (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))) + (cond ((looking-at (rx (minimal-match (zero-or-more (any whitespace "\n"))) + "use ")) + (oni-php-doc-use-comment)) + ((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)) + (t (apply func args)))) + +(defun oni-php-generate-namespace () + (string-join + (mapcar + (lambda (s) + (let ((case-fold-search nil)) + (if (string-match-p (rx upper-case) s) + s + (capitalize s)))) + (cdr (split-string + (directory-file-name + (file-name-directory + (file-relative-name + buffer-file-name + (project-root (project-current))))) + "/"))) + "\\")) (defhydra php-mode-hydra (:color blue) ("a" align-current "Align current selection")) @@ -181,7 +233,7 @@ Otherwise call FUNC with ARGS. This is meant as advice around `(php-array-arrow (regexp . ,(rx any (group (zero-or-more whitespace)) "=>" any)) (group . (1)) - (modes . '(php-mode web-mode)) + (modes . '(php-mode web-mode php-mode)) (repeat . t))) ;; The WordPress coding standards specify that multiple assignments @@ -197,7 +249,7 @@ Otherwise call FUNC with ARGS. This is meant as advice around (regexp . ,(rx any (group (zero-or-more whitespace)) "=" (zero-or-more whitespace) any)) (group . (1)) - (modes . '(php-mode web-mode)) + (modes . '(php-mode web-mode php-ts-mode)) (repeat . t))) (with-eval-after-load 'php-mode @@ -215,13 +267,25 @@ Otherwise call FUNC with ARGS. This is meant as advice around (add-to-list 'grep-files-aliases '("php" . "*.php *.inc *.module"))) (with-eval-after-load 'autoinsert - (setf (map-elt auto-insert-alist (rx "Test.php" eos)) + (setf (map-elt auto-insert-alist (rx ".php" eos)) '(nil "<?php\n" "\n" "declare(strict_types=1);\n" "\n" - "namespace " (string-join (mapcar #'capitalize (cdr (split-string (directory-file-name (file-name-directory (file-relative-name buffer-file-name (project-root (project-current))))) "/"))) "\\") ";\n" + "namespace " (oni-php-generate-namespace) ";\n" + "\n" + "class " (file-name-sans-extension (file-name-nondirectory (buffer-file-name))) "\n" + "{\n" + > _ "\n" + "}\n") + (map-elt auto-insert-alist (rx "Test.php" eos)) + '(nil + "<?php\n" + "\n" + "declare(strict_types=1);\n" + "\n" + "namespace " (oni-php-generate-namespace) ";\n" "\n" "use Illuminate\\Foundation\\Testing\\RefreshDatabase;\n" "use Illuminate\\Foundation\\Testing\\WithFaker;\n" @@ -248,5 +312,15 @@ Otherwise call FUNC with ARGS. This is meant as advice around (defun oni-php-in-static-call-context-p () (looking-back "::\\w+" (- (point) (line-beginning-position)))) +(defun oni-php-grep-symbol (symbol) + (interactive (list (thing-at-point 'symbol))) + (rgrep (rx (literal symbol)) + (map-elt grep-files-aliases "php") + (project-root (project-current)))) + +(define-key php-mode-map (kbd "C-c .") nil t) +(define-key php-mode-map (kbd "C-c . g") '("Search for symbol at point" . oni-php-grep-symbol)) +(define-key php-mode-map (kbd "C-c . a") '("Import symbol at point" . oni-php-add-use)) + (provide 'oni-php) ;;; oni-php.el ends here diff --git a/oni-php/scripts/find-php-class b/oni-php/scripts/find-php-class index d8795c2..d38cb13 100755 --- a/oni-php/scripts/find-php-class +++ b/oni-php/scripts/find-php-class @@ -4,7 +4,10 @@ (define (main args) (let* ((class-name (cadr args)) (file-names - (run/strings (find "." -type f -name ,(string-append class-name ".php") + (run/strings (find "." + -path "./cdk.out" -prune -o + -type f + -name ,(string-append class-name ".php") -exec grep "^namespace" "{}" ";") (> 2 "/dev/null")))) (format #t "~s" diff --git a/oni-php/snippets/php-mode/class b/oni-php/snippets/php-mode/class new file mode 100644 index 0000000..26a58a1 --- /dev/null +++ b/oni-php/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-php/snippets/php-mode/factory b/oni-php/snippets/php-mode/factory new file mode 100644 index 0000000..534f227 --- /dev/null +++ b/oni-php/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-php/snippets/php-mode/logger-warning b/oni-php/snippets/php-mode/logger-warning new file mode 100644 index 0000000..3945490 --- /dev/null +++ b/oni-php/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-php/snippets/php-mode/mark-test-skipped b/oni-php/snippets/php-mode/mark-test-skipped new file mode 100644 index 0000000..ce4761d --- /dev/null +++ b/oni-php/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-php/snippets/php-mode/namespace b/oni-php/snippets/php-mode/namespace index 01abd02..7a5b5e1 100644 --- a/oni-php/snippets/php-mode/namespace +++ b/oni-php/snippets/php-mode/namespace @@ -2,8 +2,4 @@ # name: namespace # key: ns # -- -namespace ${1:`(string-join - (mapcar - (lambda (s) (let ((case-fold-search nil)) (if (string-match-p (rx upper-case) s) s (capitalize s)))) - (cdr (split-string (directory-file-name (file-name-directory (file-relative-name buffer-file-name (project-root (project-current))))) "/"))) - "\\")`};
\ No newline at end of file +namespace ${1:`(oni-php-generate-namespace)`};
\ No newline at end of file diff --git a/oni-php/snippets/php-ts-mode/.yas-parents b/oni-php/snippets/php-ts-mode/.yas-parents new file mode 100644 index 0000000..00d75e1 --- /dev/null +++ b/oni-php/snippets/php-ts-mode/.yas-parents @@ -0,0 +1 @@ +php-mode
\ No newline at end of file diff --git a/oni-project.el b/oni-project.el index 6e6e7e5..04d1890 100644 --- a/oni-project.el +++ b/oni-project.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2025.1021.110735 +;; Version: 2026.0308.033749 ;; 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 @@ -63,5 +63,7 @@ already exists." (define-key project-prefix-map (kbd "t") #'oni-project-vterm) (add-to-list 'project-switch-commands '(oni-project-vterm "Terminal"))) +(setq project-vc-extra-root-markers '(".wakatime-project")) + (provide 'oni-project) ;;; oni-project.el ends here diff --git a/oni-sql.el b/oni-sql.el new file mode 100644 index 0000000..c396019 --- /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.0406.121459 + +;; 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-sql-send-input) + +(provide 'oni-sql) +;;; oni-sql.el ends here |
