Fix <s and <q org mode shortcuts

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

View File

@ -251,25 +251,35 @@
#+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))
#+end_src
#+begin_src emacs-lisp
(use-package org :config (require 'org-tempo))
#+end_src
A keybinding to add a new heading is super useful
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 ()
(define-key org-mode-map
(kbd "<C-M-return>")
'org-insert-heading-after-current)))
#+end_src
#+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
(add-hook 'org-mode-hook
(lambda ()
(define-key org-mode-map
(kbd "<C-M-return>")
'org-insert-heading-after-current)))
#+end_src
** Journal Files
Sometimes I like to make a todo list for a day if I've a lot to do,