Re: Only curiosity: Optimizing a vimtip (modified)

2006-10-24 Thread Dave Roberts

Meino Christian Cramer wrote:

Hi,

 I read of a vimtip, that one can move/copy lines of a text which
 match a cvertina pattern to line 0 (top) of the text.

 This is a nice trick to gather material for a kinda quick'n'dirty
 Table of contents it has one drwaback: The copied lines are in
 reversed order.

 Surely it is possible to write a fairly simple function with a
 counter, which keeps track to what line something is copied. 


 But it would be interesting whether it is possible to achieve this
 with more condensed tricks without writing a function in
 beforehand.

 Thank you very much for any idea/hack/trick in advance!
 
 Keep hacking!

 mcc

  


You could use the reverse lines trick to reorder the copied lines. Use 
the following to put the lines at the top of the file:

:let cnt=0|g/(regexp)/copy 0|let cnt=cnt+1

Then re-reverse the copied lines at the top of the file:
:exe 1,.cnt.g/^/m0

Easy enough to put that into a function passing the 'regexp' to it...

- Dave


Win32 vim.exe blows up reading from stdin

2006-10-12 Thread Dave Roberts

Hello all,

Somewhere between v7.0.118 and v7.0.131 Vim started blowing up when 
started with a - to read from stdin. Ex. vim -u NONE -


If no one else is having this problem I'll supply more 
compile/environment info.


I use gvim as a less program all the time so I know this wasn't 
happening earlier.


Thanks,

- Dave