Skip to content

Instantly share code, notes, and snippets.

@erain
Forked from samertm/.emacs
Last active August 29, 2015 14:03
Show Gist options
  • Save erain/d390b26f164d52ed132b to your computer and use it in GitHub Desktop.
Save erain/d390b26f164d52ed132b to your computer and use it in GitHub Desktop.
;; http://youtu.be/h8bsJV0-2qs
;; get the following packages:
;; go-mode
;; go-eldoc
;; company-mode
;; company-go
;; get the following go programs (run each line in your shell):
;; go get code.google.com/p/go.tools/cmd/goimports
;; go get code.google.com/p/rog-go/exp/cmd/godef
;; go get github.com/nsf/gocode
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(setq company-idle-delay nil)
(global-set-key (kbd "C-c M-n") 'company-complete)
(global-set-key (kbd "C-c C-n") 'company-complete)
(defun my-go-mode-hook ()
(local-set-key (kbd "C-c m") 'gofmt)
(local-set-key (kbd "M-.") 'godef-jump))
(set (make-local-variable 'company-backends) '(company-go)))
(add-hook 'go-mode-hook 'my-go-mode-hook)
(add-hook 'go-mode-hook 'go-eldoc-setup)
(add-hook 'go-mode-hook 'company-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment