 
 (use-package lsp-treemacs)		;
 
+(defun aim/lsp-go-install-save-hooks ()
+  (add-hook 'before-save-hook #'lsp-format-buffer t t)
+  (add-hook 'before-save-hook #'lsp-organize-imports t t))
+
+(use-package go-test)
+
 (use-package go-mode
   :custom
   (go-fontify-function-calls nil)
   (go-fontify-variables nil)
-  (gofmt-command "goimports")
   :bind (:map go-mode-map
 	      ("C-c C-n" . go-run)
 	      ("C-c ."   . go-test-current-test)

    ("sfr" lsp-workspace-folders-remove "folders -")
    ("sfb" lsp-workspace-blacklist-remove "blacklist -"))))

(use-package tree-sitter
  :init (global-tree-sitter-mode)
  :hook ((ruby-mode . tree-sitter-hl-mode)
         (js-mode . tree-sitter-hl-mode)
         (typescript-mode . tree-sitter-hl-mode)
         (go-mode . tree-sitter-hl-mode)))

(use-package tree-sitter-langs)

(mapcar #'(lambda (x)
	    (define-key global-map (kbd (car x)) (cdr x)))
	'(("C-x C-b" . ibuffer)

	lsp-enable-snippet nil
	lsp-prefer-capf t
	lsp-prefer-flymake nil)
  :config
  (add-to-list 'lsp-file-watch-ignored "[/\\\\]\\.direnv$")
  (lsp-enable-which-key-integration t)
