diff --git a/mode-customizations.el b/mode-customizations.el index 6c28836..a270694 100644 --- a/mode-customizations.el +++ b/mode-customizations.el @@ -12,6 +12,7 @@ (load-file (get-config-path "mode-customizations/erlang-mode.el")) (load-file (get-config-path "mode-customizations/feature-mode.el")) (load-file (get-config-path "mode-customizations/git-commit-mode.el")) +(load-file (get-config-path "mode-customizations/go-mode.el")) (load-file (get-config-path "mode-customizations/haml-mode.el")) (load-file (get-config-path "mode-customizations/html-mode.el")) (load-file (get-config-path "mode-customizations/js-mode.el")) diff --git a/mode-customizations/go-mode.el b/mode-customizations/go-mode.el new file mode 100644 index 0000000..d0e3467 --- /dev/null +++ b/mode-customizations/go-mode.el @@ -0,0 +1,16 @@ +(defun customizations-for-go-mode () + (interactive) + (flyspell-prog-mode) + (flycheck-mode) + (linum-mode t) + (fci-mode) + (auto-complete-mode) + (whitespace-mode) + (subword-mode) + (setq tab-width 4) + (setq highlight-indentation-offset 4) + (highlight-indentation-mode) + (highlight-indentation-current-column-mode)) + +(add-hook 'go-mode-hook 'customizations-for-go-mode) +(add-hook 'before-save-hook #'gofmt-before-save) diff --git a/packages.el b/packages.el index 7c9d4dc..79fc75c 100644 --- a/packages.el +++ b/packages.el @@ -50,6 +50,10 @@ full-ack gitconfig-mode github-browse-file + go-autocomplete + go-mode + go-projectile + go-snippets grizzl haml-mode helm @@ -171,7 +175,13 @@ (if window-system (ecb-activate))) ;; Load Auto-Complete - (require 'auto-complete) + (when (require 'auto-complete nil 'noerror) + (require 'auto-complete-config) + (ac-config-default) + (ac-flyspell-workaround) + + ;; load go-autocomplete + (require 'go-autocomplete nil 'noerror)) ;; Load browse-kill-ring (require 'browse-kill-ring) @@ -198,6 +208,9 @@ ;; Load full-ack (require 'full-ack) + ;; load go-projectile + (require 'go-projectile nil 'noerror) + ;; Load yasnippet (when (require 'yasnippet nil 'noerror) (yas/global-mode t))