Create function org-space-key and bind it to SPC in org-mode

All it does is inserting the space character twice after a period.
This commit is contained in:
Gergely Polonkai 2016-10-21 23:02:22 +02:00
parent 4a949cc025
commit 5ef2a98858
2 changed files with 13 additions and 1 deletions

View File

@ -371,6 +371,7 @@
;; Org mode ;; Org mode
(use-package org (use-package org
:ensure t :ensure t
:demand
:init :init
(require 'xdg-paths) (require 'xdg-paths)
(setq-default org-crypt-key "B0740C4C" (setq-default org-crypt-key "B0740C4C"
@ -399,7 +400,10 @@
'("p" "Blog post" '("p" "Blog post"
entry (file+datetree (concat org-directory "blog.org")) entry (file+datetree (concat org-directory "blog.org"))
"* %^{Title} :blog:\n :PROPERTIES:\n :on: %T\n :END:\n %i%?")) "* %^{Title} :blog:\n :PROPERTIES:\n :on: %T\n :END:\n %i%?"))
(setq org-time-stamp-formats '("<%Y-%m-%d>" . "<%Y-%m-%d %H:%M>"))) (setq org-time-stamp-formats '("<%Y-%m-%d>" . "<%Y-%m-%d %H:%M>"))
:bind
(:map org-mode-map
("SPC" . org-space-key)))
(use-package org-bullets (use-package org-bullets
:init :init
@ -658,6 +662,7 @@
(load "enclose-string.el") (load "enclose-string.el")
(load "buf-manipulation.el") (load "buf-manipulation.el")
(load "package-manip") (load "package-manip")
(load "text-manip")
;; Define aliases ;; Define aliases
(defalias 'yes-or-no-p 'y-or-n-p) (defalias 'yes-or-no-p 'y-or-n-p)

7
lisp/text-manip.el Normal file
View File

@ -0,0 +1,7 @@
(defun org-space-key (&optional arg)
"Insert two spaces after a period."
(interactive "p")
(when (looking-back "\\.")
(call-interactively 'self-insert-command arg))
(call-interactively 'self-insert-command arg))