{"id":313,"date":"2011-04-12T21:45:42","date_gmt":"2011-04-13T04:45:42","guid":{"rendered":"http:\/\/www.rensecorten.dds.nl\/?p=313"},"modified":"2011-04-12T21:45:42","modified_gmt":"2011-04-13T04:45:42","slug":"posting-to-evernote-from-vim","status":"publish","type":"post","link":"http:\/\/www.rensecorten.org\/index.php\/2011\/04\/posting-to-evernote-from-vim\/","title":{"rendered":"Posting to Evernote from Vim"},"content":{"rendered":"<p style=\"text-align: justify;\">Since some time I&#8217;ve been using <a href=\"http:\/\/evernote.com\/\" target=\"_blank\">Evernote <\/a>to capture and collect notes and ideas, and so far I&#8217;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&#8217;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 <a href=\"http:\/\/www.vim.org\" target=\"_blank\">Vim <\/a>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.<\/p>\n<p style=\"text-align: justify;\">So, I wrote a Vim script that allows you to do exactly that. It relies on Evernote&#8217;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!<\/p>\n<p style=\"text-align: justify;\">Installation:<\/p>\n<ol style=\"text-align: justify;\">\n<li>Download <a href=\"http:\/\/www.rensecorten.org\/files\/Vim2Evernote.vim\" target=\"_blank\">Vim2Evernote.vim<\/a> and save it in your vim\/vimfiles\/plugin\/ folder<\/li>\n<li>Set up Evernote to monitor a folder of your choice on your computer. In Evernote 4.2, this is found under Tools&#8211;&gt; import folders. Vim2Evernote will write to a\u00a0 .txt file with a temporary name in that folder.<\/li>\n<li>Optionally, in the same dialog box, set Evernote to delete the file after importing (recommended).<\/li>\n<li>Open Vim2Evernote.vim in your text editor (Vim, of course \ud83d\ude42 ) and edit line 54 to contain the path of the folder you set in step 2.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">Usage:<\/p>\n<p style=\"text-align: justify;\">To use Vim2Evernote, visually select some text in Vim, and press &#8220;\\e&#8221; (where\u00a0 &#8220;\\&#8221; 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 &#8220;inbox,&#8221; to which all new notes go, and which I empty every once in a while to put all notes in their appropriate places.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since some time I&#8217;ve been using Evernote to capture and collect notes and ideas, and so far I&#8217;ve been pretty happy with it. One of my few complaints is that its built-in&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"_links":{"self":[{"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/posts\/313"}],"collection":[{"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/comments?post=313"}],"version-history":[{"count":7,"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":320,"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/posts\/313\/revisions\/320"}],"wp:attachment":[{"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/media?parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/categories?post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.rensecorten.org\/index.php\/wp-json\/wp\/v2\/tags?post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}