diff options
Diffstat (limited to 'modules/prog-go.el')
| -rw-r--r-- | modules/prog-go.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/prog-go.el b/modules/prog-go.el index 465cbf14..0d271617 100644 --- a/modules/prog-go.el +++ b/modules/prog-go.el @@ -31,9 +31,6 @@ Install with: go install golang.org/x/tools/gopls@latest") "Path to Delve debugger. Install with: go install github.com/go-delve/delve/cmd/dlv@latest") -(defvar go-ts-mode-map) -(defvar go-mod-ts-mode-map) - ;; Forward declarations for LSP (declare-function lsp-deferred "lsp-mode") (defvar lsp-go-gopls-server-path) @@ -88,6 +85,9 @@ Install with: go install github.com/go-delve/delve/cmd/dlv@latest") (defun cj/go-mode-keybindings () "Set up keybindings for Go programming. Overrides default prog-mode keybindings with Go-specific commands." + ;; C-; f: Format with gofmt/goimports + (local-set-key (kbd "C-; f") #'gofmt) + ;; S-f5: Run staticcheck (static analysis) (local-set-key (kbd "S-<f5>") #'cj/go-staticcheck) @@ -100,8 +100,6 @@ Overrides default prog-mode keybindings with Go-specific commands." (use-package go-mode :hook ((go-ts-mode . cj/go-setup) (go-ts-mode . cj/go-mode-keybindings)) - :bind (:map go-ts-mode-map - ("C-; f" . gofmt)) ;; Override global formatter with gofmt/goimports :mode (("\\.go\\'" . go-ts-mode) ;; .go files use go-ts-mode ("go\\.mod\\'" . go-mod-ts-mode)) ;; go.mod uses go-mod-ts-mode :config |
