From 092304d9e0ccc37cc0ddaa9b136457e56a1cac20 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 12 Oct 2025 11:47:26 -0500 Subject: changing repositories --- modules/prog-go.el | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 modules/prog-go.el (limited to 'modules/prog-go.el') diff --git a/modules/prog-go.el b/modules/prog-go.el new file mode 100644 index 00000000..cf12cb6f --- /dev/null +++ b/modules/prog-go.el @@ -0,0 +1,41 @@ +;;; prog-go --- Golang Specific Settings and Functionality -*- lexical-binding: t; coding: utf-8; -*- +;; author Craig Jennings + +;;; Commentary: + +;;; Code: + +;; ---------------------------------- Go Setup --------------------------------- +;; golang preferences + +(defun cj/go-setup () + "My default code preferences for Golang." + (require 'tree-sitter) + (require 'tree-sitter-langs) + (require 'tree-sitter-hl) + (tree-sitter-hl-mode) + (hs-minor-mode) + (company-mode) + (setq-default tab-width 4) ;; set the tab width to 4 spaces + (setq-default standard-indent 4) ;; indent 4 spaces + (setq-default indent-tabs-mode nil) ;; disable tab characters + (electric-pair-mode t)) ;; match delimiters automatically +(add-hook 'go-mode-hook 'cj/go-setup) + +;; ---------------------------------- Go Mode ---------------------------------- +;; go mode configuration + +(use-package go-mode + :bind (:map go-mode-map + ("" . gofmt) + ("C-c 6" . gofmt) + ("" . golint) + ("C-c 4" . golint)) + :config + (add-to-list 'exec-path "~/go/bin") + ;; allow adding/removing fmt lines; install with: + ;; go install golang.org/x/tools/cmd/goimports@latest + (setq gofmt-command "goimports")) + +(provide 'prog-go) +;;; prog-go.el ends here -- cgit v1.2.3