This commit is contained in:
Raymundo Vásquez Ruiz
2023-05-27 21:32:12 +02:00
parent 8a91c170cb
commit a35dfaac7c
2 changed files with 16 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ There are two things you can do about this warning:
'(global-display-line-numbers-mode t)
'(inhibit-startup-screen t)
'(package-selected-packages
'(doom-themes lsp-mode hydra gitlab-ci-mode gitlab-ci-mode-flycheck web-mode impatient-mode exec-path-from-shell rust-playground all-the-icons neotree base16-theme afternoon-theme ample-theme nord-theme company-racer racer markdown-mode+ dumb-jump magit company flycheck-rust flycheck json-mode flymake-json tss tide material-theme zenburn-theme ac-js2 auto-complete projectile helm js2-mode cargo rust-mode iedit gitlab-ci-mode gitlab-ci-mode-flycheck dap-mode typescript-mode tree-sitter tree-sitter-langs))
'(flycheck-gometalinter go-mode doom-themes lsp-mode hydra gitlab-ci-mode gitlab-ci-mode-flycheck web-mode impatient-mode exec-path-from-shell rust-playground all-the-icons neotree base16-theme afternoon-theme ample-theme nord-theme company-racer racer markdown-mode+ dumb-jump magit company flycheck-rust flycheck json-mode flymake-json tss tide material-theme zenburn-theme ac-js2 auto-complete projectile helm js2-mode cargo rust-mode iedit gitlab-ci-mode gitlab-ci-mode-flycheck dap-mode typescript-mode tree-sitter tree-sitter-langs))
'(tool-bar-mode nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
@@ -43,3 +43,4 @@ There are two things you can do about this warning:
(require 'init-web)
(require 'init-js-ts)
(require 'init-rust)
(require 'init-go)

14
lib/init-go.el Normal file
View File

@@ -0,0 +1,14 @@
(require 'go-mode)
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-mode))
(require 'lsp-mode)
(add-hook 'go-mode-hook #'lsp-deferred)
;; Set up before-save hooks to format buffer and add/delete imports.
;; Make sure you don't have other gofmt/goimports hooks enabled.
(defun 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))
(add-hook 'go-mode-hook #'lsp-go-install-save-hooks)
(provide 'init-go)