org
1#+Begin_SRC go 2package main 3import ("fmt") 4 5func main(){ 6 fmt.Println("emacs") 7} 8#+End_Src
// .emacs.d.init.el
emacs.d/init
1(when (memq window-system '(mac ns)) 2 (exec-path-from-shell-initialize) 3 (exec-path-from-shell-copy-env "GOPATH")) 4 5;; Define function to call when go-mode loads 6(defun my-go-mode-hook () 7 (add-hook 'before-save-hook 'gofmt-before-save) ; gofmt before every save 8 (setq gofmt-command "goimports") ; gofmt uses invokes goimports 9 (if (not (string-match "go" compile-command)) ; set compile command default 10 (set (make-local-variable 'compile-command) 11 "go build -v && go test -v && go vet")) 12 13 ;; guru settings 14 (go-guru-hl-identifier-mode) ; highlight identifiers 15 16 ;; Key bindings specific to go-mode 17 (local-set-key (kbd "M-.") 'godef-jump) ; Go to definition 18 (local-set-key (kbd "M-*") 'pop-tag-mark) ; Return from whence you came 19 (local-set-key (kbd "M-p") 'compile) ; Invoke compiler 20 (local-set-key (kbd "M-P") 'recompile) ; Redo most recent compile cmd 21 (local-set-key (kbd "M-]") 'next-error) ; Go to next error (or msg) 22 (local-set-key (kbd "M-[") 'previous-error) ; Go to previous error or msg 23 24 25 (auto-complete-mode 1)) 26 27 28(add-hook 'go-mode-hook 'my-go-mode-hook) 29 30(with-eval-after-load 'go-mode 31 (require 'go-autocomplete)) 32 33(require 'go-guru)
; i want use ob-go , above code just compile the code
ob
1;(require 'ob-go) 2;(org-babel-do-load-languages 3;'org-babel-load-languages 4;'((go . t)))
But this is not execute how i execute this block . I'm new in Literal Programming Please help me
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/02 13:59