Re: [cream] integrating and using WoC
Cream is a free, easy-to-use configuration of the Vim text editor
Brought to you by:
digitect
From: Dave (My-IOP) <da...@my...> - 2008-02-06 03:38:20
|
Hi Steve, Thanks for your reply. I just figured out that the double quote was the comment char! :) The gpg integration I'm trying is described here: http://www.mail-archive.com/deb...@li.../msg506098.html They say this goes in vimrc. I'm just getting ready to try it. It should work with Cream, right? augroup encrypted au! " First make sure nothing is written to ~/.viminfo while editing " an encrypted file. autocmd BufReadPre,FileReadPre,BufNewFile *.gpg,*.asc set viminfo= " We don't want a swap file, as it writes unencrypted data to disk. autocmd BufReadPre,FileReadPre,BufNewFile *.gpg,*.asc set noswapfile " Switch to binary mode to read the encrypted file. autocmd BufReadPre,FileReadPre *.gpg set bin autocmd BufReadPre,FileReadPre *.gpg,*.asc let ch_save = &ch|set ch=2 autocmd BufReadPost,FileReadPost *.gpg,*.asc \ '[,']!sh -c 'gpg --decrypt 2> /dev/null' " Switch to normal mode for editing autocmd BufReadPost,FileReadPost *.gpg set nobin autocmd BufReadPost,FileReadPost *.gpg,*.asc let &ch = ch_save|unlet ch_save autocmd BufReadPost,FileReadPost *.gpg,*.asc \ execute ":doautocmd BufReadPost " . expand("%:r") " Convert all text to encrypted text before writing autocmd BufWritePre,FileWritePre *.gpg set bin autocmd BufWritePre,FileWritePre *.gpg \ '[,']!sh -c 'gpg --default-recipient-self -e 2>/dev/null' autocmd BufWritePre,FileWritePre *.asc \ '[,']!sh -c 'gpg --default-recipient-self -e -a 2>/dev/null' " Undo the encryption so we are back in the normal text, directly " after the file has been written. autocmd BufWritePost,FileWritePost *.gpg,*.asc u autocmd BufWritePost,FileWritePost *.gpg set nobin augroup END On Feb 5, 2008 10:31 PM, Steve Hall <dig...@da...> wrote: > On Tue, 2008-02-05 at 22:05 -0500, Dave (My-IOP) wrote: > > On Feb 5, 2008 9:13 PM, Steve Hall <digitect dancingpaper com> wrote: > > > On Mon, 2008-02-04 at 22:22 -0500, Dave (My-IOP) wrote: > > > > > > > > I want to have URLs (hyperlinks) in plain text docs. > > > > > > I just committed an update that might help, copy this file over > > > yours of the same name: > > > > > > http://cream.cvs.sourceforge.net/cream/cream/cream-lib.vim > > > > Hi Steve, > > I tested it and this works great. Thanks! > > > > I think I want to go one step further and tweak it to recognize a > > URL if it includes "www." but not "http://". Do you have any tips to > > get me started? I've never worked with vim scripts before. Is the > > follow code all I would have to change (around line 1559)? > > > > "if match(myfile, "http://", 0) == 0 > > " let isURL = 1 > > "elseif match(myfile, "www.", 0) == 0 > > " let isURL = 1 > > Yes, although make sure you're editing the "live" code, down under > OPTION 2. (Your lines above are commented by the double-quote chars, I > think from the first, obsolete OPTION 1 section.) > > I'll add this to the project, although it does mean files can not > begin with "www.". > > > One of my next tasks is to integrate gpg with Cream. I have found > > some examples of how to do that with Vim. Will they work with Cream > > too? Does Cream already have some support for gpg built in that I'm > > not aware of? > > Cream has everything built-in that Vim does, but I don't find any > references to gpg (or pgp) in the Vim help. As long as the > functionality is in the base Vim and is handled behind the usual > dialogs, options, and autocmds you should have no problem. But if it > is implemented in a script overlay, it could require a bit of work to > make sure Cream uses it properly. > > > |