forked from uberkael/awk-yasnippets
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathawk-yasnippets.el
51 lines (40 loc) · 1.7 KB
/
awk-yasnippets.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;;; awk-yasnippets.el --- Yasnippets for AWK -*- lexical-binding: t; -*-
;; Copyright (C) 2023 Adriano Martinez
;; Author: Adriano Martinez
;; Maintainer: Adriano Martinez <[email protected]>
;; Created: 03 April 2023
;; Version: 0.0.1
;; Keywords: extensions
;; URL: https://github.com/uberkael/awk-yasnippets
;; Package-Requires: ((emacs "26.3") (yasnippet "0.8.0"))
;; License: GPL-3.0-or-later
;; 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:
;; Yasnippets for AWK
;; A collection of snippets to expedite writing AWK scripts.
;;
;;; Code:
;;;; requires
(require 'yasnippet)
;; Define the root of the package
(defvar awk-yasnippets-root
(file-name-directory (or load-file-name (buffer-file-name))))
;;;###autoload
(defun awk-yasnippets-initialize ()
"Initialize the package, loading the snippets into yasnippets."
(let ((snippets-dir (expand-file-name "awk-mode" awk-yasnippets-root)))
(when (boundp 'yas-snippet-dirs)
(add-to-list 'yas-snippet-dirs snippets-dir t))
(yas-load-directory snippets-dir)))
;;; Provide package
(provide 'awk-yasnippets)
;;; awk-yasnippets.el ends here