summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go-conf.el30
-rw-r--r--init.el16
2 files changed, 45 insertions, 1 deletions
diff --git a/go-conf.el b/go-conf.el
new file mode 100644
index 0000000..fe0e035
--- /dev/null
+++ b/go-conf.el
@@ -0,0 +1,30 @@
+;;; go-conf.el --- Configurations for Go-mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2022 李俊緯
+
+;; Author: 李俊緯 <mmemmew@gmail.com>
+;; Keywords: convenience, emulations, tools
+
+;; 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 configurations for Go-mode.
+
+;;; Code:
+
+(use-package "go-mode" 'go-mode)
+
+(provide 'go-conf)
+;;; go-conf.el ends here
diff --git a/init.el b/init.el
index d02b525..bfa603c 100644
--- a/init.el
+++ b/init.el
@@ -356,6 +356,21 @@ no effect."
(define-key global-map (vector ?\C-\s-r) #'rotate-frame-clockwise)
(define-key global-map (vector ?\C-\s-t) #'transpose-frame))
+;;; Go-mode
+
+(load-after-function
+ go-mode "go-conf.el"
+ "Load Go-mode configurations and lauch it." nil
+ (go-mode))
+
+(cond
+ ((assoc "\\.go$" auto-mode-alist #'string=)
+ (setcdr
+ (assoc "\\.go$" auto-mode-alist #'string=)
+ #'go-mode))
+ ((add-to-list 'auto-mode-alist
+ (cons "\\.go$" #'go-mode))))
+
;;; server
;; (cond
@@ -365,5 +380,4 @@ no effect."
(setq gc-cons-threshold (* 2 1024 1024))
(provide 'init)
-
;;; init.el ends here