Re: VimWiki - released finally

2007-06-05 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 5-Jun-07, at 1:59 PM, Tom Purl wrote:


On Tue, June 5, 2007 11:34 am, Brian McKee wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 5-Jun-07, at 12:00 PM, Tom Purl wrote:


On Tue, June 5, 2007 5:41 am, Sebastian Menge wrote:

[cross-posted to vim, vim-dev, vim-announce, wikia-l]
Finally I have imported all the vim tips from http://vim.org/ 
tips to

   http://vim.wikia.com
I really think that this implementation of the tips wiki is  
sufficient

and complete.  Does anyone disagree?  If so, what do you suggest?
Can someone point out how I can get an RSS feed of the recent  
changes?


The page is here <http://vim.wikia.com/wiki/Special:Recentchanges>


The recent changes page has links for both rss and atom feeds.


Oh - I guess it's in the headers only - I was looking for a clickable  
link rather than just the indicator in the url bar.


If there's a clickable link supposed to be there - I'm not seeing  
it  and a quick /atom/ of the source only shows the link in the  
headers.


Thanks - Got what I needed.
Brian

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGZafzGnOmb9xIQHQRAnG8AJkBsmVDZebQ6Nt8i1+BS87h0KP0/wCgm39K
o5hBYBes2edUet51OzftzA8=
=Y0te
-END PGP SIGNATURE-


Re: VimWiki - released finally

2007-06-05 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 5-Jun-07, at 12:00 PM, Tom Purl wrote:


On Tue, June 5, 2007 5:41 am, Sebastian Menge wrote:

[cross-posted to vim, vim-dev, vim-announce, wikia-l]
Finally I have imported all the vim tips from http://vim.org/tips to

http://vim.wikia.com

and set up a minimal infrastructure to keep things going. Not  
everything

is perfect, but I think it is usable now.
Wow!  This really looks excellent Sebastian.  Also, it look very  
robust

and complete.
I really think that this implementation of the tips wiki is sufficient
and complete.  Does anyone disagree?  If so, what do you suggest?


Indeed - looks good!

Can someone point out how I can get an RSS feed of the recent changes?

The page is here 

Perhaps it's a feature we need to enable?  I see some other wikia  
sites seem to append &feed=rss to the url, but that doesn't work for  
the vim wiki...


Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGZZB6GnOmb9xIQHQRAiKaAKDdpaAT2+ABJxXbqTUMNz+B4m6Q7ACfX8sj
2xm2SBX9KwsY+Zw0y8T+D1w=
=5Eug
-END PGP SIGNATURE-


Re: regex help

2007-05-16 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 16-May-07, at 2:27 PM, Tim Chase wrote:


:g/^\s\+/k a|?^\S?y|'a|s/^\s\+/\=strpart(@", 0, strlen(submatch(0)))



That works  dunno what it does... but that works :-)

I'm going to record that little gem, and put it aside for a bedtime  
puzzle I think.


Thank you

Brian

PS  I promise to use that little sucker at least 30 or 40 times in  
the next month or so - please believe me when I say I appreciate it.
Currently I'm importing into Excel and using a really really  
nasty couple of 'if then else' formulas to achieve the same result!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGS0+KGnOmb9xIQHQRAsSPAKCRsno91NmR5FgbuXBvrxcSMZ8qjwCg1l4o
K4ABU7aeY4ftTDusWPEmfSI=
=Lhjc
-END PGP SIGNATURE-


Re: regex help

2007-05-16 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 16-May-07, at 2:23 PM, Gene Kwiecinski wrote:


:g/^\(.{8}\)\(.*\)\n\(\s{8}\)/s//\1\2\r\1/



Well,
:g/^\(.\{8}\)\(.*\)\n\(\s{8}\)/s//\1\2\r\1/
   ^
works, but I'd have to run it 12 times if there are twelve blanks
after the filled in line.


Hm?  Not sure why you escaped the '{'.  Apparently didn't need to  
after

the "\s".


You are right - it was a typo - I actually need to escape both of them -

:g/^\(.\{8}\)\(.*\)\n\(\s\{8}\)/s//\1\2\r\1/
   ^ ^

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGS030GnOmb9xIQHQRAkrxAKCQ2s0Z4CpdNbLlq5GB1Emfao9lrACgjWIs
U2W8X6FLElJSMaJyhYqxi4c=
=K8FT
-END PGP SIGNATURE-


Re: regex help

2007-05-16 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 16-May-07, at 1:05 PM, Tim Chase wrote:


:g/^\s\{8}/-s/^\(.\{8}\).*\n\zs\s\{8}/\1


I don't understand that regex completely - but it deletes lines of  
data :-)


Looks like it globably matches the 'blank start' lines, then searches  
in that for the pattern - thus deleting the third line...


What's the -s do as compared to just s after the g/pattern/

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGS003GnOmb9xIQHQRAv5VAKC6QXC8mLr7Fj0E5NDb47Wi1J5OjwCeLZkg
43BTgSoka6rAbFjotqeMT+g=
=gVmG
-END PGP SIGNATURE-


Re: regex help

2007-05-16 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 16-May-07, at 12:49 PM, Gene Kwiecinski wrote:


:g/^\(.{8}\)\(.*\)\n\(\s{8}\)/s//\1\2\r\1/



Well,
:g/^\(.\{8}\)\(.*\)\n\(\s{8}\)/s//\1\2\r\1/
   ^

works, but I'd have to run it 12 times if there are twelve blanks  
after the filled in line.


I suppose global picks all the lines, then operates on them.

That's a start - thanks!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGS0gYGnOmb9xIQHQRAg04AKCiPBKmNTc1MhA7r9IeJG0dC4lPwwCgsH0l
k4/ExrBsVzsfV1K3ktfEo08=
=sbTc
-END PGP SIGNATURE-


regex help

2007-05-16 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All
	I'm trying to work out if it's possible to refer to 'the previous  
line' in a regex.

e.g.  if the first 8 characters of a line are blank,
   ^\s{8}
replace them with the 8 characters at the start of the previous line.

Ideally it would handle a line a time, thus multiple blank line  
starts would be filled in with the last non blank start.


Hoping that made sense...
Brian 
-BEGIN PGP SIGNATURE-

Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGSy1kGnOmb9xIQHQRAuXcAKCvQL9kHdr/xKhkgp5jve6NPNJqgQCgmQRw
LcscyQAMfFMdMQadBAg8vmQ=
=1lwZ
-END PGP SIGNATURE-


Re: Vim Wiki - Tip Page Formatting Deadline

2007-05-16 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 15-May-07, at 3:02 PM, Gary Johnson wrote:



Please take a look at these tips, decide which one you prefer, and  
then
provide constructive criticism for that tip's format.  There's no  
such

thing as a dumb comment.


I much prefer "VimTip1 v2".  Whether just browsing tips or reading
tips I've searched for, I want to be able to read it quickly without
having to scan through a bunch of boilerplate.  I would even
advocate a Synopsis line that would summarize the tip if the title
didn't already do so.  I like having the meta data collected as it
is in one line at the bottom of the tip:  it's concise and in an
unobtrusive yet consistent and easy-to-find location.


I have to say that I prefer the Metadata at the top, but I agree the  
giant table is a bit much.

How about a blend of the two?

I quickly created http://scratchpad.wikia.com/wiki/Template:Tip4
but I didn't figure out how to get tip 1 to use that template.
Editing tip 1 starts editing the template. - Where do I assign it

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGShSLGnOmb9xIQHQRAtwPAJ0YpRmcsTStjZ2AUyBGb8mFYecalwCgx3Cz
CM35zURSnPRsWu7zYO0/QWk=
=/vcf
-END PGP SIGNATURE-


Re: how to get gvim to open a file over ssh?

2007-05-07 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 4-May-07, at 3:07 PM, ben lieb wrote:

In ubuntu linux:
I have a remote (ssh) connection through nautilus (gui file manager).
When I right-click a file, I can open, edit and save the file in "text
editor" without any problem. When I open the file in gvim, it is  
empty.


What can I do to solve this?


I kept a copy of this thread from March but haven't looked into it  
any further.
I think it might fix you up - please let me know if you decide to try  
it out how it works

Brian

-  
- -

Andrea Ratto wrote:

I think we are missing some easy integration with gnome desktop.  
Here is

how I got to think so:

I was working with some files on a remote folder using nautilus and
noticed I could open remote text files with gedit transparently; but
that did not work with gvim.
I knew vim can handle editing over ssh, and I would really value
clicking on a remote file and have it opened in gvim instead of  
gedit.


To cut a long story short I ended up in making this small script
under /usr/local/bin

#!/bin/bash

if [[ $# = 0 || $# = 1 && $1 = "-f" ]]; then
  /usr/bin/gvim $1
else
  /usr/bin/gvim --remote-tab `echo $@ | sed 's/-f//' | sed 's/ssh:
\/\/\(\w\+\)@\(\w\+\)\//scp:\/\/[EMAIL PROTECTED]/\//gi'`
fi

And now gvim behaves just like gedit!
I can open files from nautilus in the existing gvim session and open
files from a ssh folder. I like this behaviour and I think that very
little work is necessary to implement such features in the official
gvim, at least in the one with gnome support.

Basically what we need to get this quikly is:

1: have netrw handle links like ssh:[EMAIL PROTECTED]/folder/file just  
like it

handles scp:[EMAIL PROTECTED]//folder/file. May require similar changes for
other protocols as well.
2: allow --remote-tab with no argument to open a blank gvim session
instead of failing



what about --remote-tab-silent ?



It's better because does not produce useless output, but still  
works the
same way. Thanks for pointing it out, my example script should use  
that,

but the way it works it's not going to change.


3: change the exec line of the gvim.desktop from "gvim -f %U" to  
"gvim

-f -p --remote-tab %F"



IIUC, that's not a change in Vim. It may be a change in the Vim  
package in
your Linux distro if it installs that Vim shortcut. The "make  
install" from
the "official" Vim installation (as downloaded straight from  
ftp.vim.org )

installs no keyboard shortcut.



It's a menu entry not a keyboard shortcut. It sets the code to be run
when you open a file by clicking on it or when you click the gvim  
icon.




But IMHO those --remote-tab and -p parameters
shouldn't be there by default. I don't know the difference between  
%U and %F.



%U does one invocation per file opened,
like gvim fileone; gvim filetwo ...
%F does one invocation with all files as arguments
like gvim fileone filetwo ...



Even better: we could add some internal options like ":set  
remotetabs"

and ":set openintabs" so that this behavior can be set on a per user
basis. This would be elegant and could work with "gvim -f %F" exec
command in the .dekstop file.



I'm skeptical about the usefulness of such additional options.



Could you use gedit for a while, with multiple files? This may explain
the point better.




I'd like to know your opinions about this.

PS: it also seems that --remote-tab does play well with gnome
startup-notification when a session is already opened, but this  
is just

a cosmetic bug.



The fact that it does indeed play well is a cosmetic bug ???  
There's something

there that I don't quite grasp.



After opening in a remote tab from gnome the cursor is set to the  
"busy"

state even after the file is fully loaded. I don't want to insist on
this right now since it's probably easy to fix and it's just cosmetic.


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGP0VUGnOmb9xIQHQRAjSNAJ0Z5bF8afj9SLNHS1KxME3iIoPNlQCfQp+4
Cf/6+Z/KGW4QvQn+YBNxIIY=
=odjM
-END PGP SIGNATURE-


Re: Deleting some lines from a log file

2007-03-27 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 27-Mar-07, at 9:01 AM, Eddine wrote:


Hi

I have to clean up a log file.
I want to exclude/delete lines that start with a number or "MPRINT" :

{snippage}

I first tyred to identify all numbers at a beginning of a line, but
for instance when doing a substitution I cannot find the good regex
(for a try :%s/^[0-9]*/TEST/ didn't work).

Can you tell me how I have to do to delete those lines beginning by
numbers or MPRINT from my file ?


You were close.  Try

:g/^\d\|^\(MPRINT\)/d

Using :g/regex/d to delete whole lines that contain /regex/ I find a  
lot easier than

   :%s/regex.*\n//  which accomplishes the same thing

Using \d instead of [0-9] I think is easier too.

For what it's worth,  I find it really helpful to play with regexes  
just using /regex/ and looking at the resulting highlighted areas.
Once you get just what you want you just do a :%s// or :g// and it  
fills in the last used regex.


For example - try your regex of /^[0-9]*/ then change it to /^[0-9].*/

HTH
Brian



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGCSTjGnOmb9xIQHQRAtLeAJ992I/JzEP+5bvAMkEoECJqBAMXGQCgmbm0
7ON4v88jNJ/rIi0/hKfOonA=
=5pm2
-END PGP SIGNATURE-


Re: IDE's Vim 7 and Apple OS X

2007-03-24 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 24-Mar-07, at 8:35 AM, Michael Henry wrote:


Joseph White wrote:
While this works fine on Linux;  Mac OS X Vim does not recognize  
or read the $Home/.vim  directory,  is there an alternate location  
to place the IDE files?
On Windows it is the c:/program files/vim/plugin directory or  
something close to that. Can't figure what it might be on Mac.


This may not be much help, but on my mac running OS X the ~/.vim  
directory *is* recognized.  My runtimepath variable is as follows  
(shown by typing `:set runtimepath=` and then pressing  to  
populate the current value of the variable; it's convenient for cut- 
and-paste):


~/.vim,/Applications/Vim.app/Contents/Resources/vim/vimfiles,/A
pplications/Vim.app/Contents/Resources/vim/runtime,/Applications/ 
Vim.app/Content

s/Resources/vim/vimfiles/after,~/.vim/after

I don't believe I did anything special to get runtimepath setup  
like this.  I did compile Vim 7.206 myself, with :version  
information below.


I've always used .vim here too - in fact I rsync it from my linux box  
from time to time.

I'm using the binary from the macvim site.

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFGBTasGnOmb9xIQHQRAkTQAJ0cSmpN/vZWEmuA+8CJfG920qImMwCfX90d
HIwVfT+QWF8bnbDCMq8A/ug=
=Alf0
-END PGP SIGNATURE-


help with \z

2007-03-20 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All,

Tim's recent post got me looking at \z
I've read :h :syn-ext-match but it's gibberish to me at the moment

Can someone break down how this suggestion works?

If you want to delete everything after the 2nd comma, you can use
:%s/,[^,]*,\zs.*/


I get the 'search the whole document for a comma followed by a not- 
comma followed by whatever then a comma'

then ???

Comments appreciated

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFF//HvGnOmb9xIQHQRAol2AKCRY7vY1tt/ZG8JvwkImqmBZR6XEgCeNIdI
AdPSndCUCyha4bwhS0OpRZA=
=VdFU
-END PGP SIGNATURE-


Re: VimTips Wiki: New Direction

2007-03-06 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 6-Mar-07, at 3:34 PM, Denis Perelyubskiy wrote:



On Tue, 06 Mar 2007 11:31:53 -0700, "Steve Hall"
<[EMAIL PROTECTED]> said:

From: Hari Krishna Dara, Tue, March 06, 2007 11:33 am

and if we can enforce a fixed style on commenting such that the
comments don't look like a mess. I would imagine that one needs to
edit the tip to add their comment at the end, but it will be nice if
the comment itself happens as a discussion (which appears as a
discussion tab on the same page).


I agree, is there any way the porting process can push comments to
each tip's respective discussion tab?


why don't we discuss that here:
http://en.wikibooks.org/wiki/Talk:Learning_the_vi_editor/Vim/ 
TipsSandbox/Tip_1:_the_super_star


:-)

Seriously though, as I had mentioned on the discussion page, for me  
as a

user of the tip, it is horribly counter-productive to go and read
twenty-five thousands comments on a page. I'd much rather just read a
"perfect" tip. This assumes, of course, that tip contributors care  
about

me as a user. I hope they do :)

Wikipedia model seems to work great. One page. All the information.
Discussion on a separate page.

One change: if it matters, we could reserve a line (or two) for a list
of contributors. This information is available from the history  
page for

those who care to look anyway, but maybe people care about their names
being mentioned.

Finally, on the subject of converting the comments - it is entirely a
manual process, that can not be automated. Comments need to be
integrated into the   body of the main tip (maybe the tip needs to be
adjusted, reworded, etc). We should just push out the existing pages,
and then set to work on reworking the tips by hand. Eventually  
we'll be

done.

In any case, I think this will be an extremely useful resource
(especially if we could then put VIM's documentation on there, and
cross-link)



One of the first things I was thinking about mirrors the above comments.
http://en.wikibooks.org/wiki/Talk:Learning_the_vi_editor/Vim/ 
TipsSandbox/Tip_1:_the_super_star has a bunch of "thanks for the  
great tip!" type comments with more useage info interspersed.  I  
think those 'great tip' comments go to a separate page, while the  
'use # or % instead' kind of comments need to be edited into the  
actual tip itself.


I don't think that can be automated though - so the question is  
comments to a separate page and edited back in?  or all on one page  
and edited over to the secondary page...


Brian

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFF7dUhGnOmb9xIQHQRAlpVAJ45MZO4aj5DMVxdnN2Kvd85g6PoAwCff2AG
KdJM5sFvk/OcuLBVTVGeF6Q=
=MnvL
-END PGP SIGNATURE-


Re: VimTips Wiki: New Direction

2007-03-05 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 5-Mar-07, at 2:26 PM, Tom Purl wrote:

Here's my view of "where we are" regarding the Vim Tips wiki  
conversion

project:

{snippage}
Seems about right to me Tom!

6. A group of wiki superusers will inspect 50 random tips and make  
sure

   that they look good.


Mark me down as a volunteer for this stage... ( erp - did I say that  
out loud? :-)


Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFF7HYRGnOmb9xIQHQRAgS8AJ4yCto+UFyRrSdFcoMLP0PiwCb0ZwCgvGsG
/nTFJHSr5Mh7sTAAVo2L2xs=
=XmHl
-END PGP SIGNATURE-


Re: VimTips - Google Wiki Usefulness

2007-02-27 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 27-Feb-07, at 10:35 AM, Tom Purl wrote:




Using wikibooks.org sounds attractive, but I don't see any protection
against spamming.  And that is exactly what happens to the Vim tips.
It's just a matter of time before this happens on wikibooks.org too.


I agree that spam protection should be our top priority.


Why ?  We already have the spam problem and while annoying it doesn't  
negate the value of the tips themselves.
Sure it's important, but the quality and quantity of content should  
be top priority shouldn't it?


That aside - if wikibooks doesn't seem to have the spam problem now I  
don't think it's appropriate to dismiss them just because we don't  
_think_ it will work.
Proof is in the pudding - wikipedia and wikibooks seem to prove it  
_does_ work.


Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFF5GR1GnOmb9xIQHQRAuBFAJ9zQO1LbgFjjad4tgx6uB0EjcMR1QCeKiH/
KGMIh3PeLBOgJjfHxAI4Lqs=
=9GoK
-END PGP SIGNATURE-


Re: VimTips - Google Wiki Usefulness

2007-02-23 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 23-Feb-07, at 3:55 PM, A.J.Mechelynck wrote:

Waiting for email (with a pseudorandom confirmation code) proves  
that the registration wasn't requested "in your name" by someone  
else. It requires no human intervention server-side and only a few  
minutes' wait client-side while greatly improving security. It also  
proves that your "email-address-of-record" with the wiki is really  
yours. I'm for it.


I recently watched a video demoing software that automates the entire  
registration by email process to various brands of online forums -  
including grabbing a random account from a free email provider,  
filling out the forum registration and captcha, receiving the  
confirmation email and responding to it, then posting it's 'message'  
to the forum  Wish I had the link handy.I suspect the days of  
register by email as spam defence are numbered.


It does prove your email address of record though - I hadn't  
considered that.


Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFF31oDGnOmb9xIQHQRAkV6AKDW/AcSmm5nGrLItre2b/2+7O75BgCguMxM
NlmkOUCqj8LA6SrZMGrm4l4=
=83Aa
-END PGP SIGNATURE-


Re: VimTips - Google Wiki Usefulness

2007-02-23 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 23-Feb-07, at 3:00 PM, Brian McKee wrote:

On 23-Feb-07, at 2:32 PM, Tom Purl wrote:
I've done a bit of work on the vimtips wiki at Google the last few  
days,
and it's come to my attention that it isn't really designed to do  
what

we want it to do.
{snippage}
So what do you guys think?


I think the whole point behind using a wiki is to make it easy for  
people to contribute.
Forcing a manual registration process defeats the whole purpose of  
the thing in my mind.


Brian


Whoops - wrong reply button...  Redirected above to list and added  
below.


On 23-Feb-07, at 3:04 PM, Yakov Lerner wrote:
Regarding anonymous contributions, they proved problematic on  
vim.org/tips.

Anonymous contrib was what created uneditable tips in the first place
on vim.org/tips. The idea was "only the author can edit the post", but
since anonymous tips have no registered authors, they are totally  
uneditable,

which is hardly an advantage.

I question the value of anonymous posts. First. Are we exchanging  
the rootkits

or pirated software ? We are not. What is the value of anonymous in
the opensource community ?
Second. If someone can remain anonymous, he can register as
[EMAIL PROTECTED] and remain anonymous but still having registration.


I think the point is not 'anonymous' per se - obviously identity  
can't easily be proved anyway.
A very simple registration process that doesn't require 3rd party  
intervention or waiting on email is best I think.

Enough to slow down the spammers without slowing down the users.
As Yakov points out, if people could easily edit things now, the spam  
would long since have been removed.
Make sure the wiki has an easy 'rollback' feature to remove spam and  
RSS feeds and I'm happy.


Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFF30wqGnOmb9xIQHQRAiEsAJ4i1jJ1k3wRTZ38V3CVB4evqfHj+ACg0P1J
mTf+V/p33jWAxI+/SK1upLg=
=4FWR
-END PGP SIGNATURE-


Re: Feature suggestion

2007-01-25 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 25-Jan-07, at 1:07 PM, Greg Dunn wrote:


On 1/25/07, Brian McKee <[EMAIL PROTECTED]> wrote:

Control-A to increment numbers is really handy sometimes.   How about
adding logical opposites?
i.e.  control-a while the cursor is over the word TRUE would make it
flip to FALSE,
on to off, yes to no and vice versa - case preserving of course.  It
would be great for lots of config files.


I think what you want has already been done... Check out
http://www.vim.org/scripts/script.php?script_id=1046


Yep - that's pretty much what I wanted and more !
I'll pass my additions along to the authour.
Thanks all...

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFuRJgGnOmb9xIQHQRAlSiAJ0e7H/YS2lCInQhqaY8bXSC204nOgCfUgBC
jZ6ew60MhH3TkRBjCW7GpRA=
=9ytW
-END PGP SIGNATURE-


Feature suggestion

2007-01-25 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All,
Please correct me if I've missed something.

I see where sponsorship allows you to vote on new features.
What's the appropriate proceedure for suggesting a feature?

I'm including my suggestion here because somebody's likely to point  
out why it stinks - or how to do it now :-)


