Skip to content

Commit

Permalink
feat(on-demand/gitlab-ci): add a helper command +gitlab-ci-add-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Dec 20, 2024
1 parent 7788f5b commit b45c89a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modules/on-demand/me-gitlab-ci.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,22 @@
:companion-packages '(((yaml-mode yaml-ts-mode) . gitlab-ci-mode)))


;;;###autoload(autoload '+gitlab-ci-add-schema "on-demand/me-gitlab-ci")


;; Mode for editing GitLab CI files
(use-package gitlab-ci-mode
:straight t)
:straight t
:init
(defun +gitlab-ci-add-schema ()
(interactive)
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(insert "# yaml-language-server: "
"$schema=https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"
"\n\n")))))


(provide 'on-demand/me-gitlab-ci)
Expand Down

0 comments on commit b45c89a

Please sign in to comment.