 ;;  :config
 ;;  (projectile-mode +1))
 
+;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
+;; (setq lsp-keymap-prefix "s-l")
 ;; (use-package lsp-mode
 ;;   :ensure t
 ;;   :commands lsp


(use-package notmuch
  :config
  (setq notmuch-hello-thousands-separator ","))

(defun atomic-chrome-server-running-p ()
  "Returns t if the atomic-chrome server is currently running, otherwise nil."

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

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

;; (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"))))

;; from https://lupan.pl/dotemacs/
(defun my-go-electric-brace ()
  "Insert an opening brace may be with the closing one.
If there is a space before the brace also adds new line with
properly indented closing brace and moves cursor to another line
inserted between the braces between the braces."
  (interactive)
  (insert "{")
  (when (looking-back " {")
    (newline)
    (indent-according-to-mode)
    (save-excursion
      (newline)
      (insert "}")
      (indent-according-to-mode))))

(defun my-godoc-package ()
  "Display godoc for given package (with completion)."
  (interactive)
  (godoc (or (helm :sources (helm-build-sync-source "Go packages"
			    :candidates (go-packages))
		   :buffer "*godoc packages*")
	     (signal 'quit nil))))

(use-package go-mode
  :init
  (setq go-fontify-function-calls nil)
  :bind
  (:map go-mode-map
	("C-c e g" . godoc)
	("C-c P" . my-godoc-package)
	("{" . my-go-electric-brace))
  :hook ((go-mode . lsp)
	 (go-mode . smartparens-mode)))

(defun aim/setup-ac-complete nil
  (interactive)