Control-A to increment numbers is really handy sometimes.   How about  
adding logical opposites?
i.e.  control-a while the cursor is over the word TRUE would make it  
flip to FALSE,
on to off, yes to no and vice versa - case preserving of course.  It  
would be great for lots of config files.


Comments appreciated,
Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFuN9/GnOmb9xIQHQRAijaAKC1OyHUg2NPGV7dAtLx7G+AIN712ACgvWc2
Z16WzM4kLdOO1AdOtor1UBk=
=PIic
-END PGP SIGNATURE-


Re: Formatting an all uppercase message

2007-01-10 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9-Jan-07, at 4:01 PM, A.J.Mechelynck wrote:


Brian McKee wrote:
I get text files that are ALL UPPERCASE and formatted to an odd  
line width from an internal email system.
I'd like to pretty them up.   Has somebody come up with a slick  
way to do this?
I suppose I could remove all line endings not preceded by a  
period, replace period space space with period return,
lowercase the whole thing, then uppercase the start of each line  
and any free standing 'I',
but I'm sure I'm forgetting something else that would be needed as  
well.
Proper nouns -- not that I'd know how to uppercase them  
automagically. Also, you'd have to make a choice about uppercasing  
or not for

He's greater than I.
i. Buttons.
ii. Thread.
iii. Needles.
iv. Thimble, jingles and rattles.


Yeah, not so simple is it...  Hmmm...  Well, maybe I'll make a macro  
that takes half a try and clean up the rest by hand.

I was hoping this was a 'solved problem'

Thanks for the pointers.
Brian

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFpV3gGnOmb9xIQHQRAsb4AKDMoNhP4geZeHrVNqgBt0BrazvAAACg4+Hq
H6Ecq18VJIY4CtuV0I9PldU=
=pQ3Y
-END PGP SIGNATURE-


Formatting an all uppercase message

2007-01-09 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello all,

This issue must be familiar to at least somebody
I get text files that are ALL UPPERCASE and formatted to an odd line  
width from an internal email system.
I'd like to pretty them up.   Has somebody come up with a slick way  
to do this?


I suppose I could remove all line endings not preceded by a period,  
replace period space space with period return,
lowercase the whole thing, then uppercase the start of each line and  
any free standing 'I',

but I'm sure I'm forgetting something else that would be needed as well.

Suggestions appreciated

Brian

PS  Yes I know vim isn't a word processor.   I don't know of a word  
processor that will do this either.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFo+vvGnOmb9xIQHQRAtHoAKDqpgXQ986J9JQB3CHHlQDFbcZdggCgsLeb
ZtRTasrfOTv6B7RElQHp2kQ=
=N1Tz
-END PGP SIGNATURE-


Re: Mac Questions

2007-01-09 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8-Jan-07, at 6:14 PM, Dave Land wrote:


On Jan 8, 2007, at 3:03 PM, Dave Land wrote:


Happily, Apple provided a utility that handles it for you:

   defaults read "${HOME}/.MacOSX/environment"


Actually, making this work in bash (or other shell) requires a  
little more than just reading the file... Here's the relevant chunk  
from my .bashrc:


# Get environment variables from ~/.MacOSX/environment.plist
# (This avoids the sin of duplicating data here and in that file)
if [[ `uname` == 'Darwin' ]] ; then
   defaults read ~/.MacOSX/environment | grep -v '[{}]' | tr '"'  
"'" | awk '{ print "declare -x",$1"="$3 }' | while read -r OneLine;  
do eval $OneLine; done;

fi

To give credit where it's due, this came from a comment on  
macosxhints.com.


The conditional (if [[ `uname` == "Darwin' ]]) is because I use  
this same .bashrc across several hosts, including Solaris, Linux,  
and Mac OS X.


Just a quick note to anyone using that plist option - I once wasted  
about 20 hours of my time because a 'bad? corrupt? I never determined  
exactly'
enviroment.plist file caused my home folder to become read-only to  
the Finder!  IIRC Terminal.app could still manipulate files.
It caused all sorts of nifty issues (mainly because ~/Library is used  
so much).  Since it's a single user machine, it looked like some  
bizarre disk issue.
What really got me going was when I couldn't find the problem, I  
reinstalled from scratch, everything was fine, then it came back when  
I restored my home folder.

Much hair tearing occurred on that one!

Hopefully I can save a few follicles for somebody else.

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFo+f8GnOmb9xIQHQRAsbaAJ9GcS7DyjSU78O1v3YWxdgtoBReUgCgy8Aq
HHLv34cFN6eyzje31pYIysk=
=c/F5
-END PGP SIGNATURE-


Re: Mac Questions

2007-01-09 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8-Jan-07, at 5:31 PM, Brett Calcott wrote:


This does seem to be the case. No amount of fiddling with .profile
.bashrc .bash_profile /etc/bashrc or whatever makes any difference to
the environment that ends up in the GUI version that is started from
the dock.

For the moment I just do something like this:
if has("gui_running")
 let $PATH=$PATH.':/some/more/paths:/and/more/still'
endif

Which does the trick for now.



FWIW - found this in my .vimrc
" Get a good value for $PATH.  For example, if teTeX is installed, this
" should add the path to tex, pdflatex, etc.
" This should only make a difference when vim is started from the  
Finder or

" with open.
let $PATH = system("printenv PATH")
let $PATH = substitute($PATH, "\$", "", "")

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFo56iGnOmb9xIQHQRArvVAKC9jHkQ2cg/nSN1eoui9TwlUkKwGwCg06LF
EUmrItXId5XsNVgg2Cc6VLU=
=DhLZ
-END PGP SIGNATURE-


Re: Vim Regexes and Mac Newlines

2006-12-13 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 13-Dec-06, at 4:36 PM, jeffthewookiee wrote:

I'm currently working with vi on OS X machines.
when I run something like this command:
:%s/,/,\n/
I end up with output like this:
  CourtDismissedCount3,^@


Use \r not \n
e.g. :%s/,/,\r/

Similarly you can convert the old CR only Mac files using :%s/\r/\r/g
I'm not sure I can explain why clearly, so I'll just leave it at that...

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (Darwin)
Comment: Verify this email or encrypt your email for free - see gnupg.org

iD8DBQFFgHUeGnOmb9xIQHQRAszUAJ4pFcmUnTK1o66uv1p+97hyd6DrHgCfSs3y
JFKVdx7L8oTfLePAYNqcth4=
=umrO
-END PGP SIGNATURE-


Re: suggestions for ssh under windows

2006-11-30 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 30-Nov-06, at 11:21 AM, Charles E Campbell Jr wrote:



I have a netrw user using WinXP who wants to use ssh; currently, he  
doesn't have such an executable.


Putty is the most common solution - although I haven't used it in  
conjunction with Vim...


http://www.chiark.greenend.org.uk/~sgtatham/putty/

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFbyHjGnOmb9xIQHQRAgTOAKDY8CQ/KaD2sYrQKq8N7EofC+LwOgCdHStV
/NoJZqDAcRlJqogH9rXCFd8=
=WZMF
-END PGP SIGNATURE-


Re: Calendar ?

2006-11-24 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

{Top posted 'cause the whole thread was - lotsa snippage}

It's actually mapped to \cal and \caL later in the plugin
The comment is out of date (if you read the change log)
Brian


I'm using version 1.4a.
Staring on line 37 in my version, there are usage statements.  If you
would rather not upgrade, then here's what it says:
" ca
"   show calendar in normal mode
" ch
"   show horizontal calendar ...


I found the plugin in $HOME/.vim/plugin/.
no usage instructions, no keybindings.

Check out the source, which should be in one of your plugin  
directories.  For
me, it's in $HOME/vimfiles/plugin/calendar.vim on my Win XP  
computer. The
header of the file has a ton of commments, including usage  
statements nad

"Additional" notes.


 where can I find instructions on how to use Calendar.vim and its
 keybindings ?

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFZwvfGnOmb9xIQHQRAsiIAJsHgOTo5v3LwUhKfC1NHElTLpZ+yQCgtJqk
/Lpgzdgtlg8i5TMnwHOR8WQ=
=6qdq
-END PGP SIGNATURE-


Re: using :ha under linux

2006-11-16 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 16-Nov-06, at 12:13 PM, Marlin Unruh wrote:

Hi,

In Linux how do I configure Vim to print a hard copy?
Please include syntax example.


If the printer works in linux, then just hit :ha and away it goes

What problem are you having exactly?

If you save the file somewhere does
  lpr somewhere/somefile.txt
work?  If not, then you have to fix that before vim will print.

Brian


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFXK4IGnOmb9xIQHQRAiXuAKDTYkM029MEIRVcp1nNRDt0YqF5SQCdEK9T
pCqrYGbnAocyfHpnAzlqBGk=
=o0GJ
-END PGP SIGNATURE-


Possible feature request

2006-10-18 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All,
	Was playing with the new built in sort this morning.  Found what I  
thought was an inconsistency.

Forgive the stilted explanation, I had trouble putting this in words.

I often work out my pattern match using /mypattern/ and observe the  
highlighting to make sure it's doing what I want it to.
Then I use %s//newpattern/  or whatever I'm going to do and the // is  
the previously tested pattern match.  Quite handy.


That doesn't work with :sort // r
I think it should to be consistent.  Am I wrong?  Missing something?
Comments appreciated

Brian McKee
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFNjF2GnOmb9xIQHQRAgCQAJ403/IwHu/i6MCmVWrhKW2L+jP+hgCg7fqx
l5SsqTxUiFfXIeL4HBRq7oI=
=NRVn
-END PGP SIGNATURE-


Re: Mapping of keysequences...

2006-10-02 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 2-Oct-06, at 3:51 PM, Andy Wokula wrote:


Meino Christian Cramer schrieb:

Thanks for all, Tony!!! :O)

I think Bram should add

  :he Tony


Add it yourself

:e ~/.vim/doc/tony.txt
:i
*tony.txt*  Tony's mail address

*Tony* "A.J.Mechelynck" 

 vim:tw=78:ts=8:ft=help:norl:
.
:w
:helptags ~/.vim/doc
:he Tony





Ya know - not only is that funny - it's useful !
It made me realize I can make my own crib sheet for the stuff I can't  
remember and embed it right in Vim!

Cool

e.g. :'<,'>!sort -t "^I" -k 9
I use that once a month or so, but never remember it... now it's :he  
sort9



Thanks!
Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFIXh3GnOmb9xIQHQRApcaAKCbBMBVNJB2kf6U5nTUU0cXB61ZfwCgpZYH
axmyL2MpQZZuzXScYpdFPwE=
=UOqL
-END PGP SIGNATURE-


Error messages using netrw not understood

2006-09-26 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All
	Using Vim 7 on an OSX machine, with passwordless ssh setup and  
working properly - if I start gvim then


:e scp://targetmachine/

It shows 'Error detected while processing BufEnter Auto commands for  
"*":

E472: Command failed

Hit return and it loads up the default directory as expected and  
works fine.


If you write a modified file back, you get
Error detected while processing function netrw#NetWrite:
line 219:
"scp://targetmachine/pathtofile" E212: Can't open file for writing
:!scp -q /tmp/sometempfile 'targetmachine:pathtofile'

Hit return and the file has in fact been written.
This is the one that's the most concerning to me.


I have posted screenshots of the errors at
http://www.bmckee.ca/vimErrorOnScpOpen.png
http://www.bmckee.ca/vimErrorOnScpWrite.png

Comments appreciated

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFGVCEGnOmb9xIQHQRAomxAJwPkrbcHIUomYXeOS16nx2ZumdYwwCfQB2i
tKpfe20/MRY9Dw1rnZoy6gM=
=DPJU
-END PGP SIGNATURE-


Re: Text edit versus vi on some files

2006-09-21 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 8:46 PM, A.J.Mechelynck wrote:


Brian McKee wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 18-Sep-06, at 11:56 AM, David Morel wrote:

Brian McKee a écrit :

file Localizable.strings
Localizable.strings: Big-endian UTF-16 Unicode C program  
character data

If I open that file in vim I get
??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@ 
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]
but Text Edit displays it correctly.
Can vi handle this type of file?  If so, how?

in vim, type :h multibyte
that should get you started :)

{snippage}
Your example looks like UTF-16 (or UCS-2) text, i.e. Unicode  
encoded at two bytes per character for most characters. Such text  
may contain characters (Chinese, Russian, Hebrew, Greek, Arabic,  
whatever) which canot be represented in latin1. I suggest the  
following (in gvim):


if &termencoding == ""
let &termencoding = &encoding
endif
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,latin1
{snippage}


Thanks Tony (and Elliot and Ned) for your replies,
I've been off sick for a couple of days so I'll revisit this when I  
get out from under the pile.


FWIW my $LANG is empty, and the last time I used a ~/.MacOSX/ 
environment.plist I got the coolest OSX bug I've
ever seen - after an Apple update (as near as I can tell by the  
timing) my home folder was suddenly read only.
If you knew how long I spent trouble shooting that you'd know why I'm  
not going there again :-)


Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFEtRoGnOmb9xIQHQRAtK0AJ9ycLB3nbGTFBvE70IJ1KokebHU3QCeNDcU
vJJSigH2P9QepW/6QCi4Cg4=
=9hUj
-END PGP SIGNATURE-


Re: Text edit versus vi on some files

2006-09-18 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 3:24 PM, Yakov Lerner wrote:


On 9/18/06, Brian McKee <[EMAIL PROTECTED]> wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 11:56 AM, David Morel wrote:

> Brian McKee a écrit :
>>>> file Localizable.strings
>>>> Localizable.strings: Big-endian UTF-16 Unicode C program
>>>> character data
>> If I open that file in vim I get
>> ??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@[EMAIL PROTECTED]
>> but Text Edit displays it correctly.
>> Can vi handle this type of file?  If so, how?
> in vim, type :h multibyte
> that should get you started :)
{snippage}
Am I right in understanding that Apple's TextEdit must be  
automatically

detecting UTF16 files and changing it's base encoding to match?

And is there some way that vi could do the same?


The folowing autodetects utf-16 from latin1
for me I put it into my ~/.vimrc:

  au BufRead * if getline(1) =~ "\n" | e ++enc=utf16 | endi

... Does it following work for you ?


Nope.  With my original test file
the output looks reasonable, but it shows
 CONVERSION ERROR in line 391
at the bottom of the screen.

I then tried the Japanese version
/Applications/iTunes.app/Contents/Resources/Japanese.lproj/ 
Localizable.strings

and got a similar CONVERSION ERROR message, and lots of question marks.
If I start vi, and do
:set encoding=utf16
:set fileencoding=utf16
then reopen the file, I get what looks *to me* like Japanese  
characters  (I'm pretty much unilingual unfortunately)


Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFDvf/GnOmb9xIQHQRAupWAJwOGYCxwJjUn1oMzcOaFqVggzBo2QCg4IJt
yQS7zG/rRCnsonFu1qvcCks=
=2NJG
-END PGP SIGNATURE-


Re: Text edit versus vi on some files

2006-09-18 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 11:56 AM, David Morel wrote:


Brian McKee a écrit :

file Localizable.strings
Localizable.strings: Big-endian UTF-16 Unicode C program  
character data

If I open that file in vim I get
??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@ 
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]
but Text Edit displays it correctly.
Can vi handle this type of file?  If so, how?

in vim, type :h multibyte
that should get you started :)


Eeeek - started right around the bend I think :-)
Biggest issue from my current point of view is it studiously ignores  
Mac OS...


Chris Eidhof suggested

set encoding=utf8
set fileencoding=utf8


which works if you set it before you open the file in question.
Interestingly =utf16 'works' too... or at least it shows plain ASCII  
type lettering ok.


Between those ideas I've decided to leave things alone and just do a
   :e ++enc=utf16
whenever I see lots of alternating @ signs and letters :-)
I think I'd prefer leaving my standard encoding at latin1 to match  
the linux

boxes I'm often working on at the same time.

Am I right in understanding that Apple's TextEdit must be automatically
detecting UTF16 files and changing it's base encoding to match?

And is there some way that vi could do the same?

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFDuvUGnOmb9xIQHQRAi6hAJ9858onQRWXR+kByXCcm/Cpk631bACg2cbB
e2JH8drOIyERomjI7zpPTn0=
=Wa4n
-END PGP SIGNATURE-


Re: Using openssl bf encryption

2006-09-06 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 31-Aug-06, at 12:09 PM, Brian McKee wrote:

Hi All
I'd like to be able to edit an encrypted plain text file using vim.
It's blowfish encoded with openssl.

{snippage}

Well, the response to the previous email was underwhelming :-)

I've done some limited testing, and came up with an addition to  
my .vimrc
that seems to work really slick.  I've attached that to the bottom  
for future generations

to criticize.

The nifty unintended side effect was I can encrypt any file I'm  
working on just

by saving it with a .bf extension.

If anyone has any comments or spots an ooppsie, by all means let me  
know.

Thanks
Brian

" Transparent editing of bf encrypted files.
" Originally By Wouter Hanegraaff <[EMAIL PROTECTED]>
" with very minor alterations for bf by bmckee <[EMAIL PROTECTED]>
" note the file must be encrypted with the -a and -salt options
" no guarantees using this won't post your secrets on myspace.com :-)
augroup encrypted
au!

" First make sure nothing is written to ~/.viminfo while editing
" an encrypted file.
autocmd BufReadPre,FileReadPre  *.bf set viminfo=
" We don't want a swap file, as it writes unencrypted data to disk
autocmd BufReadPre,FileReadPre  *.bf set nobackup
" We don't want a backup
autocmd BufReadPre,FileReadPre  *.bf set nowritebackup
" We don't want an inprogress backup either
autocmd BufReadPre,FileReadPre  *.bf set noswapfile
" Switch to binary mode to read the encrypted file
autocmd BufReadPre,FileReadPre  *.bf set bin
autocmd BufReadPre,FileReadPre  *.bf let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost*.bf '[,']!openssl bf -d - 
salt -a 2> /dev/null

" Switch to normal mode for editing
autocmd BufReadPost,FileReadPost*.bf set nobin
autocmd BufReadPost,FileReadPost*.bf let &ch = ch_save|unlet  
ch_save
autocmd BufReadPost,FileReadPost*.bf execute ":doautocmd  
BufReadPost " . expand("%:r")

" Convert all text to encrypted text before writing
autocmd BufWritePre,FileWritePre*.bf   '[,']!openssl enc -bf  
- -salt -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*.bf   u
augroup END
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFE/uMIGnOmb9xIQHQRApQnAKDEnaRpfXaoKTfyngqyBgPcucu1YgCbBoEd
SqI2qKqhueFPT5tklmDlXMM=
=jGn8
-END PGP SIGNATURE-


Using openssl bf encryption

2006-08-31 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All
I'd like to be able to edit an encrypted plain text file using vim.
It's blowfish encoded with openssl.   I noticed right away that the  
contents

could end up in .viminfo, so I started doing some research.

I looked at these pages
http://www.vim.org/tips/tip.php?tip_id=1251
http://www.vim.org/tips/tip.php?tip_id=90
http://www.vim.org/htmldoc/usr_23.html
http://www.vim.org/scripts/script.php?script_id=661
and others trying to figure out the best way to do this.

I see related items listed as 21 and 36 on http://vim.sourceforge.net/ 
sponsor/vote_results.php


If I use this (untested)
- 
" Transparent editing of bf encrypted files.
" Originally By Wouter Hanegraaff <[EMAIL PROTECTED]>
" with alterations for bf by bmckee
augroup encrypted
au!

" First make sure nothing is written to ~/.viminfo while editing
" an encrypted file.
autocmd BufReadPre,FileReadPre  *.bf set viminfo=
" We don't want a swap file, as it writes unencrypted data to disk
autocmd BufReadPre,FileReadPre  *.bf set noswapfile
" Switch to binary mode to read the encrypted file
autocmd BufReadPre,FileReadPre  *.bf set bin
autocmd BufReadPre,FileReadPre  *.bf let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost*.bf '[,']!openssl bf -d - 
salt 2> /dev/null

" Switch to normal mode for editing
autocmd BufReadPost,FileReadPost*.bf set nobin
autocmd BufReadPost,FileReadPost*.bf let &ch = ch_save|unlet  
ch_save
autocmd BufReadPost,FileReadPost*.bf execute ":doautocmd  
BufReadPost " . expand("%:r")


" Convert all text to encrypted text before writing
autocmd BufWritePre,FileWritePre*.bf   '[,']!openssl enc bf - 
salt 2>/dev/null

" Undo the encryption so we are back in the normal text, directly
" after the file has been written.
autocmd BufWritePost,FileWritePost*.bf   u
augroup END
- 

The question is (yah I took a long time getting here) where does  
decrypted data end up?


It's obviously going to be in ram at some point - I figure that's  
unavoidable if I actually want to look at the data :-)
and thus might end up in operating system swap files - I can deal  
with that.


Does 'shelling out' using the ! end up writing the data to disc as a  
temp file somewhere then unlink it?
If that's the case isn't that really the same as decrypt it using  
program A, edit it using program B, then re-encrypt it?
That is fine for this application,  otherwise I'd be looking at whole  
file system encryption I think.


Is there some other exposure I'm not aware of?

Brian McKee
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFE9wmsGnOmb9xIQHQRAoI4AJ9AXqovMNe5v2YTQrs8hsYuVcQyGACeJ1OW
FENk31mDuJ9GTqfQsGbxfXg=
=qXsg
-END PGP SIGNATURE-