summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-01-21 18:20:34 +0800
committerJSDurand <mmemmew@gmail.com>2022-01-21 18:20:34 +0800
commitcb3eef4d198a5b38481f1b114e227539240e291c (patch)
tree69a6af1366143757c635d8c567ec94445fa460d3
parented850a8ac2d6b705f1b6e9469fa6d596b8c80732 (diff)
go-conf: configure go-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