Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deft layer #1205

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions contrib/deft/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Deft

[Deft](http://jblevins.org/projects/deft/) is an Emacs mode inspired by Notational Velocity for quickly browsing and creating notes.

**Note:** You may have to update the `evil-escape` package for deft to work, otherwise filtering will ignore your escape character.

## Differences from default

This layer sets the default to use filenames for note titles as well as org-mode for editing.
The default extension is still `txt`.

## Configuration

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

## Keybindings

Key Binding | Description
--------------------|------------------------------------------------------------------
<kbd>SPC a n </kbd>| Open Deft (works globally)
<kbd>SPC m d </kbd>| Delete selected note
<kbd>SPC m r </kbd>| Rename selected note
<kbd>SPC m i </kbd>| Toggle to regex search
<kbd>SPC m n </kbd>| Create new file with filter text
41 changes: 41 additions & 0 deletions contrib/deft/packages.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
;;; packages.el --- deft Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

(defvar deft-packages
'(deft))

(defun deft/init-deft ()
(use-package deft
:defer t
:init
(progn
(defun spacemacs/deft ()
"Helper to call deft and then fix things so that it is nice and works"
(interactive)
(deft)
;; Hungry delete wrecks deft's DEL override
(when (fboundp 'hungry-delete-mode)
(hungry-delete-mode -1))
;; When opening it you always want to filter right away
(evil-insert-state nil))
(evil-leader/set-key "an" 'spacemacs/deft)
)
:config
(progn
(evil-leader/set-key-for-mode 'deft-mode
"m d" 'deft-delete-file
"m r" 'deft-rename-file
"m i" 'deft-toggle-incremental-search
"m n" 'deft-new-file)
(setq deft-extension "txt"
deft-text-mode 'org-mode
deft-use-filename-as-title t))))