DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
Cheat sheet
Emacs tips and tricks.

Melpa

~/.emacs
1
(require 'package)
2
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
3
;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
4
;; and `package-pinned-packages`. Most users will not need or want to do this.
5
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
6
(package-initialize)
Copied!
Note that you'll need to run M-x package-refresh-contents or M-x package-list-packages to ensure that Emacs has fetched the MELPA package list before you can install packages with M-x package-install or similar.

References

Golang

Install go-mode.

1
M-x package-install go-mode
Copied!

Indenting and autoformat

~/.emacs
1
(add-hook 'go-mode-hook
2
(lambda ()
3
(add-hook 'before-save-hook 'gofmt-before-save)
4
(setq tab-width 4)
5
(setq indent-tabs-mode 1)))
Copied!