Compare commits

...

6 Commits

Author SHA1 Message Date
cdo 1c277c96da Configure man pages to open in active window 2024-12-19 16:41:27 +00:00
cdo 6e4565cd90 Add go-mode config 2024-12-19 16:41:12 +00:00
cdo 6bc67c0c82 Tweak c-mode snippets 2024-12-19 16:40:54 +00:00
cdo a1fea5bc99 Untabify config 2024-08-03 16:15:39 +01:00
cdo a9265c931d Fix <s and <q org mode shortcuts 2024-08-03 16:15:17 +01:00
cdo d54d16f98f Add SCAD config 2024-07-14 11:00:45 +01:00
3 changed files with 85 additions and 38 deletions
+53 -6
View File
@@ -251,16 +251,26 @@
#+end_src
* Org
I use a couple non-standard bits and pieces, but not a whole
bunch. I really like the =<s= to insert a source block thing (which
was deprecated); =org-tempo= brings that back.
** Code and Quote block shortcuts
I am a big fan of using =<s= for source blocks and =<q= for quotes;
these are enabled by the =org-tempo= module, which is included in
=org= but not loaded by default.
#+begin_src emacs-lisp
(use-package org
:config
(require 'org-tempo))
(use-package org :config (require 'org-tempo))
#+end_src
However, I have recently discovered, much to my despair, that these
shortcuts do not work if there are tabs in the line ahead of them!
Quite ridiculous. Easily worked around, however; I am going to
ensure that spaces are used for indentation when in org mode by
setting [[help:indent-tabs-mode][indent-tabs-mode]] to nil in a hook:
#+begin_src emacs-lisp
(add-hook 'org-mode-hook (lambda () (setq indent-tabs-mode nil)))
#+end_src
** Keybindings
A keybinding to add a new heading is super useful
#+begin_src emacs-lisp
@@ -1243,6 +1253,32 @@
(use-package nix-update)
#+end_src
** SCAD
There is a language server for OpenSCAD, but I think I'll just
stick to the basic mode:
#+begin_src emacs-lisp
(use-package scad-mode)
#+end_src
** Go
First of all, of course, install =go-mode=:
#+begin_src emacs-lisp
(use-package go-mode)
#+end_src
This package provides a convenient lil function to use gofmt to
format a buffer; I want to run this whenever I save a go source
file. This is pretty easily done by adding a =before-save-hook= in
a =go-mode-hook= (hey, I heard you like hooks...)
#+begin_src emacs-lisp
(add-hook 'go-mode-hook
(lambda ()
(add-hook 'before-save-hook 'gofmt-before-save)))
#+end_src
* Tool Integrations
** Git
=magit= is truly a wonderful creation! Add keybinding for
@@ -1380,6 +1416,17 @@
(use-package graphviz-dot-mode)
#+end_src
** Man pages
Man page support is built in to Emacs but it's one of those
annoying things where it will open in the "other" window instead of
where you ran =M-x man= from. Thankfully, this behaviour can be
changed by setting [[help:Man-notify-method][Man-notify-method]]. The value ~'pushy~ makes the
man page open in the current window.
#+begin_src emacs-lisp
(setq Man-notify-method 'pushy)
#+end_src
* Backup and Autosave
** Keep $PWD Tidy
Emacs' default behaviour of dumping temporary files in the current
+1 -1
View File
@@ -1,6 +1,6 @@
# -*- mode: snippet -*-
# name: header-guard
# binding: C-c C-k C-l
# binding: C-c C-k C-h
# key: hdr
# --
#ifndef ${1:`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H}
+1 -1
View File
@@ -4,8 +4,8 @@
# key: spdx
# --
/*
* SPDX-License-Identifier: $1
* Copyright (c) Camden Dixie O'Brien
* SPDX-License-Identifier: $1
*/
$0