Since some time I’ve been using Evernote to capture and collect notes and ideas, and so far I’ve been pretty happy with it. One of my few complaints is that its built-in editor is clumsy and primitive. And even aside from the imperfections of Evernote’s editor, it is just a nuisance to have to open a special editor just to scribble a note to yourself. I myself am a heavy Vim user: I use it to write (with Latex), to run analyses (in Stata, R, and SPSS), for programming, and for many other text-related jobs. Then, of course, it would be nice to also be able to create Evernote notes without having to leave Vim.
So, I wrote a Vim script that allows you to do exactly that. It relies on Evernote’s ability to monitor a specified folder on your computer and automatically import any file it finds in there. The script does not do much more than copy selected text to a file in that folder; Evernote does the rest of the work. Using this script, you can simply write some text in Vim, select it, and press a key combination to add it to Evernote without ever having to leave Vim. I have been able to test it only on Windows; if anyone happens to test it on another operating system, please let me know the results!
Installation:
- Download Vim2Evernote.vim and save it in your vim/vimfiles/plugin/ folder
- Set up Evernote to monitor a folder of your choice on your computer. In Evernote 4.2, this is found under Tools–> import folders. Vim2Evernote will write to a .txt file with a temporary name in that folder.
- Optionally, in the same dialog box, set Evernote to delete the file after importing (recommended).
- Open Vim2Evernote.vim in your text editor (Vim, of course 🙂 ) and edit line 54 to contain the path of the folder you set in step 2.
Usage:
To use Vim2Evernote, visually select some text in Vim, and press “\e” (where “\” may be replaced by your own leader if you set one). The script will write a temporary file in the folder you specified in Step 2 above, containing the text you selected. As soon as you start Evernote, it will import the file into your default notebook; the title of the note will be the first line of the selected text. Thus, to give a note a certain title, you just have to start your note with the title. Personally, I find it useful to have a default notebook called “inbox,” to which all new notes go, and which I empty every once in a while to put all notes in their appropriate places.