Created
September 9, 2014 01:00
-
-
Save Anks/ef43f2f0f1153f0fbeac to your computer and use it in GitHub Desktop.
deft-mode – Strip file variables from title line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Customise deft to remove file-vars from the title line. | |
;; | |
;; I use 'markdown-mode with deft usually, but for some longform files, | |
;; I prefer using 'org-mode. | |
;; | |
;; The easiest way to do this is to use a file variable like so: | |
;; | |
;; -*- mode: org; -*- | |
;; | |
;; in the first line of the file. This makes the file open in 'org-mode | |
;; instead of 'markdown-mode. | |
;; | |
;; Unfortunately, this ugly variable line will be shown in the main | |
;; deft frame. This function solves that problem. | |
(defun deft-title-fn-strip-file-vars (str) | |
(replace-regexp-in-string "-\\*-.*-\\*-" "" (deft-strip-title str))) | |
(setq deft-parse-title-function 'deft-title-fn-strip-file-vars) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment