mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Merge pull request #2630 from yoavm448/org-file-template
Title-capitalization for title in org file template
This commit is contained in:
@ -1,6 +1,20 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: Org template
|
||||
# --
|
||||
#+TITLE: ${1:`(file-name-base buffer-file-name)`}
|
||||
#+TITLE: ${1:`
|
||||
(string-join
|
||||
(mapcar #'capitalize
|
||||
;; Replace -,_... with space
|
||||
(split-string
|
||||
(let (case-fold-search)
|
||||
;; Seperating lower from upper: hello|World
|
||||
(replace-regexp-in-string
|
||||
"\\([[:lower:]]\\)\\([[:upper:]]\\)" "\\1 \\2"
|
||||
;; Separating upper from (upper and lower): HTTP|Server
|
||||
(replace-regexp-in-string "\\([[:upper:]]\\)\\([[:upper:]][0-9[:lower:]]\\)"
|
||||
"\\1 \\2" (file-name-base buffer-file-name))))
|
||||
"[^[:word:]0-9]+"
|
||||
)) " " )
|
||||
`}
|
||||
|
||||
$0
|
Reference in New Issue
Block a user