diff options
| -rw-r--r-- | oni-corfu.el | 41 | ||||
| -rw-r--r-- | oni-gui/oni-gui.el | 3 | ||||
| -rw-r--r-- | oni-magit.el | 22 | ||||
| -rw-r--r-- | oni-php/oni-php.el | 31 | ||||
| -rw-r--r-- | oni-php/snippets/php-mode/phpstan-ignore | 5 |
5 files changed, 93 insertions, 9 deletions
diff --git a/oni-corfu.el b/oni-corfu.el new file mode 100644 index 0000000..4a16aed --- /dev/null +++ b/oni-corfu.el @@ -0,0 +1,41 @@ +;;; oni-corfu.el --- Configuration for corfu -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Tom Willemse + +;; Author: Tom Willemse <tom@ryuslash.org> +;; Keywords: local +;; Version: 2026.0514.121624 +;; Package-Requires: (corfu oni-prescient cape) + +;; 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 the corfu in-buffer completion framework. + +;;; Code: + +(require 'corfu) +(require 'minibuffer) + +(setq corfu-auto t) + +(add-hook 'corfu-mode-hook 'corfu-prescient-mode) + +(add-to-list 'completion-at-point-functions 'cape-abbrev) +(add-to-list 'completion-at-point-functions 'cape-dabbrev) +(add-to-list 'completion-at-point-functions 'cape-file) + +(provide 'oni-corfu) +;;; oni-corfu.el ends here diff --git a/oni-gui/oni-gui.el b/oni-gui/oni-gui.el index 38e3ab5..7efd167 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: 2026.0310.095909 +;; Version: 2026.0514.155439 ;; Package-Requires: (oni-ui oni-hydra yoshi-theme diminish) ;; This program is free software; you can redistribute it and/or modify @@ -135,6 +135,7 @@ _bi_: Auto Insert ^^ ^^ (global-set-key (kbd "C-c c") '("Frequently used commands" . oni-gui-hydra/body)) (load-theme 'yoshi :no-confirm) +(require 'yoshi-mode-line) (when (fboundp 'pixel-scroll-precision-mode) (pixel-scroll-precision-mode)) diff --git a/oni-magit.el b/oni-magit.el index 9e34fcd..a0fc451 100644 --- a/oni-magit.el +++ b/oni-magit.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2026.0106.150051 +;; Version: 2026.0427.130949 ;; Package-Requires: (magit magit-popup oni-hydra) ;; This program is free software; you can redistribute it and/or modify @@ -70,5 +70,25 @@ _i_: Init ;;;###autoload (global-set-key (kbd "C-c v") '("Magit commands" . oni-hydra-magit/body)) +(defun oni-magit-highlight-linear-keywords () + "Highlight and link Linear links." + (while (re-search-forward (rx "[" (or "15U" "GOL" "OPT") "-" (minimal-match (one-or-more digit)) "]") nil t) + (let ((match-text (buffer-substring-no-properties + (1+ (match-beginning 0)) + (1- (match-end 0))))) + (put-text-property (match-beginning 0) + (match-end 0) + 'font-lock-face 'link) + (put-text-property (match-beginning 0) + (match-end 0) + 'local-map (let ((keymap (make-sparse-keymap))) + (define-key keymap (kbd "RET") + (lambda () + (interactive) + (browse-url (format "https://linear.app/goldcoin/issue/%s" match-text)))) + keymap))))) + +(add-hook 'forge-topic-wash-title-hook 'oni-magit-highlight-linear-keywords) + (provide 'oni-magit) ;;; oni-magit.el ends here diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index e591983..11d4f3b 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.0501.153153 -;; Package-Requires: (oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters rainbow-identifiers) +;; Version: 2026.0514.120954 +;; Package-Requires: (oni-yasnippet oni-flycheck oni-hydra oni-corfu ggtags fic-mode 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 @@ -28,7 +28,6 @@ ;;; Code: (require 'align) -(require 'company) (require 'hydra) (require 'map) (require 'project) @@ -197,6 +196,26 @@ Otherwise call FUNC with ARGS. This is meant as advice around "Set any settings for dabbrev that make sense for PHP code." (setq-local dabbrev-abbrev-skip-leading-regexp (rx "$"))) +(defun oni-php-ignore-error-at-point (error-type) + (interactive + (list (let* ((error-types + (seq-uniq + (mapcar (lambda (e) + (let ((str (flycheck-error-message e))) + (string-match (rx "🪪" (one-or-more whitespace) (group (one-or-more (any alnum ".")))) str) + (match-string 1 str))) + (seq-filter (lambda (e) (not (flycheck-error-checker e))) + (flycheck-overlay-errors-at (point)))) + 'string=))) + (if (> 1 (length error-types)) + (completing-read "Ignore type: " error-types) + (car error-types))))) + (save-excursion + (goto-char (line-beginning-position)) + (indent-for-tab-command) + (insert "/** @phpstan-ignore " error-type " */\n") + (indent-for-tab-command))) + (defhydra php-mode-hydra (:color blue) ("a" align-current "Align current selection")) @@ -204,7 +223,6 @@ Otherwise call FUNC with ARGS. This is meant as advice around (add-hook 'php-mode-hook #'oni-php--set-require-final-newline) (add-hook 'php-mode-hook #'oni-php--whitespace-mode) -(add-hook 'php-mode-hook 'company-mode) (add-hook 'php-mode-hook 'display-fill-column-indicator-mode) (add-hook 'php-mode-hook 'electric-indent-local-mode) (add-hook 'php-mode-hook 'fic-mode) @@ -218,9 +236,7 @@ Otherwise call FUNC with ARGS. This is meant as advice around (add-hook 'php-mode-hook 'smartparens-mode) (add-hook 'php-mode-hook 'subword-mode) (add-hook 'php-mode-hook 'yas-minor-mode) - -(with-eval-after-load 'company - (add-to-list 'company-backends 'company-ac-php-backend)) +(add-hook 'php-mode-hook 'corfu-mode) (define-key php-mode-map (kbd "C-c m") #'php-mode-hydra/body) (define-key php-mode-map (kbd ".") #'oni-php-insert-dot-dwim) @@ -333,6 +349,7 @@ point." (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)) +(define-key php-mode-map (kbd "C-c . i") '("Ignore error at point" . oni-php-ignore-error-at-point)) (provide 'oni-php) ;;; oni-php.el ends here diff --git a/oni-php/snippets/php-mode/phpstan-ignore b/oni-php/snippets/php-mode/phpstan-ignore new file mode 100644 index 0000000..91439ba --- /dev/null +++ b/oni-php/snippets/php-mode/phpstan-ignore @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: phpstan-ignore +# key: @i +# -- +/** @phpstan-ignore $1 */
\ No newline at end of file |
