Skip to content

Commit 642b044

Browse files
committed
defat layer: edit README and refactor init-deft a bit
1 parent 0db0330 commit 642b044

File tree

2 files changed

+47
-19
lines changed

2 files changed

+47
-19
lines changed

contrib/deft/README.md

+37-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,48 @@
1-
# Deft
1+
# Deft configuration layer for Spacemacs
22

3-
[Deft](http://jblevins.org/projects/deft/) is an Emacs mode inspired by Notational Velocity for quickly browsing and creating notes.
3+
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
4+
**Table of Contents**
45

5-
**Note:** You may have to update the `evil-escape` package for deft to work, otherwise filtering will ignore your escape character.
6+
- [Deft configuration layer for Spacemacs](#deft-configuration-layer-for-spacemacs)
7+
- [Description](#description)
8+
- [Differences from default](#differences-from-default)
9+
- [Install](#install)
10+
- [Layer](#layer)
11+
- [Configuration](#configuration)
12+
- [Key Bindings](#key-bindings)
613

7-
## Differences from default
14+
<!-- markdown-toc end -->
815

9-
This layer sets the default to use filenames for note titles as well as org-mode for editing.
10-
The default extension is still `txt`.
16+
## Description
1117

12-
## Configuration
18+
[Deft][] is an Emacs mode inspired by `Notational Velocity` for quickly
19+
browsing and creating notes.
20+
21+
### Differences from default
22+
23+
This layer sets the default to use filenames for note titles as well as
24+
`org-mode` for editing. The default extension is still `.txt` though.
25+
26+
## Install
27+
28+
### Layer
29+
30+
To use this contribution add it to your `~/.spacemacs`
31+
32+
```elisp
33+
(setq-default dotspacemacs-configuration-layers '(deft))
34+
```
35+
36+
### Configuration
37+
38+
By default deft tries to put notes in `~/.deft` but you can change
39+
this like so in your `dotspacemacs/config` function:
1340

14-
By default deft tries to put notes in `~/.deft` but you can change this like so:
1541
```
1642
(setq deft-directory "~/Dropbox/notes")
1743
```
1844

19-
## Keybindings
45+
## Key Bindings
2046

2147
Key Binding | Description
2248
--------------------|------------------------------------------------------------------
@@ -25,3 +51,5 @@ Key Binding | Description
2551
<kbd>SPC m r </kbd>| Rename selected note
2652
<kbd>SPC m i </kbd>| Toggle to regex search
2753
<kbd>SPC m n </kbd>| Create new file with filter text
54+
55+
[Deft]: http://jblevins.org/projects/deft/

contrib/deft/packages.el

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
:defer t
1919
:init
2020
(progn
21+
(setq deft-extension "txt"
22+
deft-text-mode 'org-mode
23+
deft-use-filename-as-title t)
24+
(evil-leader/set-key "an" 'spacemacs/deft)
25+
2126
(defun spacemacs/deft ()
2227
"Helper to call deft and then fix things so that it is nice and works"
2328
(interactive)
@@ -26,16 +31,11 @@
2631
(when (fboundp 'hungry-delete-mode)
2732
(hungry-delete-mode -1))
2833
;; When opening it you always want to filter right away
29-
(evil-insert-state nil))
30-
(evil-leader/set-key "an" 'spacemacs/deft)
31-
)
34+
(evil-insert-state nil)))
3235
:config
3336
(progn
3437
(evil-leader/set-key-for-mode 'deft-mode
35-
"m d" 'deft-delete-file
36-
"m r" 'deft-rename-file
37-
"m i" 'deft-toggle-incremental-search
38-
"m n" 'deft-new-file)
39-
(setq deft-extension "txt"
40-
deft-text-mode 'org-mode
41-
deft-use-filename-as-title t))))
38+
"md" 'deft-delete-file
39+
"mi" 'deft-toggle-incremental-search
40+
"mn" 'deft-new-file
41+
"mr" 'deft-rename-file))))

0 commit comments

Comments
 (0)