

Deft -- easy note taking for Emacs - superbobry
http://jblevins.org/projects/deft
Deft is an Emacs mode for quickly browsing, filtering, and editing directories of plain text notes, inspired by Notational Velocity [<i>]. It was designed for increased productivity when writing and taking notes by making it fast and simple to find the right file at the right time and by automating many of the usual tasks such as creating new files and saving files.<p>[</i>] http://notational.net
======
phzbOx
It's when I see gems like these that I feel like spending time to learn emacs.
I've tried a couple of times.. but it is so damn hard. I feel like vim
keybindings are burnt in my memory/fingers.. and it makes it so unproductive
to relearn something totally different. Any vim power user successfully
switched to Emacs? If so, did you switch back missing Vim or you're still
using emacs and couldn't be happier? (I'm still interested in the reverse
side.. where Emacs power users switched back to vim).

~~~
tsm
I'm a vim user who started to really get into Lisp (and now ML for school).
Emacs (especially with SLIME) is really the Right Thing for Lisp, so I started
using it. I've definitely gotten to the point where `C-a C-k` is as well
burned into my fingers as `dd` is...it's just that

a) `dd` seems like a more natural keybinding--both because I'd rather double-
tap a home row button than involve three fingers and two hands, and because,
if you do stop to think about it, `dd` makes sense--`d` means delete, and a
double-tap usually makes something apply to a whole line. (Of course, `dd` /
`C-a C-k` is just an example--this applies in general.)

b) There's more of a zen to vim. It's been discussed before, but it's worth
repeating--vim commands form a language with nouns and verbs. `w` means word
and `(` means sentence. Now you know two commands. `d` means delete, `y` means
yank, and `c` means change. Now you know _8_ commands--`w`, `dw`, `yw`, `cw`,
`(`, `d(`, etc. And adding a few more "nouns" brings you up to several dozen
with minimal effort. Emacs has no direct equivalent * .

So I like emacs for the ecosystem, I like it for the freakish integration it
can achieve between a REPL and a source file...as they say, it's a great
operating system--it just needs a good editor.

* - This is not quite true--emacs does try to do sane things with the use of `C` and `M`. `C-f` means "forward one character", and `M-f` means "forward one word"--a "bigger" form of the same thing. In the same way, `C-d` deletes a character and `M-d` deletes a word. But now you want to delete a line? Time to learn something completely new.

 _Edited to make a lame effort to fix my formatting problems...thus the
asterisks surrounded by a sea of whitespace._

~~~
philh
I had the exact same experience, and agree with everything you said.

I'll note that I tried vimpulse for a while. Then I stopped. I wish I could be
more helpful, but that's all I remember. I don't even know if stopping was an
actual decision that I made, or if I just didn't start again after
reinstalling everything.

(vimpulse-mode is an attempt to bring vim keybindings to emacs.)

~~~
tsm
I tried using viper, and eventually just got confused and realized that I
should just learn emacs...and the best way of learning emacs was to go cold
turkey. Some things emulated vi, not vim (delete key would not remove a
newline, pressing undo twice resulted in undo->redo (and no net change)). Some
things were intercepted by emacs (C-v to try to enter visual block mode). It
was just a confusing and unhappy time.

~~~
sb
seconded! I made the same beginner's error, too, and then decided that it was
just the wrong thing to do. Emacs does not have a modal concept and cursor
movement is not done with "hjkl" (and "ew") in Emacs. As Steve Yegge said, you
should use incremental search forwards and backwards instead. I guess that
eliminates many of vim's keystrokes (stats would be interesting), so staying
with its keybindings might be prohibitive to learning Emacs...

------
timsally
Available via Marmalade as well: <http://marmalade-repo.org/packages/deft>

Just spent a few minutes playing around with it. I like the simplicity, nice
work. One thought I had is that you could enter Deft mode whenever you cd into
a directory with a .deft configuration file. This file could have a title for
the top of the Deft view and perhaps the ability to specify what columns you
want displayed. In this way you can have different directories for notes about
different topics.

------
Rauchg
If you are a vim user, I recommend vimwiki:
<http://www.vim.org/scripts/script.php?script_id=2226>

------
Estragon
My notes have gotten pretty extensive and sprawling, so I have a cron job
which every hour indexes all org-mode and python files with swish[1]. It's
pretty hacky, but I've integrated this with emacs's dired-mode, so that I get
a clickable list[2]. It's an absolute life saver, at times.

    
    
      [1] http://swish-e.org/docs/swish-search.html
      [2] http://pastebin.com/xeDbjKhA

~~~
hollerith
Clickable urls:

<http://swish-e.org/docs/swish-search.html>

<http://pastebin.com/xeDbjKhA>

~~~
Estragon
Thanks, I did that for the formatting, without really thinking about the
impact on the links.

------
SoftwareMaven
Hmm. Deft, org-mode, Dropbox, and MobileOrg might just made the perfect
desktop/mobile note system. Definitely setting this one up!

