Skip to content

Instantly share code, notes, and snippets.

@abperiasamy
Created March 30, 2016 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abperiasamy/5c1d2a7c879f6d1d5faf00eaf3710925 to your computer and use it in GitHub Desktop.
Save abperiasamy/5c1d2a7c879f6d1d5faf00eaf3710925 to your computer and use it in GitHub Desktop.
; Go mode
(add-to-list 'load-path "~/.emacs.d/extensions/")
(require 'go-mode-autoloads)
(require 'auto-complete)
(require 'auto-complete-config)
(require 'go-autocomplete)
(require 'go-flycheck)
(add-hook 'after-init-hook #'global-flycheck-mode)
(global-auto-complete-mode t)
;; Enable auto-fill mode for comments.
(defun comment-auto-fill ()
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode 1))
(defun go-mode-setup ()
(add-hook 'before-save-hook 'gofmt-before-save)
(projectile-global-mode)
(comment-auto-fill)
(setq compilation-scroll-output 'first-error)
; (setq compile-command "godep go build -v && godep go test -v && godep go vet && godep go install github.com/minio-io/mc")
(go-eldoc-setup)
(setq gofmt-command "goimports")
;; Line number mode
;; (linum-mode 1)
;; (go-oracle-mode)
;; (hlinum-activate)
)
(add-hook 'go-mode-hook 'go-mode-setup)
(add-hook 'before-save-hook 'gofmt-before-save)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment