initial pass at a golang mode
This commit is contained in:
parent
da342f5eea
commit
7528363350
47
contrib/lang/go/README.md
Normal file
47
contrib/lang/go/README.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# go contribution layer for Spacemacs
|
||||
|
||||
![go](img/go.png)
|
||||
|
||||
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
|
||||
**Table of Contents**
|
||||
|
||||
- [go contribution layer for Spacemacs](#go-contribution-layer-for-spacemacs)
|
||||
- [Description](#description)
|
||||
- [Install](#install)
|
||||
- [Layer](#layer)
|
||||
- [Working with Go](#working-with-go)
|
||||
|
||||
<!-- markdown-toc end -->
|
||||
|
||||
## Description
|
||||
|
||||
This layers adds extensive support for go.
|
||||
|
||||
Features:
|
||||
- gofmt on file save
|
||||
|
||||
## Install
|
||||
|
||||
### Layer
|
||||
|
||||
To use this contribution add it to your `~/.spacemacs`
|
||||
|
||||
```elisp
|
||||
(setq-default dotspacemacs-configuration-layers '(go)
|
||||
"List of contribution to load."
|
||||
)
|
||||
```
|
||||
|
||||
## Working with Go
|
||||
|
||||
Go commands (start with `m`):
|
||||
|
||||
Key Binding | Description
|
||||
---------------------------|------------------------------------------------------------
|
||||
<kbd>SPC m d p</kbd> | godoc at point
|
||||
<kbd>SPC m i g</kbd> | goto imports
|
||||
<kbd>SPC m i a</kbd> | add import
|
||||
<kbd>SPC m i r</kbd> | remove unused import
|
||||
<kbd>SPC m p b</kbd> | go-play buffer
|
||||
<kbd>SPC m p r</kbd> | go-play region
|
||||
<kbd>SPC m p d</kbd> | download go-play snippet
|
BIN
contrib/lang/go/img/go.png
Normal file
BIN
contrib/lang/go/img/go.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
27
contrib/lang/go/packages.el
Normal file
27
contrib/lang/go/packages.el
Normal file
|
@ -0,0 +1,27 @@
|
|||
(defvar go-packages
|
||||
'(
|
||||
go-mode
|
||||
)
|
||||
"List of all packages to install and/or initialize. Built-in packages
|
||||
which require an initialization must be listed explicitly in the list.")
|
||||
|
||||
(defun go/init-go-mode()
|
||||
(use-package go-mode
|
||||
:defer t
|
||||
:init
|
||||
(progn
|
||||
(evil-leader/set-key
|
||||
"mdp" 'godoc-at-point
|
||||
"mig" 'go-goto-imports
|
||||
"mia" 'go-import-add
|
||||
"mir" 'go-remove-unused-imports
|
||||
"mpb" 'go-play-buffer
|
||||
"mpr" 'go-play-region
|
||||
"mpd" 'go-download-play
|
||||
)
|
||||
)
|
||||
:config
|
||||
(add-hook 'before-save-hook 'gofmt-before-save)
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in a new issue