From cb3eef4d198a5b38481f1b114e227539240e291c Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 21 Jan 2022 18:20:34 +0800 Subject: go-conf: configure go-mode --- go-conf.el | 30 ++++++++++++++++++++++++++++++ init.el | 16 +++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 go-conf.el 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: 李俊緯 +;; 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 . + +;;; 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 -- cgit v1.2.3-18-g5258