 ;; (defun aim/frame-colours-unspecified (frame)
 ;;   (interactive)
 ;;   (let ((fg (face-attribute 'default :foreground frame))
-;; 	(bg (face-attribute 'default :background frame)))
+;;	(bg (face-attribute 'default :background frame)))
 ;;     (and (equal fg "unspecified-fg") (equal bg "unspecified-bg"))))
 
 ;; (defun aim/on-frame-open (frame)

;;(setq company-auto-complete 'never)
;;(company-tng-configure-default)

;; (use-package go-mode
;;   :mode
;;   "\\.go\\'"
;;   :config
;;   (setq gofmt-command "goimports")
;;   (remove-hook 'go-mode 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)
;;   :bind
;;   (:map go-mode-map
;; 	("C-M-x" . aim/run-go-buffer)
;; 	("M-." . godef-jump)))

(use-package go-mode
  :mode "\\.go\\'"
  :custom (gofmt-command "goimports")
  :bind (:map go-mode-map
	      ("C-c C-n" . go-run)
	      ("C-c ."   . go-test-current-test)
	      ("C-c f"   . go-test-current-file)
	      ("C-c a"   . go-test-current-project))
  :config
  (add-hook 'before-save-hook #'gofmt-before-save)
  (setq gofmt-command "goimports")
  (use-package gotest)
  (use-package go-tag
    :config (setq go-tag-args (list "-transform" "camelcase"))))

(use-package flycheck)



(aim/set-global-keybindings)
;; (add-hook 'after-init-hook
;;	  (lambda ()
;;	    (load-theme 'modus-vivendi t)))
;; (electric-indent-mode 1)

(auto-compression-mode)

;;; LSP speedups
;;
;; Increase the amount of data which Emacs reads from the process.
;; Again the emacs default is too low 4k considering that the some of
;; the language server responses are in 800k - 3M range.
(setq read-process-output-max (* 5 (* 1024 1024))) ;; 1mb

;; Optional: use company-capf . Although company-lsp also supports
;; caching lsp-mode’s company-capf does that by default. To achieve
;; that uninstall company-lsp or put these lines in your config:
(setq lsp-prefer-capf t)

;; The buffer *Flymake log* tends to fill up with things like:
;; > Warning [flymake init.el]: Disabling backend flymake-proc-legacy-flymake
;; > because (error Can’t find a suitable init function)
(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)
(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 '(modus-vivendi))
 '(gofmt-command "goimports")
 '(lsp-keymap-prefix ""))
(custom-set-faces
 ;; custom-set-faces 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.
 )
