public
Created

last evernote from vim

  • Download Gist
lastEvernote.vim
VimL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
" http://j.mp/dotvimrc
nn <leader>e :call LastEvernote()<CR>
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
"}}}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.