Vim ãã Evernote ã«ãã¹ã
ã¨ããããä»éãã¦ããããã¡ã®å
容ã Evernote ã«éãä»ããã¹ã¯ãªããã
_vimrc ã§è¨å®ãã¦ããã°ä¸çºã§ Evernote è¡ãã ã
nmap ,n :call WinVimToEver()<CR>
Mac ã ã¨å ¨ç¶éãã¢ããã¼ããå¿ è¦ãããªã®ã§ Win ã£ã¦æ¥é è¾ã¤ããã
winvimtoever.vim:
" winvimtoever.vim " vim script, send current buffer to evernote if !exists("g:winVimToEverUseFilename") let g:winVimToEverUseFilename = 0 endif if !exists("g:winVimToEverPath") let g:winVimToEverPath = 'C:\Progra~1\Evernote\Evernote3.5\ENScript.exe' endif if !exists("g:winVimToEverNote") let g:winVimToEverNote = "" end if !exists("g:winVimToEverAttachment") let g:winVimToEverAttachment = 0 endif function! WinVimToEver() if g:winVimToEverUseFilename let title = expand("%:t") else let title = iconv(getline(1), &fileencoding, "cp932") endif " TODO: tag "let tag = ... let tmpdir = tempname() call mkdir(tmpdir) let bodyfile = fnamemodify(tempname(), ":p:r").'.txt' let lines = getline(1, line("$")) let encoded = iconv(join(lines, "\r\n"), &fileencoding, "cp932") call writefile(split(encoded, "\r\n", 1), bodyfile, "b") let cmd = g:winVimToEverPath.' createNote /s '.shellescape(bodyfile).' /i '.shellescape(title) if g:winVimToEverAttachment let filename = expand("%:t") if filename == '' let filename = 'attachment.txt' end let tmpfile = tmpdir . '\' . filename call writefile(split(encoded, "\r\n", 1), tmpfile, "b") let cmd = cmd.' /a '.shellescape(tmpfile) end if g:winVimToEverNote let cmd = cmd.' /n '.shellescape(g:winVimToEverNote) endif let ret = system(cmd) " FIXME! call system("rmdir /S /Q ".shellescape(tmpdir)) call delete(bodyfile) endfunction
https://github.com/holysugar/winvimtoever ã«ç½®ãã¾ããã
åèã«ãããã®