vim中的Evernote


10

我搜索一种从vim编辑Evernote笔记的方法

我从这个开始

#!/bin/bash
evernoteDir="$HOME/Library/Application*Support/Evernote/data"
dataDir=$(ls -trlh $evernoteDir| tail -n 1| awk '{print $NF}')
contentDir="$evernoteDir/$dataDir/content"
file=$(ls -trlh $contentDir | tail -n 1| awk '{print $NF}')
vim -c 's/div>/div>\r/g' $contentDir/$file/content.html

https://gist.github.com/1256416

或为此创建一个vim插件...

你有什么建议吗?

编辑

为了获得更简单的html格式的evernote注释,我使用了这个vim函数

" Markup function {{{ 
    fun! MkdToHtml() "{{{
        " markdown to html
        silent! execute '%s/  $/<br\/>/g'
        silent! execute '%s/\*\*\(.*\)\*\*/<b>\1<\/b>/g'
        silent! execute '%s/\t*###\(.*\)/<H3>\1<\/H3>/g'
    endf "}}}
    command! -complete=command MkdToHtml call MkdToHtml()
    nn <silent> <leader>mm :MkdToHtml<CR>
" }}} 

和vim功能,用于打开最后编辑的音符

fun! LastEvernote() "{{{
    " a better solution is with evernote api
    let evernoteDir=expand("$HOME")."/Library/Application*Support/Evernote/data"
    let dataDir=system("ls -trlh ".evernoteDir."| tail -n 1| awk '{print $NF}'")
    let contentDir=evernoteDir."/".dataDir."/content"
    let contentDir=substitute(contentDir,"\n","",'g')
    let note=system("ls -trlh ".contentDir." | tail -n 1| awk '{print $NF}'")
    let note=substitute(note,"\n","",'g')
    sil! exec 'sp '.contentDir.'/'.note.'/content.html'
    sil! exec '1s/>/>\r/g'
    sil! exec '%s/<br.*\/>/<br\/>\r/g'
    sil! exec '%s/<\//\r<\//g'
    sil! exec 'g/^\s*$/d'
    normal gg
    sil! exec '1,4fo'
    sil! exec '$-1,$fo'
endf

https://gist.github.com/1289727


5
为什么要成为超级用户?如果是发展问题。
juanpablo 2011年

Answers:


1

您是否尝试过Geeknote(http://www.geeknote.me/

“使用您喜欢的任何控制台编辑器编辑Evernote笔记-nano,vi,vim,mcedit等。保存更改,Geeknote会自动将它们上传到Evernote。”

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.