Created
August 21, 2020 04:05
-
-
Save bizenn/7bfdcebb5785f31736b11840f2bdb636 to your computer and use it in GitHub Desktop.
go-import-add の候補にシステムのパッケージが含まれなくなってしまったので、無理矢理回避
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; go-system-packagesの初期化はもう少しマシな実装がありそうな気がする | |
(defvar go-system-packages nil) | |
(use-package go-mode | |
:ensure t | |
:ensure go-eldoc | |
:ensure flycheck-gometalinter | |
:ensure godoctor | |
:init | |
(add-hook 'go-mode-hook 'go-eldoc-setup) | |
(add-hook 'go-mode-hook 'flycheck-mode) | |
(add-hook 'before-save-hook 'gofmt-before-save) | |
:config | |
(set-face-attribute 'eldoc-highlight-function-argument nil | |
:underline t :foreground "green" | |
:weight 'bold) | |
(flycheck-gometalinter-setup) | |
(setq flycheck-gometalinter-fast 1 | |
flycheck-gometalinter-test 1) | |
(setq go-system-packages | |
(let ((owd default-directory)) | |
(cd "~/") | |
(let ((l (go-packages-go-list))) | |
(cd owd) | |
l))) | |
:custom | |
(go-packages-function | |
(lambda () | |
(append go-system-packages | |
(process-lines go-command "list" "-m" "-f" "{{.Path}}" "all") | |
(process-lines go-command "list" "-e" "all")))) | |
:bind | |
("M-." . godef-jump)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment