Re: Mac Questions

2007-01-09 Thread Bram Moolenaar

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.

This issue comes up often enough that it deserves a section in the help.
Could you perhaps write some text?  If you can send me a patch that
would be great.

-- 
hundred-and-one symptoms of being an internet addict:
4. Your eyeglasses have a web site burned in on them.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: :sort by date

2007-01-09 Thread Vigil

This works on my admittedly small test set:

:%!sort -k3 -t/


You're making several unstated assumptions.

(1) The records are already sorted by month and day.


I would have thought that, too, but sorting this:

01/04/2007 blah
01/03/2007 blah
12/30/2006 blah
07/05/2003 blah
02/04/2007 blah
02/04/2006 blah
14/32/1996 blah
02/04/1996 blah

give this:

02/04/1996 blah
14/32/1996 blah
07/05/2003 blah
02/04/2006 blah
12/30/2006 blah
01/03/2007 blah
01/04/2007 blah
02/04/2007 blah

which, as you can see, has sorted by month and day, too, or is that just 
happenstance?



(3) Everything to the right of the year is the same in each
   record.


Ah, I see why. My example sorts beginning at that column, not just on that 
column alone.


--

.


RE: Find and replace in visual area.

2007-01-09 Thread Silva, Paulo
Nope, that didn't helped much.
But no worries, the simple replace when visual is still selected works
fine.
I gess I'll never know why, but then again it dosen't matter really if I
can do it some other way.

Thanks =) 

-Original Message-
From: Mr. Shawn H. Corey 
Sent: segunda-feira, 8 de Janeiro de 2007 22:38
To: vim@vim.org
Subject: Re: Find and replace in visual area.

Charles E Campbell Jr wrote:
> Silva, Paulo wrote:
> 
>> Greetings,
>> I'm trying to do a replace in a selection.
>> After selecting the area, with v, directional keys, v again (or not -
>> both give the same result).
>>
>> Then I type
>> :%s/\%V20/21/
>>
>> and I get:
>> E71: Invalid character after \%
>>
>> This works the same with any caracter that I put after the \% even
with
>> no character.
>>
>> Am I doing something wrong?
>>  
>>
> I don't know why you're having problems with \% ; it sounds
> like something in your options
> (ie. settings in your .vimrc): completion (:echo &cpt), magic (:echo
> &magic), cpoptions (:echo &cpo-- is l in it?),
> compatible (:echo &cp), etc.
> 
> Regards,
> Chip Campbell
> 
> 

I think it's looking for \%(

See
  :help \%(

-- 
__END__

Just my 0.0002 million dollars worth,
   Shawn

"For the things we have to learn before we can do them, we learn by
doing them."
  Aristotle


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: Find and replace in visual area.

2007-01-09 Thread Charles E Campbell Jr

Silva, Paulo wrote:


Nope, that didn't helped much.
But no worries, the simple replace when visual is still selected works
fine.
I gess I'll never know why, but then again it dosen't matter really if I
can do it some other way.
 

In that case, you may wish to consider vis.vim -- it allows you to 
perform command mode operations

on a visual block/character/line selected region, including substitutes:

 ctrl-v
 move
 :B s/abc/def/g

as an example.

You can get the latest vis.vim from

   http://mysite.verizon.net/astronaut/vim/index.html#VIS

or a more stable version from:

   http://vim.sourceforge.net/scripts/script.php?script_id=1195

Regards,
Chip Campbell




Reformat in visual area - vmap question

2007-01-09 Thread John Cordes
 I have *very* little experience writing 'map' commands for my
.vimrc (Linux). For some years I've had the following two
commands for reformatting with the par utility.

" reformat paragraph with no arguments:
map ** {!}par^M}
"
" reformat paragraph with arguments:
map *^V  {!}par

 They both work well, but I frequently would like to run par
on a visual selection. I naively tried

vmap *^V  {!}par

 but this fails with the message (when I try "* 55" on a
selected area)

:'<,'>!}par 55
shell returned 127

 I would appreciate a suggestion here. Perhaps par is unable
to deal with a non-paragraph -- makes sense, I guess! I know I
can do at least simple reformatting by setting tw to the
desired value and using things like gqip etc. I just wondered
if there's a way to still use par.

 Thanks,
 John Cordes


how to auto set all 26 markers when a match is made?

2007-01-09 Thread o1792
Hi

So apparently when manually navigating a file in vim you can set a marker by 
typing "ma" at the point of your choosing, the other 25 are represneted by b-z. 
Great stuff.

But what I'd like to is have vim put in the markers itself, based on a regex I 
give it. So I suppose I need some sort of exec command the kind used in unix 
find, etc. i.e.

:%s/myfabregex/exec "ma"/g

of course that will only work for the first marker, so I will need a loop that 
increments alphabetically, which I also don't know how to do (numerically, yes) 

Would that be possible? The idea is that I could navigate long documents using 
the markers.

Thanks in advance! 

Cheers.



Send instant messages to your online friends http://uk.messenger.yahoo.com


Re: Reformat in visual area - vmap question

2007-01-09 Thread Charles E Campbell Jr

John Cordes wrote:


I have *very* little experience writing 'map' commands for my
.vimrc (Linux). For some years I've had the following two
commands for reformatting with the par utility.

" reformat paragraph with no arguments:
map ** {!}par^M}
"
" reformat paragraph with arguments:
map *^V  {!}par

They both work well, but I frequently would like to run par
on a visual selection. I naively tried

vmap *^V  {!}par

but this fails with the message (when I try "* 55" on a
selected area)

:'<,'>!}par 55
shell returned 127

I would appreciate a suggestion here.
 



Well, I don't appear to have par on my FC5 box; so my suggestion will 
have been untested.

However, here it is anyway:

1. Get vis.vim from:

   http://mysite.verizon.net/astronaut/vim/index.html#VIS

or a more stable version from:

   http://vim.sourceforge.net/scripts/script.php?script_id=1195

2. Select your block of text
  ctrl-v
 move
 :B !par

The "vis.vim" plugin provides the :B command, which allows visual 
blocks/character/line selected

regions to be handled by ex-mode commands (such as :!par).

Regards,
Chip Campbell




Re: how to auto set all 26 markers when a match is made?

2007-01-09 Thread Tim Chase

But what I'd like to is have vim put in the markers itself,
based on a regex I give it. So I suppose I need some sort of
exec command the kind used in unix find, etc. i.e.

:%s/myfabregex/exec "ma"/g

of course that will only work for the first marker, so I will
need a loop that increments alphabetically, which I also don't
know how to do (numerically, yes)

Would that be possible? The idea is that I could navigate long
documents using the markers.



Yes it's possible (I presume you mean "norm" rather than "exec" 
as "exec" gets you the ex command, while "norm" gives you the 
normal command)...though you'd have to define what sort of 
behavior you want if there are more than 26 hits for your regexp 
in the document.  The basic "command" (okay, it several commands 
that could be mapped as one) would be something like this untested:


:let i=0 | g/re/exec "k".nr2char(97+(i>25? 25 : i) | let i+=1

The behavior here is that if you have more than 26 matches, the 
first 25 are tagged, and then the 26th marks the last hit, so 
26..N-1 are unmarked.


Tinker to taste.

-tim





Re: Reformat in visual area - vmap question

2007-01-09 Thread Tim Chase

" reformat paragraph with no arguments:
map ** {!}par^M}
"
" reformat paragraph with arguments:
map *^V  {!}par

 They both work well, but I frequently would like to run par
on a visual selection. I naively tried

vmap *^V  {!}par


I suspect you want something like

vnoremap *^V :!par

I'll throw in the obligatory caution that the "*" is an actual 
Vim command (and thus useful...I employ it nearly daily).  You 
might want use "" to map it to something like


vnoremap = :!par
vnoremap g= :!par

which is designed more for a purpose like this.

The second one should, after you highlight some lines, leave you 
on a line that reads something like


:'<,'>!par_

(where "_" is a space) where you can enter additional parameters 
for par.


This operates on line-wise selections...for blockwise or 
characterwise selections, you may have to bung with Dr. Chip's 
VisVim plugin which should accept the same sort of format as the 
above command(s).


HTH,

-tim






Re: Reformat in visual area - vmap question

2007-01-09 Thread John Cordes
On [2007-01-09 at 10:50am] Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:
> John Cordes wrote:
> 
> >They both work well, but I frequently would like to run par
> >on a visual selection. I naively tried
> >
> >vmap *^V  {!}par
> >
> >but this fails with the message (when I try "* 55" on a
> >selected area)
> >
> >:'<,'>!}par 55
> >shell returned 127
> 
> 1. Get vis.vim from:
> 
> 2. Select your block of text
>   ctrl-v
>  move
>  :B !par
> 
> The "vis.vim" plugin provides the :B command, which allows
> visual blocks/character/line selected regions to be handled
> by ex-mode commands (such as :!par).

 Thanks for the response. I usually would be using Shift-V to
select the lines for formatting; I take it vis.vim wouldn't
work in that case?

 John Cordes


 


Re: Reformat in visual area - vmap question

2007-01-09 Thread Tim Chase

 Thanks for the response. I usually would be using Shift-V to
select the lines for formatting; I take it vis.vim wouldn't
work in that case?


Heh, Dr. Chip answered the other half of my response. :)

Normal ranges operate linewise.  Dr. Chip's vis.vim plugin 
overcomes this limitation, and allows ranges to be treated 
block-wise and character-wise.  So if you only need linewise, vim 
already does it.  If you need to overcome that limitation, use 
vis.vim.


-tim




compile options

2007-01-09 Thread striker
I successfully compiled vim 7 on Mac OS X, but neglected to set  
options for things like Python, Perl, and digraphs, etc...


I did the following to re-compile:
>make distclean
>./configure --enable-perlinterp --enable-pythoninterp --enable- 
tclinterp --enable-fontset --with-features=huge

>make
>make install

The installation progressed fine and the interpreters work fine.  The  
digraphs are still minimal.
Do I need to re-compile with an option for digraphs or is there a way  
to enable digraph support with re-compiling?


Any help would be greatly appreciated.

Kevin


Re: Reformat in visual area - vmap question

2007-01-09 Thread John Cordes
On [2007-01-09 at 11:00am] Tim Chase <[EMAIL PROTECTED]> wrote:
> I suspect you want something like
> 
> vnoremap *^V :!par

 This one worked the way I expected - thanks!
> 
> I'll throw in the obligatory caution that the "*" is an
> actual Vim command (and thus useful...I employ it nearly
> daily).  You might want use "" to map it to
> something like
> 
> vnoremap = :!par vnoremap g=
> :!par
> 
> which is designed more for a purpose like this.
> 
> The second one should, after you highlight some lines, leave
> you on a line that reads something like
> 
>   :'<,'>!par_
> 
> (where "_" is a space) where you can enter additional
> parameters for par.

  I never encountered "" before; I have just read :h
on  but don't seem to be much wiser :(

 I've had trouble implemented your suggestion (I _would_ like
to preserve "*" for its intended vim usage). After putting
those two lines into .vimrc, and selecting some lines
(linewise select), what do I do to 'run' the command? [I tried
g and ,g -- didn't really know what else to do] Sorry to be so
clueless...

 Thanks,
 John Cordes


Re: Reformat in visual area - vmap question

2007-01-09 Thread Albie

John Cordes wrote:

On [2007-01-09 at 11:00am] Tim Chase <[EMAIL PROTECTED]> wrote:
  

I suspect you want something like

vnoremap *^V :!par



 This one worked the way I expected - thanks!
  

I'll throw in the obligatory caution that the "*" is an
actual Vim command (and thus useful...I employ it nearly
daily).  You might want use "" to map it to
something like

vnoremap = :!par vnoremap g=
:!par

which is designed more for a purpose like this.

The second one should, after you highlight some lines, leave
you on a line that reads something like

:'<,'>!par_

(where "_" is a space) where you can enter additional
parameters for par.



  I never encountered "" before; I have just read :h
on  but don't seem to be much wiser :(

 I've had trouble implemented your suggestion (I _would_ like
to preserve "*" for its intended vim usage). After putting
those two lines into .vimrc, and selecting some lines
(linewise select), what do I do to 'run' the command? [I tried
g and ,g -- didn't really know what else to do] Sorry to be so
clueless...

 Thanks,
 John Cordes


  

First, run (in normal mode):

:let mapleader

That command will reveal the key you currently have configured to be 
your .  Assuming the output of the above command is:


mapleader ,

You should then be able to execute the first command by going:

v
[moving around for selection]
,=

For the second command, replace ",=" above with ",g=".

The  defaults to \ on some installations, I believe.

Regards

--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | 


Re: Reformat in visual area - vmap question

2007-01-09 Thread Charles E Campbell Jr

John Cordes wrote:


On [2007-01-09 at 10:50am] Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:
 


John Cordes wrote:

   


They both work well, but I frequently would like to run par
on a visual selection. I naively tried

vmap *^V  {!}par

but this fails with the message (when I try "* 55" on a
selected area)

:'<,'>!}par 55
shell returned 127
 


1. Get vis.vim from:

2. Select your block of text
 ctrl-v
move
:B !par

The "vis.vim" plugin provides the :B command, which allows
visual blocks/character/line selected regions to be handled
by ex-mode commands (such as :!par).
   



Thanks for the response. I usually would be using Shift-V to
select the lines for formatting; I take it vis.vim wouldn't
work in that case?
 

The example given above was for visual-block; Shift-V is visual line 
selection.  All three
visual selection methods: by block (ctrl-v), by character (v), and by 
line (V), are supported.


Regards,
Chip Campbell



Re: Reformat in visual area - vmap question

2007-01-09 Thread Albie

John Cordes wrote:

On [2007-01-09 at 11:00am] Tim Chase <[EMAIL PROTECTED]> wrote:
  

I suspect you want something like

vnoremap *^V :!par



 This one worked the way I expected - thanks!
  

I'll throw in the obligatory caution that the "*" is an
actual Vim command (and thus useful...I employ it nearly
daily).  You might want use "" to map it to
something like

vnoremap = :!par vnoremap g=
:!par

which is designed more for a purpose like this.

The second one should, after you highlight some lines, leave
you on a line that reads something like

:'<,'>!par_

(where "_" is a space) where you can enter additional
parameters for par.



  I never encountered "" before; I have just read :h
on  but don't seem to be much wiser :(

 I've had trouble implemented your suggestion (I _would_ like
to preserve "*" for its intended vim usage). After putting
those two lines into .vimrc, and selecting some lines
(linewise select), what do I do to 'run' the command? [I tried
g and ,g -- didn't really know what else to do] Sorry to be so
clueless...

 Thanks,
 John Cordes


  

First, run (in normal mode):

:let mapleader

That command will reveal the key you currently have configured to be
your .  Assuming the output of the above command is:

mapleader ,

You should then be able to execute the first command by going:

v
[moving around for selection]
,=

For the second command, replace ",=" above with ",g=".

The  defaults to \ on some installations, I believe.

Regards

--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | 



Re: Reformat in visual area - vmap question

2007-01-09 Thread Charles E Campbell Jr

Tim Chase wrote:


 Thanks for the response. I usually would be using Shift-V to
select the lines for formatting; I take it vis.vim wouldn't
work in that case?



Heh, Dr. Chip answered the other half of my response. :)

Normal ranges operate linewise.  Dr. Chip's vis.vim plugin overcomes 
this limitation, and allows ranges to be treated block-wise and 
character-wise.  So if you only need linewise, vim already does it.  
If you need to overcome that limitation, use vis.vim.



:)

Yep, vim already supports linewise, but I figured I'd include it in 
vis.vim for completeness (and for those whose fingers get into a 
pattern!).  It only cost two extra lines of script (one to test if its 
'V' mode, the other to pass it along to vim:  '<,'> [command] ).


Chip Campbell





Re: Reformat in visual area - vmap question

2007-01-09 Thread John Cordes
On [2007-01-09 at 11:55am] Albie <[EMAIL PROTECTED]> wrote:
> John Cordes wrote:
> >On [2007-01-09 at 11:00am] Tim Chase <[EMAIL PROTECTED]> wrote:
> >>vnoremap = :!par 
> >>vnoremap g= :!par
> >
> >  I never encountered "" before; I have just read :h
> >on  but don't seem to be much wiser :(

> First, run (in normal mode):
> 
> :let mapleader
> 
> That command will reveal the key you currently have
> configured to be your .  Assuming the output of the
> above command is:
> 
> mapleader ,
> 
> You should then be able to execute the first command by going:
> 
> v
> [moving around for selection]
> ,=
> 
> For the second command, replace ",=" above with ",g=".
> 
> The  defaults to \ on some installations, I believe.

 Ah - thank you. My mapleader variable was undefined. I set it
to "," and now things behave the way you, and Tim, said they
should.

 I may give vis.vim a try too, but for now I am ok with
linewise selectin.

 Thank you all very much - what a great list!

 John


Re: Upper casing a UTF-8 character

2007-01-09 Thread A.J.Mechelynck

Przemyslaw Gawronski wrote:

Hi

I've got csv file, with some text fields encoded in utf-8. I would like
to upper case the first letter in a word. Normally I would just use '~'
on that character, but it doesn't seem to work with utf-8 encoding.

Thanks for suggestions

Przemek


Works for me. Just tried the ~ command in a UTF-8 buffer:

- Works with German a-umlaut and with Russian ya.

- Doesn't work with German eszet, whose uppercasing is not reversible (ß => SS 
=> ss) but which cannot be the first letter of a word.



Best regards,
Tony.


Re: compile options

2007-01-09 Thread A.J.Mechelynck

striker wrote:
I successfully compiled vim 7 on Mac OS X, but neglected to set options 
for things like Python, Perl, and digraphs, etc...


I did the following to re-compile:
 >make distclean
 >./configure --enable-perlinterp --enable-pythoninterp 
--enable-tclinterp --enable-fontset --with-features=huge

 >make
 >make install

The installation progressed fine and the interpreters work fine.  The 
digraphs are still minimal.
Do I need to re-compile with an option for digraphs or is there a way to 
enable digraph support with re-compiling?


Any help would be greatly appreciated.

Kevin



The :dig command (without arguments) lists the digraphs defined for the 
current 'encoding'. To see all currently defined digraps, first set 'encoding' 
to UTF-8. This, of course, requires has("multi_byte").


Best regards,
Tony.


Re: compile options

2007-01-09 Thread A.J.Mechelynck

A.J.Mechelynck wrote:

striker wrote:
I successfully compiled vim 7 on Mac OS X, but neglected to set 
options for things like Python, Perl, and digraphs, etc...


I did the following to re-compile:
 >make distclean
 >./configure --enable-perlinterp --enable-pythoninterp 
--enable-tclinterp --enable-fontset --with-features=huge

 >make
 >make install

The installation progressed fine and the interpreters work fine.  The 
digraphs are still minimal.
Do I need to re-compile with an option for digraphs or is there a way 
to enable digraph support with re-compiling?


Any help would be greatly appreciated.

Kevin



The :dig command (without arguments) lists the digraphs defined for the 
current 'encoding'. To see all currently defined digraps, first set 
'encoding' to UTF-8. This, of course, requires has("multi_byte").


Best regards,
Tony.



P.S. Before compiling Vim (with "make" at top level) I source the following 
(sourcing with "source" or ".", not running by straightforward invocation) in 
bash:


export CONF_OPT_GUI='--enable-gnome-check'
export CONF_OPT_PERL='--enable-perlinterp'
export CONF_OPT_PYTHON='--enable-pythoninterp'
export CONF_OPT_TCL='--enable-tclinterp --with-tcl=tclsh8.4'
export CONF_OPT_RUBY='--enable-rubyinterp'
export CONF_OPT_MZSCHEME='--enable-mzschemeinterp'
export CONF_OPT_CSCOPE='--enable-cscope'
export CONF_OPT_MULTIBYTE='--enable-multibyte'
export CONF_OPT_FEAT='--with-features=huge'
export CONF_OPT_COMPBY='"[EMAIL PROTECTED]"'


Best regards,
Tony.


Re: :sort by date

2007-01-09 Thread Bill McCarthy
On Tue 9-Jan-07 4:11am -0600, Vigil wrote:

>>> This works on my admittedly small test set:
>>>
>>> :%!sort -k3 -t/

>> You're making several unstated assumptions.
>>
>> (1) The records are already sorted by month and day.

> I would have thought that, too, but sorting this:
>
> 01/04/2007 blah
> 01/03/2007 blah
> 12/30/2006 blah
> 07/05/2003 blah
> 02/04/2007 blah
> 02/04/2006 blah
> 14/32/1996 blah
> 02/04/1996 blah
>
> give this:
>
> 02/04/1996 blah
> 14/32/1996 blah
> 07/05/2003 blah
> 02/04/2006 blah
> 12/30/2006 blah
> 01/03/2007 blah
> 01/04/2007 blah
> 02/04/2007 blah
>
> which, as you can see, has sorted by month and day, too,
> or is that just happenstance?

I had assumed the latter - but read on.

>> (3) Everything to the right of the year is the same in each
>>record.

> Ah, I see why. My example sorts beginning at that column, not just on that
> column alone.

I thought I knew the unix sort utility fairly well.  I'm a
bit baffled.

I wrote a simple program to generate 1,000 records with just
random dates (month 1-12, day 1-30, year 1976-2007).

Sorting with:

:%!sort -t/ -k3
and
:%!sort -t/ -k3.1n,3.4 -k1n,2

produced identical correct results!

I then modified my program to add a comma and a random
letter.  Of course, your method failed since your 3rd field
includes the trailing 2 characters.

But modifying your method to:

:%!sort -t/ -k3n

worked perfectly 

BTW, I'm using: sort (GNU coreutils) 5.3.0
on Windows XP.  I know this discussion is a bit off topic
but I have found it fascinating.  Thanks, Vigil, for bring
it up.

-- 
Best regards,
Bill



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: compile options

2007-01-09 Thread striker
Thanks Tony!  I found that info. on your page http://users.skynet.be/ 
antoine.mechelynck/vim/compunix.htm.   That is why I got as far as I  
did the first time.
I haven't been able to get gui to work yet.  I use --enable-carbon- 
check as the CONF_OPT_GUI.

I have encoding set to utf-8.
I have the pre-compiled .dmg file for Mac OS X.  In that version I  
there are quite a few digraphs and I use many of them.
On the version that I compile there is still a very limited number of  
digraphs.

Everything else that I have tried so far seems to be working correctly.

Questions:
Can anyone tell me where to find options for GUI on Mac OS X or if it  
should be something other than carbon?


How can I enable the full set of digraphs?

TIA,
Kevin


On Jan 9, 2007, at 12:19 PM, A.J.Mechelynck wrote:


A.J.Mechelynck wrote:

striker wrote:
I successfully compiled vim 7 on Mac OS X, but neglected to set  
options for things like Python, Perl, and digraphs, etc...


I did the following to re-compile:
 >make distclean
 >./configure --enable-perlinterp --enable-pythoninterp --enable- 
tclinterp --enable-fontset --with-features=huge

 >make
 >make install

The installation progressed fine and the interpreters work fine.   
The digraphs are still minimal.
Do I need to re-compile with an option for digraphs or is there a  
way to enable digraph support with re-compiling?


Any help would be greatly appreciated.

Kevin

The :dig command (without arguments) lists the digraphs defined  
for the current 'encoding'. To see all currently defined digraps,  
first set 'encoding' to UTF-8. This, of course, requires has 
("multi_byte").

Best regards,
Tony.


P.S. Before compiling Vim (with "make" at top level) I source the  
following (sourcing with "source" or ".", not running by  
straightforward invocation) in bash:


export CONF_OPT_GUI='--enable-gnome-check'
export CONF_OPT_PERL='--enable-perlinterp'
export CONF_OPT_PYTHON='--enable-pythoninterp'
export CONF_OPT_TCL='--enable-tclinterp --with-tcl=tclsh8.4'
export CONF_OPT_RUBY='--enable-rubyinterp'
export CONF_OPT_MZSCHEME='--enable-mzschemeinterp'
export CONF_OPT_CSCOPE='--enable-cscope'
export CONF_OPT_MULTIBYTE='--enable-multibyte'
export CONF_OPT_FEAT='--with-features=huge'
export CONF_OPT_COMPBY='"--with- 
[EMAIL PROTECTED]"'



Best regards,
Tony.





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-


netrw woes

2007-01-09 Thread Guido Van Hoecke

Hi,

:h netrw-a describes how one can hide certain files. It gives \.obj
as example of a file mask that can be used. I want to browse my
thunderbird mail directory, but ignore the msf files. So I use the 
map to enter \.msf as mask of files to be hidden.

So the normal list (only the top most lines to illustrate my problem) reads:
" 
" Netrw Directory Listing(netrw v98)
"   /home/guivho/.mozilla-thunderbird/thunderbird/Mail/localhost-4
"   Sorted by  name
"   Sort sequence: [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
"   Quick Help: :help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" 
../
./
zzarchive.sbd/
0family
0family.msf
1peter
1peter.msf
2idc
2idc.msf
3humor
3humor.msf
4known
4known.msf

Now I enter 'a' and see:
" 
" Netrw Directory Listing(netrw v98)
"   /home/guivho/.mozilla-thunderbird/thunderbird/Mail/localhost-4
"   Sorted by  name
"   Sort sequence: [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
"   Hiding:\.msf
"   Quick Help: :help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" 
../
./
zzarchive.sbd/
0family
0family.msf
1peter
1peter.msf
2idc
2idc.msf
3humor
3humor.msf
4known
4known.msf

It says that it is hiding \.msf, but still lists those files.

When I enter 'a' again, I see:" 


" Netrw Directory Listing(netrw v98)
"   /home/guivho/.mozilla-thunderbird/thunderbird/Mail/localhost-4
"   Sorted by  name
"   Sort sequence: [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
"   Showing:   \.msf
"   Quick Help: :help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" 

At least it is consistent. It behaves as if no file matches the \.msf
pattern, so it doesn't hide any file if told to hide them, and does not
show any if requested to show them.

I have tried all kinds of variations, such as *\.msf, *\.msf$ \.msf$ and
.msf but have not been able to hide the msf files.

I realised that v98 is an old one, it came with the default install of my
vim 7 with patches 1-35. So I got netrw v107 and sourced it with :so%

Something was rotten in the state of Denmark: it produced files
ending on ?[[[1

~$ ls -l .vim/plugin/net*
-rw-r--r-- 1 guivho guivho 8528 2007-01-09 19:43 
.vim/plugin/netrwPlugin.vim?[[[1
~$ ls -l .vim/autoload/net*
-rw-r--r-- 1 guivho guivho  10226 2007-01-09 19:43 
.vim/autoload/netrwFileHandlers.vim?[[[1
-rw-r--r-- 1 guivho guivho   7094 2007-01-09 19:43 
.vim/autoload/netrwSettings.vim?[[[1
-rw-r--r-- 1 guivho guivho 190182 2007-01-09 19:43 .vim/autoload/netrw.vim?[[[1
~$ ls -l .vim/doc/pi_net*
-rw-r--r-- 1 guivho guivho 89232 2007-01-09 19:43 .vim/doc/pi_netrw.txt?[[[1
~$ 


So I was stuck with v98 and without hiding capability.
So I assumed that this [[[ problem was caused by an old version of vimball.

I installed the latest vimball (version 21 dd 2007-01-03), manually
removed the ?[[[1 files and sourced netrw.vba.gz with the latest
vimball. This produced a normal txt file in the doc directory, and vim
files in the plugin and autoload directory.

The result was even worse. When I entered ':e .' it bluntly stated: '
"guivho" is a directory'
which is right, it is my home directory. But it does not list anything.
It even does not show the netrw = header block.

Luckily, I was able to get v98 to work again by removing the netrw files
from my .vim directory.

I am sorry that I this does report two problems in one mail:
1) hiding does not work for me (not with v98)
2) the latest (v107) netrw does not work at all

--
http://vanhoecke.org ... and go2 places!


Re: Reformat in visual area - vmap question

2007-01-09 Thread Yegappan Lakshmanan

Hi,

On 1/9/07, John Cordes <[EMAIL PROTECTED]> wrote:


 I have *very* little experience writing 'map' commands for my
.vimrc (Linux). For some years I've had the following two
commands for reformatting with the par utility.


..


  I never encountered "" before; I have just read :h
on  but don't seem to be much wiser :(



You can read the following tutorial on mapping keys in Vim:

http://www.geocities.com/yegappan/vim_keymap.html

- Yegappan


Re: compile options

2007-01-09 Thread A.J.Mechelynck

striker wrote:
Thanks Tony!  I found that info. on your page 
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm.   That is 
why I got as far as I did the first time.
I haven't been able to get gui to work yet.  I use --enable-carbon-check 
as the CONF_OPT_GUI.


Shouldn't it rather be either defaulted, or --enable-gui=carbon ? I'm not sure.


I have encoding set to utf-8.
I have the pre-compiled .dmg file for Mac OS X.  In that version I there 
are quite a few digraphs and I use many of them.
On the version that I compile there is still a very limited number of 
digraphs.

Everything else that I have tried so far seems to be working correctly.

Questions:
Can anyone tell me where to find options for GUI on Mac OS X or if it 
should be something other than carbon?


How can I enable the full set of digraphs?

TIA,
Kevin


Most options are mentioned in src/Makefile. You may want to search that file 
for --enable or --disable


If your ":version" info includes both +digraphs and +multi_byte (or 
+multi_byte_ime with or without /dyn), then you should have all digraphs 
available. With +digraphs and -multi-byte you get only the Latin1 digraphs 
IIUC. With -digraphs there are of course no digraphs at all.


Best regards,
Tony.


Re: Formatting an all uppercase message

2007-01-09 Thread A.J.Mechelynck

Brian McKee wrote:

-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



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.


Best regards,
Tony.


Re: netrw woes

2007-01-09 Thread Bill McCarthy
On Tue 9-Jan-07 1:33pm -0600, Guido Van Hoecke wrote:

> I realised that v98 is an old one, it came with the default install of my
> vim 7 with patches 1-35. So I got netrw v107 and sourced it with :so%

Indeed you are out of date.  I was using netrw 108b until,
apparently, yesterday when I updated my runtime files from
FTP - that downgraded me to netrw 107.

I tested with 107 then restored 108b and tested again.  I'm
currently running vim/gvim 7.0.182 (patches 179-182 were
made available today).  You can update your source files
from cvs (already at 182) or svn (at 178 but usually updates
each evening - it is quite nice).

But these only update source - you still need to update the
runtime files from FTP - others have posted automatic
updating scripts for 'nix and I've posted one for 4nt.

Your problems with vimballs is likely due to not updating
vimball - it's at version 21 on both the FTP site and Dr
Chip's site.

I can't confirm you problem with netrw, although I have
found a small inconsistency.

The first time I use ctrl-h, the "a" map mode is switched to
Hidden.  Any subsequent ctrl-h, does not change the mode.  I
think it would be more intuitive to change the mode from
normal to hidden, but leave the mode alone if already on
hidden or show.

-- 
Best regards,
Bill



Re: netrw woes

2007-01-09 Thread A.J.Mechelynck

Guido Van Hoecke wrote:

Hi,

:h netrw-a describes how one can hide certain files. It gives \.obj
as example of a file mask that can be used. I want to browse my
thunderbird mail directory, but ignore the msf files. So I use the 
map to enter \.msf as mask of files to be hidden.

So the normal list (only the top most lines to illustrate my problem) 
reads:
" 
 

" Netrw Directory Listing(netrw 
v98)

"   /home/guivho/.mozilla-thunderbird/thunderbird/Mail/localhost-4
"   Sorted by  name
"   Sort sequence: [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
"   Quick Help: :help  -:go up dir  D:delete  R:rename  s:sort-by  
x:exec
" 
 


../
./
zzarchive.sbd/
0family
0family.msf
1peter
1peter.msf
2idc
2idc.msf
3humor
3humor.msf
4known
4known.msf

Now I enter 'a' and see:
" 
 

" Netrw Directory Listing(netrw 
v98)

"   /home/guivho/.mozilla-thunderbird/thunderbird/Mail/localhost-4
"   Sorted by  name
"   Sort sequence: [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
"   Hiding:\.msf
"   Quick Help: :help  -:go up dir  D:delete  R:rename  s:sort-by  
x:exec
" 
 


../
./
zzarchive.sbd/
0family
0family.msf
1peter
1peter.msf
2idc
2idc.msf
3humor
3humor.msf
4known
4known.msf

It says that it is hiding \.msf, but still lists those files.

When I enter 'a' again, I see:" 
 

" Netrw Directory Listing(netrw 
v98)

"   /home/guivho/.mozilla-thunderbird/thunderbird/Mail/localhost-4
"   Sorted by  name
"   Sort sequence: [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
"   Showing:   \.msf
"   Quick Help: :help  -:go up dir  D:delete  R:rename  s:sort-by  
x:exec
" 
 



At least it is consistent. It behaves as if no file matches the \.msf
pattern, so it doesn't hide any file if told to hide them, and does not
show any if requested to show them.

I have tried all kinds of variations, such as *\.msf, *\.msf$ \.msf$ and
.msf but have not been able to hide the msf files.

I realised that v98 is an old one, it came with the default install of my
vim 7 with patches 1-35. So I got netrw v107 and sourced it with :so%

Something was rotten in the state of Denmark: it produced files
ending on ?[[[1

~$ ls -l .vim/plugin/net*
-rw-r--r-- 1 guivho guivho 8528 2007-01-09 19:43 
.vim/plugin/netrwPlugin.vim?[[[1

~$ ls -l .vim/autoload/net*
-rw-r--r-- 1 guivho guivho  10226 2007-01-09 19:43 
.vim/autoload/netrwFileHandlers.vim?[[[1
-rw-r--r-- 1 guivho guivho   7094 2007-01-09 19:43 
.vim/autoload/netrwSettings.vim?[[[1
-rw-r--r-- 1 guivho guivho 190182 2007-01-09 19:43 
.vim/autoload/netrw.vim?[[[1

~$ ls -l .vim/doc/pi_net*
-rw-r--r-- 1 guivho guivho 89232 2007-01-09 19:43 
.vim/doc/pi_netrw.txt?[[[1

~$
So I was stuck with v98 and without hiding capability.
So I assumed that this [[[ problem was caused by an old version of vimball.

I installed the latest vimball (version 21 dd 2007-01-03), manually
removed the ?[[[1 files and sourced netrw.vba.gz with the latest
vimball. This produced a normal txt file in the doc directory, and vim
files in the plugin and autoload directory.

The result was even worse. When I entered ':e .' it bluntly stated: '
"guivho" is a directory'
which is right, it is my home directory. But it does not list anything.
It even does not show the netrw = header block.

Luckily, I was able to get v98 to work again by removing the netrw files
from my .vim directory.

I am sorry that I this does report two problems in one mail:
1) hiding does not work for me (not with v98)
2) the latest (v107) netrw does not work at all

--
http://vanhoecke.org ... and go2 places!



There has recently been an important update of runtime files on the website. 
This includes netrw v107, which works for me. Since you are on X11 (I assume 
Unix/Linux or similar), you can install them as follows (start in your "build" 
directory, the parent of runtime/ and src/ if you compile your own Vim)


rsync -avzcP --delete --exclude="/dos/" ftp.nluug.nl::Vim/runtime/ 
./runtime/
cd src
make installruntime

(I intentionally indented them so any spurious linebreak added by my mailer or 
yours will be obvious). Of course, you may optionally log the rsync and/or the 
make by redirecting their output.


The above is if you don't recompile Vim now. Or you may also (a) install the 
latest patches (to 7.0.182), (b) run rsync but not installruntime, and then 
(c) "make" followed by "make install".


Then check your $VIM/vimfiles and ~/.vim director

syntax for vcard/vcf files

2007-01-09 Thread Friedrich Strohmaier
Hello everybody,
A happy new year to all vimmers. :o)

I am looking for a syntax highlighting file for vcard/vcf files.
Nor $searchengine nor vim.org could give me advice.

Does somebody know about syntax highlighting for vcard/vcf files?

Friedrich



Folding to produce a high-level index of code

2007-01-09 Thread Noah Spurrier

I have folding set to use expr. I have a foldexpr that
identifies lines for functions and classes in PHP.
Lines that are part of a function are folded.
Function definition lines are NOT folded.
This gives me a single level of folding that works like
an index to my code. This works great.

Is it possible to have an open fold include a few lines BEFORE the
beginning of the fold? For example, it's common in PHP to have a
phpdoc comment before the function definition.
When all folds are closed I see just a list of function names.
When I open a fold I see the entire body of the function, but
I don't see the comment before the function.

I'm sure I could get the fold expression to work so that it starts the
fold on the comment BEFORE the function definition, but then when I closed
the fold I would not see the function name.

Perhaps I could set the fold to start at the comment before the
function definition and set the 'foldtext' to be the
text of the line with the function definition. I shall mull that over.
In the mean time, if anyone has any suggestions or has already done
this then please let me know.

So when I have all folds closed I see my code like this:

function reverse_zipcode ($zipcode)
+-- 10 lines: {
function get_inventory ()
+-- 28 lines: {
function delete_inventory ()
+--  5 lines: {
function touch_sql ($sql)
+-- 21 lines: {
function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
+-- 20 lines: {-

If I wanted to view "delete_inventory" I would click on the + to open
the fold to see something like this (note how the comment BEFORE
the function is also show):

function reverse_zipcode ($zipcode)
+-- 10 lines: {
function get_inventory ()
+-- 28 lines: {
/**
 * This deletes unqualified inventory from t_inventory.
 * The table "inv_delete" is used to find unqualified inventory
 * scheduled for deletion.
 * @see function create_inv_delete
 */
function delete_inventory ()
{
$sql = "DELETE inventory FROM inventory, inv_delete WHERE
inventory.inventory_id=inv_delete.inventory_id;";
touch_sql ($sql);
}
function touch_sql ($sql)
+-- 21 lines: {
function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
+-- 20 lines: {-

Currently, the best I can do is to show everything below the fold.
This is nice, but the documentation comment remains hidden, like this:

function reverse_zipcode ($zipcode)
+-- 10 lines: {
function get_inventory ()
+-- 28 lines: {
function delete_inventory ()
{
$sql = "DELETE inventory FROM inventory, inv_delete WHERE
inventory.inventory_id=inv_delete.inventory_id;";
touch_sql ($sql);
}
function touch_sql ($sql)
+-- 21 lines: {
function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
+-- 20 lines: {-

Yours,
Noah




Re: :sort by date

2007-01-09 Thread Arun Easi

On Tue, 9 Jan 2007, Bill McCarthy wrote:


On Tue 9-Jan-07 4:11am -0600, Vigil wrote:


This works on my admittedly small test set:

:%!sort -k3 -t/



You're making several unstated assumptions.

(1) The records are already sorted by month and day.



I would have thought that, too, but sorting this:

01/04/2007 blah
01/03/2007 blah
12/30/2006 blah
07/05/2003 blah
02/04/2007 blah
02/04/2006 blah
14/32/1996 blah
02/04/1996 blah

give this:

02/04/1996 blah
14/32/1996 blah
07/05/2003 blah
02/04/2006 blah
12/30/2006 blah
01/03/2007 blah
01/04/2007 blah
02/04/2007 blah

which, as you can see, has sorted by month and day, too,
or is that just happenstance?


I had assumed the latter - but read on.


(3) Everything to the right of the year is the same in each
   record.



Ah, I see why. My example sorts beginning at that column, not just on that
column alone.


I thought I knew the unix sort utility fairly well.  I'm a
bit baffled.

I wrote a simple program to generate 1,000 records with just
random dates (month 1-12, day 1-30, year 1976-2007).

Sorting with:

   :%!sort -t/ -k3
and
   :%!sort -t/ -k3.1n,3.4 -k1n,2

produced identical correct results!


arun> Lines with same 3rd field are sorted lexicographically. So, if you 
have MM/DD/ format, that should be good. If you have DD/MM/, it 
cannot be (Try adding 31/11/1996 and 01/12/1996).




I then modified my program to add a comma and a random
letter.  Of course, your method failed since your 3rd field
includes the trailing 2 characters.

But modifying your method to:

   :%!sort -t/ -k3n

worked perfectly 


arun> Again, because of the lexicographic sort of the column for identical 
years. Replace "02/04/1996" with "2/04/1996" and see the difference.


regards,
-Arun



BTW, I'm using: sort (GNU coreutils) 5.3.0
on Windows XP.  I know this discussion is a bit off topic
but I have found it fascinating.  Thanks, Vigil, for bring
it up.

--
Best regards,
Bill



Re: Folding to produce a high-level index of code

2007-01-09 Thread Peter Hodge
Hello,

Try this script:

http://www.vim.org/scripts/script.php?script_id=1623

regards,
Peter



--- Noah Spurrier <[EMAIL PROTECTED]> wrote:

> 
> I have folding set to use expr. I have a foldexpr that
> identifies lines for functions and classes in PHP.
> Lines that are part of a function are folded.
> Function definition lines are NOT folded.
> This gives me a single level of folding that works like
> an index to my code. This works great.
> 
> Is it possible to have an open fold include a few lines BEFORE the
> beginning of the fold? For example, it's common in PHP to have a
> phpdoc comment before the function definition.
> When all folds are closed I see just a list of function names.
> When I open a fold I see the entire body of the function, but
> I don't see the comment before the function.
> 
> I'm sure I could get the fold expression to work so that it starts the
> fold on the comment BEFORE the function definition, but then when I closed
> the fold I would not see the function name.
> 
> Perhaps I could set the fold to start at the comment before the
> function definition and set the 'foldtext' to be the
> text of the line with the function definition. I shall mull that over.
> In the mean time, if anyone has any suggestions or has already done
> this then please let me know.
> 
> So when I have all folds closed I see my code like this:
> 
> function reverse_zipcode ($zipcode)
> +-- 10 lines: {
> function get_inventory ()
> +-- 28 lines: {
> function delete_inventory ()
> +--  5 lines: {
> function touch_sql ($sql)
> +-- 21 lines: {
> function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
> +-- 20 lines: {-
> 
> If I wanted to view "delete_inventory" I would click on the + to open
> the fold to see something like this (note how the comment BEFORE
> the function is also show):
> 
> function reverse_zipcode ($zipcode)
> +-- 10 lines: {
> function get_inventory ()
> +-- 28 lines: {
> /**
>  * This deletes unqualified inventory from t_inventory.
>  * The table "inv_delete" is used to find unqualified inventory
>  * scheduled for deletion.
>  * @see function create_inv_delete
>  */
> function delete_inventory ()
> {
> $sql = "DELETE inventory FROM inventory, inv_delete WHERE
> inventory.inventory_id=inv_delete.inventory_id;";
> touch_sql ($sql);
> }
> function touch_sql ($sql)
> +-- 21 lines: {
> function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
> +-- 20 lines: {-
> 
> Currently, the best I can do is to show everything below the fold.
> This is nice, but the documentation comment remains hidden, like this:
> 
> function reverse_zipcode ($zipcode)
> +-- 10 lines: {
> function get_inventory ()
> +-- 28 lines: {
> function delete_inventory ()
> {
> $sql = "DELETE inventory FROM inventory, inv_delete WHERE
> inventory.inventory_id=inv_delete.inventory_id;";
> touch_sql ($sql);
> }
> function touch_sql ($sql)
> +-- 21 lines: {
> function see_sql ($sql,$fetch_mode=DB_FETCHMODE_OBJECT)
> +-- 20 lines: {-
> 
> Yours,
> Noah
> 
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com 


recent.vim plugin

2007-01-09 Thread Ilia N Ternovich
Hi all!

I'm trying to make recent.vim plguin working with vim-7.0
There is some kind of problem with mapping keys inside plugin:

function! OptionFiles()
"let file = bufname("%")
if bufname("")=="recent_files"
map  gf
set number
set noswapfile
else
set nonumber
set swapfile
   if hasmapto('gf')
unmap gf
   endif
endif
endfunction

command Recent edit ~/.vim/recent_files
autocmd BufEnter * :call OptionFiles()

I wonder why this function doesn't map Enter key to "gf" combination, when
I start vim... There is succesfully created "recent_files" buffer... But
keybinding doesn't work :(

Can anybody help me with this question

-- 
God bless you!
Ilia

2.6.18-gentoo-r4 AMD Athlon(tm) XP 2600+

mailto: [EMAIL PROTECTED]
icq: 198233378

VegaTrek Developer: http://wcuniverse.sourceforge.net/vegatrek/
VegaTrek Forum Moderator:
http://vegastrike.sourceforge.net/forums/viewforum.php?f=13

Q: What is more fun than stapling kittens to the wall?

A: Tearing them off!

-- Thalion

$gpg --keyserver cryptonomicon.mit.edu --search-keys tillias