Add go-mode config

This commit is contained in:
Camden Dixie O'Brien 2024-12-19 16:41:12 +00:00
parent 6bc67c0c82
commit 6e4565cd90

View File

@ -1261,6 +1261,24 @@
(use-package scad-mode) (use-package scad-mode)
#+end_src #+end_src
** Go
First of all, of course, install =go-mode=:
#+begin_src emacs-lisp
(use-package go-mode)
#+end_src
This package provides a convenient lil function to use gofmt to
format a buffer; I want to run this whenever I save a go source
file. This is pretty easily done by adding a =before-save-hook= in
a =go-mode-hook= (hey, I heard you like hooks...)
#+begin_src emacs-lisp
(add-hook 'go-mode-hook
(lambda ()
(add-hook 'before-save-hook 'gofmt-before-save)))
#+end_src
* Tool Integrations * Tool Integrations
** Git ** Git
=magit= is truly a wonderful creation! Add keybinding for =magit= is truly a wonderful creation! Add keybinding for