Last active
March 6, 2020 23:45
-
-
Save everdance/30dd23eae48bfe7e920e74fee0f3d8da to your computer and use it in GitHub Desktop.
simple go emacs init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
(setq package-archives | |
'(("gnu" . "https://elpa.gnu.org/packages/") | |
("melpa-stb" . "https://stable.melpa.org/packages/") | |
("melpa" . "https://melpa.org/packages/")) | |
tls-checktrust t | |
tls-program '("gnutls-cli --x509cafile %t -p %p %h") | |
gnutls-verify-error t) | |
(package-initialize) | |
(add-to-list 'exec-path "~/go/bin") | |
;;Goimports | |
(defun go-mode-setup () | |
(add-hook 'before-save-hook 'gofmt-before-save) | |
(setq gofmt-command "goimports") | |
(local-set-key (kbd "M-.") 'godef-jump) | |
(add-hook 'before-save-hook 'gofmt-before-save)) | |
(add-hook 'go-mode-hook 'go-mode-setup) | |
;;Load auto-complete | |
(ac-config-default) | |
(require 'auto-complete-config) | |
(require 'go-autocomplete) | |
;;Configure golint | |
(add-to-list 'load-path (concat (getenv "GOPATH") "/src/github.com/golang/lint/misc/emacs")) | |
(require 'golint) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(custom-enabled-themes (quote (tsdh-dark)))) | |
(add-to-list 'default-frame-alist '(font . "Menlo-18")) | |
(setq-default | |
tab-width 2 | |
standard-indent 2 | |
indent-tabs-mode nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment