Je cherche un moyen de modifier les notes evernote de vim
Je commence par ça
#!/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
ou peut-être créer un plugin vim pour cela ...
vous avez une suggestion?
MODIFIER :
pour une édition plus simple de la note evernote au format html, je fais cette fonction 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>
" }}}
et une fonction vim pour ouvrir la dernière note éditée
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