Untabify config

This commit is contained in:
Camden Dixie O'Brien 2024-08-03 16:15:39 +01:00
parent a9265c931d
commit a1fea5bc99

View File

@ -700,7 +700,7 @@
There's a lot of boilerplate in C, so I want YASnippet enabled.
#+begin_src emacs-lisp
(add-hook 'c-mode-hook (lambda () (yas-minor-mode)))
(add-hook 'c-mode-hook (lambda () (yas-minor-mode)))
#+end_src
** C++
@ -1197,7 +1197,7 @@
I want to indent with tabs (set to 4 characters wide):
#+begin_src emacs-lisp
(setq lua-indent-level 4)
(setq lua-indent-level 4)
#+end_src
I also want to be able to run =lua-format= on files with =C-c f=
@ -1206,51 +1206,51 @@
[[help:call-process-region][call-process-region]].
#+begin_src emacs-lisp
(defvar lua-format-binary "lua-format")
(defvar lua-format-binary "lua-format")
(defun lua-format ()
(interactive)
(if (executable-find lua-format-binary)
(let ((start (if (region-active-p) (region-beginning) (point-min)))
(end (if (region-active-p) (region-end) (point-max))))
(call-process-region start end lua-format-binary t '(t nil)))
(error "%s" (concat lua-format-binary " not found."))))
(defun lua-format ()
(interactive)
(if (executable-find lua-format-binary)
(let ((start (if (region-active-p) (region-beginning) (point-min)))
(end (if (region-active-p) (region-end) (point-max))))
(call-process-region start end lua-format-binary t '(t nil)))
(error "%s" (concat lua-format-binary " not found."))))
#+end_src
This then needs to be assigned to the keybinding:
#+begin_src emacs-lisp
(add-hook
'lua-mode-hook
(lambda () (define-key lua-mode-map (kbd "C-c f") 'lua-format)))
(add-hook
'lua-mode-hook
(lambda () (define-key lua-mode-map (kbd "C-c f") 'lua-format)))
#+end_src
** BASIC
=basic-mode= provides syntax highlighting and a few nice features:
#+begin_src emacs-lisp
(use-package basic-mode)
(use-package basic-mode)
#+end_src
As well as =.bas= files, I want to open all =.bbc= files in
=basic-mode=:
#+begin_src emacs-lisp
(add-to-list 'auto-mode-alist '("\\.bbc\\'" . basic-mode))
(add-to-list 'auto-mode-alist '("\\.bbc\\'" . basic-mode))
#+end_src
** Nix
Basic editing support comes from =nix-mode=:
#+begin_src emacs-lisp
(use-package nix-mode)
(use-package nix-mode)
#+end_src
And =nix-update= provides a convenient way to update ~fetch~
blocks:
#+begin_src emacs-lisp
(use-package nix-update)
(use-package nix-update)
#+end_src
** SCAD
@ -1258,7 +1258,7 @@
stick to the basic mode:
#+begin_src emacs-lisp
(use-package scad-mode)
(use-package scad-mode)
#+end_src
* Tool Integrations
@ -1375,7 +1375,7 @@
ChatGPT.
#+begin_src emacs-lisp
(use-package chatgpt-shell)
(use-package chatgpt-shell)
#+end_src
[[help:chatgpt-shell-openai-key][chatgpt-shell-openai-key]] must also be set to a function that
@ -1663,6 +1663,6 @@
memory usage getting too high.
#+begin_src emacs-lisp
(setq gc-cons-threshold 1000000)
(setq gc-cons-percentage 0.2)
(setq gc-cons-threshold 1000000)
(setq gc-cons-percentage 0.2)
#+end_src