Factor out Go setup into its own section
This commit is contained in:
parent
428cc23449
commit
c65b8834ba
24
README.org
24
README.org
@ -376,8 +376,6 @@ the contents of packages and allows to update packages to the latest version.
|
|||||||
#+begin_src emacs-lisp -n :results silent
|
#+begin_src emacs-lisp -n :results silent
|
||||||
(when (require 'treesit nil 'noerror)
|
(when (require 'treesit nil 'noerror)
|
||||||
(setopt
|
(setopt
|
||||||
;; Set `tab-width' in `after-change-major-mode-hook' function too.
|
|
||||||
go-ts-mode-indent-offset 2
|
|
||||||
treesit-language-source-alist
|
treesit-language-source-alist
|
||||||
'((bash "https://github.com/tree-sitter/tree-sitter-bash" "master" "src")
|
'((bash "https://github.com/tree-sitter/tree-sitter-bash" "master" "src")
|
||||||
(c "https://github.com/tree-sitter/tree-sitter-c" "master" "src")
|
(c "https://github.com/tree-sitter/tree-sitter-c" "master" "src")
|
||||||
@ -407,13 +405,7 @@ the contents of packages and allows to update packages to the latest version.
|
|||||||
"master" "tsx/src")
|
"master" "tsx/src")
|
||||||
(typescript "https://github.com/tree-sitter/tree-sitter-typescript"
|
(typescript "https://github.com/tree-sitter/tree-sitter-typescript"
|
||||||
"master" "typescript/src")
|
"master" "typescript/src")
|
||||||
(yaml "https://github.com/ikatyang/tree-sitter-yaml" "master" "src")))
|
(yaml "https://github.com/ikatyang/tree-sitter-yaml" "master" "src"))))
|
||||||
|
|
||||||
(add-hook 'after-change-major-mode-hook
|
|
||||||
(defun on-go-ts-mode-hook ()
|
|
||||||
(when (derived-mode-p 'go-ts-mode 'go-mod-ts-mode)
|
|
||||||
(setq-local tab-width 2))))
|
|
||||||
(add-to-list 'auto-mode-alist `(,(rx ".go" eos) . go-ts-mode)))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* [[info:emacs#Faces][Text faces or styles (info)]]
|
* [[info:emacs#Faces][Text faces or styles (info)]]
|
||||||
@ -4667,6 +4659,20 @@ byte code:
|
|||||||
|
|
||||||
1. [[https://gobyexample.com/][Go by example]]
|
1. [[https://gobyexample.com/][Go by example]]
|
||||||
|
|
||||||
|
#+caption[Setup Go programming]:
|
||||||
|
#+caption: Setup Go programming.
|
||||||
|
#+name: lst:setup-go
|
||||||
|
#+begin_src emacs-lisp -n
|
||||||
|
(when (featurep 'treesit)
|
||||||
|
;; Set `tab-width' in `after-change-major-mode-hook' function too.
|
||||||
|
(setopt go-ts-mode-indent-offset 2)
|
||||||
|
(add-hook 'after-change-major-mode-hook
|
||||||
|
(defun on-go-ts-mode-hook ()
|
||||||
|
(when (derived-mode-p 'go-ts-mode 'go-mod-ts-mode)
|
||||||
|
(setq-local tab-width 2))))
|
||||||
|
(add-to-list 'auto-mode-alist `(,(rx ".go" eos) . go-ts-mode)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** [[info:maxima#Top][Maxima Programming (info)]]
|
** [[info:maxima#Top][Maxima Programming (info)]]
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: sec:maxima-programming
|
:CUSTOM_ID: sec:maxima-programming
|
||||||
|
Loading…
Reference in New Issue
Block a user