Merge pull request #2630 from yoavm448/org-file-template
Title-capitalization for title in org file template
This commit is contained in:
commit
02eedac45e
1 changed files with 15 additions and 1 deletions
|
@ -1,6 +1,20 @@
|
||||||
# -*- mode: snippet -*-
|
# -*- mode: snippet -*-
|
||||||
# name: Org template
|
# 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
|
$0
|
Loading…
Add table
Add a link
Reference in a new issue