Skip to content

Commit b45c89a

Browse files
committed
feat(on-demand/gitlab-ci): add a helper command +gitlab-ci-add-schema
1 parent 7788f5b commit b45c89a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

modules/on-demand/me-gitlab-ci.el

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,22 @@
1414
:companion-packages '(((yaml-mode yaml-ts-mode) . gitlab-ci-mode)))
1515

1616

17+
;;;###autoload(autoload '+gitlab-ci-add-schema "on-demand/me-gitlab-ci")
18+
19+
1720
;; Mode for editing GitLab CI files
1821
(use-package gitlab-ci-mode
19-
:straight t)
22+
:straight t
23+
:init
24+
(defun +gitlab-ci-add-schema ()
25+
(interactive)
26+
(save-excursion
27+
(save-restriction
28+
(widen)
29+
(goto-char (point-min))
30+
(insert "# yaml-language-server: "
31+
"$schema=https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"
32+
"\n\n")))))
2033

2134

2235
(provide 'on-demand/me-gitlab-ci)

0 commit comments

Comments
 (0)