------
alexg0
I use <https://github.com/cefstat/simplenote.el> to synchronize with
simplenote service and on mobile device and Notational Velocity.

Deft seems little more refined, and simplenote.el has not been updated for a
while, but would be nice if it synced with simplenote.

~~~
cefstat
I'm the author of simplenote.el. Deft looks very interesting and I am happy
that simplenote.el was of some use to Jason for writing Deft. As a sidenote, I
am always pleasantly surprised when I hear that people are using
simplenote.el; this was just a small personal project that I put on github on
a whim.

You should not expect much more to happen with simplenote.el since I don't
feel very motivated to work on it anymore. When I first wrote simplenote.el
the Simplenote app and platform were perfect. Since then Simplenote has
changed to a direction that I don't like (tags, different pay model) [1].
Furthermore, I have been lately traveling a lot to China and Appspot is
blocked there. This limits the usefulness of Simplenote.

I do plan to rewrite simplenote.el for Simplenote's API2 and clean up the code
but at the moment I don't plan to add any new features. In particular, I don't
plan to add any support for tags. Of course everybody is welcome to fork
simplenote.el and continue its development.

[1]: I understand that most Simplenote users are happy with these changes and
actually Simperium has done a great job in adding features in an unobtrusive
way.

~~~
alexg0
I appreciate you creating simplenote.el. I understand disagreeing with
direction platform taken, particularly if you are personally unable to take
advantage of it.

As far as forking, would you consider merging in tag support into your
version, if someone were to send you a patch?

------
Loic
If you need a bit more, that is, todo lists, planning, etc. while keeping a
way to easily edit text documents, you also have Org-Mode
<http://orgmode.org/>

Do not try to setup Org-Mode if you are new to Emacs, you will feel a bit
overwhelmed (at least I was), but once you get used to Emacs and Org-Mode, it
is a pleasure to use it. I use it for GTD, day planner and notes taking like
here: <http://notes.ceondo.com>

~~~
pavpanchekha
I think the key thing about Org-mode is to _not_ read the documentation. All
you need to start is stars and the tab key. The docs have a way of dumping
keybindings onto you. Org mode has a lot of features --- don't try to read the
manual through. Just start using it and every time you think of a feature you
would like, look it up in the manual.

~~~
ottbot
This is probably good advice, and I think I'll give org-mode another try
without trying to build it around someone else's setup.

I've been using emacs for years, but could never quite make an habit out of
org mode. I think deft handling simple org files might be a good way to get
started.

~~~
pavpanchekha
I kept trying to start with a todo list in Org-mode, and it was never worth
it. Instead, I ended up getting into Org-mode through using it as a markup (it
supports inline LaTeX!) and only later learned some of the shortcuts. I've
just started using C-RET and similar to add outline nodes, for example;
similarly C-. and C-d and such. Now I use Org-mode heavily for literate
programming as well.

One of the reasons I love Emacs and Org-mode so much is that it never forces
you to use its features. For the right approach and for the power user, this
is beautiful.

------
SeanLuke
Why are the rows hard-set to 80 columns? Is there a way to change this value,
or better yet, have it auto-fill to the width of the window?

~~~
ordinary
I don't use Deft, so YMMV, but it sounds like you're looking for visual-line-
mode.

Interactively:

    
    
      M-x visual-line-mode
    

Or in your .emacs:

    
    
      (add-hook 'deft-mode-hook 'enable-visual-line-mode)
    

You'll probably need to set deft-line-width to some number that's larger than
the most columns you ever have in a frame, because from a quick glance it
looks like Deft has some magic of its own.

------
matthewsnyder
Thank you so much for this. This immediately replaced my usage of org-
velocity. I used this function to convert my (10,000 line) velocity.org file
into separate files for Deft:

    
    
      (defun generate-files-from-velocity (buffername)
        (save-excursion
          (switch-to-buffer buffername)
          (org-map-entries (lambda ()
                             (progn
                               (org-mark-subtree)
                               (if (and (= 1 (org-outline-level)) (org-export-get-title-from-subtree))
                                   (let* ((title (downcase (org-export-get-title-from-subtree)))
                                          (filename (replace-regexp-in-string " " "-" (concat title ".org"))))
                                     (append-to-file (region-beginning) (region-end) (concat "~/Documents/Org/Notes/" filename)))))))))
      
      (generate-files-from-velocity "velocity.org")

~~~
basman
I haven't used either of these, but they seem to fill a useful niche. What do
you find are the pros and cons of deft vs. org-velocity?

~~~
matthewsnyder
The advantage for me is entirely in terms of separating notes into separate
files; something that Deft does and org-velocity isn't really built for. I was
planning on implementing something like that for org-velocity, but with the
arrival of Deft I no longer have to.

------
eschulte
no org-mode support?

~~~
josephkern
Sure there is.

"You can also customize the major mode that Deft uses to edit files, either
through M-x customize-group or by adding something like the following to your
.emacs file:

(setq deft-text-mode 'markdown-mode)"

All you need to do is:

(setq deft-text-mode 'org-mode)

Or any other major mode for that matter.

