Re[2]: Need help about 3 questions

2006-10-23 Thread Raymond
Hello Bill, 

> 
> I don't use UTL.vim or Total Commander, so I can't help you.
> 
> However, *.vba are vimballs (kind of like tarballs).  All
> you do is edit one and it tells you what to do - type:
> 
> :so %
> 
> That will place the files in the appropriate directories
> (usually under your vimfiles subdirectory).  The actual
> place is the first directory of 'rtp' (type :set rtp?).
> 
> You should have a recent version of the vimball plugin (the
> one in the distribution is about 5 months old).  You can the
> latest at the author's site:
> 
> http://mysite.verizon.net/astronaut/vim
> 
> or at vim online:
> 
> http://vim.sf.net
> 
> An even better approach for updating you runtime files is to
> update from the vim ftp site.  For windows, and using 4nt as
> your shell, the command is:
> 
> copy /[!*~] /u /s "ftp://ftp.home.vim.org/pub/vim/runtime/dos/*"; 
> c:\vim\vim70\
> 
> That's all on one line.  It copies all new or newer files
> for all subdirectories excluding files ending with '~'.
> c:\vim\vim70 is my runtime directory - replace it with
> yours.
> 
Sorry for my late reply due to network problem here yesterday.
This problem solved. Thanks for your help.

PS:
About my question 3, maybe I should ask:
How can I adjust vimrc configuration so tab alignment looks
the same both in Vim and in Notepad?

Best Regards,
Raymond



Re[2]: Need help about 3 questions

2006-10-23 Thread Raymond
Hello Bill, 

> 
> I don't use UTL.vim or Total Commander, so I can't help you.
> 
> However, *.vba are vimballs (kind of like tarballs).  All
> you do is edit one and it tells you what to do - type:
> 
> :so %
> 
> That will place the files in the appropriate directories
> (usually under your vimfiles subdirectory).  The actual
> place is the first directory of 'rtp' (type :set rtp?).
> 
> You should have a recent version of the vimball plugin (the
> one in the distribution is about 5 months old).  You can the
> latest at the author's site:
> 
> http://mysite.verizon.net/astronaut/vim
> 
> or at vim online:
> 
> http://vim.sf.net
> 
> An even better approach for updating you runtime files is to
> update from the vim ftp site.  For windows, and using 4nt as
> your shell, the command is:
> 
> copy /[!*~] /u /s "ftp://ftp.home.vim.org/pub/vim/runtime/dos/*"; 
> c:\vim\vim70\
> 
> That's all on one line.  It copies all new or newer files
> for all subdirectories excluding files ending with '~'.
> c:\vim\vim70 is my runtime directory - replace it with
> yours.
> 
Sorry for my late reply due to network problem here yesterday.
This problem solved. Thanks for your help.

PS:
About my question 3, maybe I should ask:
How can I adjust vimrc configuration so tab alignment looks
the same both in Vim and in Notepad?

Best Regards,
Raymond



Re: Bug: CursorHoldI not triggered after startinsert

2006-10-23 Thread Hari Krishna Dara

On Mon, 23 Oct 2006 at 9:25pm, Bram Moolenaar wrote:

>
> Hari Krishna Dara wrote:
>
> > I am using :startinsert! from my plugin to put the user in insert mode,
> > but if the user doesn't type anything for 'updatetime' after this, no
> > CursorHoldI event is generated. I tried doing an explicit :doauto right
> > after :startinsert!, but Vim ignores it, probably because the command
> > only schedules for an insert mode (doesn't immediate change it).
> >
> > Note that the CursorMovedI gets triggered correctly in this case, but I
> > don't want to use that as I don't want to know about every character
> > that user types, but only when the user is holding.
> >
> > Any suggestions for a workaround?
> >
> > I have Vim7 upto the patch 146.
>
> It works just fine for me.  After typing "i" and waiting a little while
> the CursorHoldI event is triggered.  I used this:
>
>   au! CursorHoldI * echomsg 'hi' | sleep 2
>

You are right, I had an internal flag getting set unexpectedly that was
resulting in getting the event ignored. Sorry about that.

-- 
Thanks,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Only curiosity: Optimizing a vimtip (modified)

2006-10-23 Thread Meino Christian Cramer
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



Re: GNU Screen and Vim

2006-10-23 Thread A.J.Mechelynck

Fabien Meghazi wrote:

I uses screen under rxvt-unicode, in my .vimrc, I map the Shift-Up key
combination like this:
noremap ^[[a zc
As soon as I'm under screen it doesn't work anymore.


Found the reason why my keymapping doesn't work with vim under screen.
I guess vim interprets the escape sequence differently according to
the TERM's environment variable and in my case it's "screen".
If I do export TERM=rxvt under screen then the key binding is ok with vim

What makes vim reacting differently between TERM=rxvt and TERM=screen ?
Is there a way to make things work properly or should I export
TERM=rxvt each time I run screen  ?



Different terminals may represent the same key differently. If using

:noremapzc

(with , not [a ) doesn't work, then it could that mean your termcap 
is broken, or that your $TERM is not properly set.


If _all_ keys are recognised properly if you set $TERM to 'rxvt' under screen 
then a possibility would be


if &term == "screen"
set term=rxvt
endif

unless there are other consoles, with other termcaps, which can be used 
through screen, in which case you must make sure that screen does not set 
$TERM to 'screen' regardless of what actual console it runs in, but instead 
leaves that variable set at whatever it was set before.



Best regards,
Tony.


Re: Changing omnicomplete lifetime?

2006-10-23 Thread Bill Mill

On 10/23/06, Mikolaj Machowski <[EMAIL PROTECTED]> wrote:

Dnia poniedziałek, 23 października 2006 15:18, Bill Mill napisał:
> How would you recommend getting this to work? Should I try and edit
> supertab? Is there an easy way to change it?

Maybe try to change 'completeopt' value. longest option?



I already have that set.

Thanks
Bill Mill
bill.mill at gmail.com


Re: Changing omnicomplete lifetime?

2006-10-23 Thread Mikolaj Machowski
Dnia poniedziałek, 23 października 2006 15:18, Bill Mill napisał:
> How would you recommend getting this to work? Should I try and edit
> supertab? Is there an easy way to change it?

Maybe try to change 'completeopt' value. longest option?

m.



BUG: mksession saves lcd in incorrect place

2006-10-23 Thread Marius Roets
Hi everybody,

I believe I have found a bug in Vim 7.0.146, relating to mksession and
lcd. Here is a small example. 
1) Open Vim
2) :e file1.txt
3) :tabe temp/file2.txt "Any different directory
4) :lcd %:h
5) :mks test.vim
6) Close vim
7) Open vim
8) :source test.vim
9) The second tab is empty. The reason is that in the file test.vim the
order of events are (ignoring the uninteresting stuff):
 - cd where-ever-file1-is
 - edit file1.txt
 - tabnew
 - edit file2.txt
 - lcd where-ever-file2-is/

So even the second tab contains the correct lcd, the files opened in the
wrong directory. 

To manually fix the problem in the test.vim file:
/^lcd/
dd
/^edit file2/
P
:wq

Alternatively, the full path should be used to open file2.txt

Regards
Marius



Re: missing setbufline()?

2006-10-23 Thread Bram Moolenaar

Yegappan Lakshmanan wrote:

> On 10/22/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:
> > > On 10/22/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I see functions for creating new unlisted buffers (bufnr() with {create}
> > > > option), and for reading the lines from the buffer using getbufline(),
> > > > all without having to change the current buffer, but I don't see a
> > > > setbufline() so there is no way to set the lines without having to
> > > > switch to it. Is there a reason to leave this circle incomplete?
> > > >
> > >
> > > Yes. I had a patch for the setbufline() function last year. There were
> > > several problems with it. So it was not included in Vim7 and only
> > > the getbufline() function was included.
> > >
> > > The setbufline() function worked only for loaded buffers. The undo
> > > history was not updated correctly.
> > >
> > > But I agree that it will be good to have the setbufline() function.
> > >
> > > - Yegappan
> >
> > Nice, so it will be included at some point after resolving these issues.
> >
> 
> You can try the attached patch against the latest Vim7 sources.
> The syntax of the new function is:
> 
> setbufline({expr}, {lnum}, {line})
> 
> where, {expr} specifies the loaded buffer name/number, {lnum} specifies
> a valid line number in that buffer and {line} is either a single line
> or a List of lines.
> 
> Note. The patch also includes the new gettabvar() and settabvar()
> functions.

It looks like after this patch, if you change lines in another buffer
some marks in the current window will be moved.  Especially the
jumplist, perhaps setting cmdmod.lockmarks would help.  The '< and '>
marks are probably moved.  Manual folds might be moved.  There may also
be redrawing problems.

This needs a test in src/testdir.  And documentation, of course.

I'm very careful with including something like this.  Currently there is
no code that changes another buffer.  It could break more than you
expect.

-- 
The primary purpose of the DATA statement is to give names to constants;
instead of referring to pi as 3.141592653589793 at every appearance, the
variable PI can be given that value with a DATA statement and used instead
of the longer form of the constant.  This also simplifies modifying the
program, should the value of pi change.
-- FORTRAN manual for Xerox Computers

 /// 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: Bug: CursorHoldI not triggered after startinsert

2006-10-23 Thread Bram Moolenaar

Hari Krishna Dara wrote:

> I am using :startinsert! from my plugin to put the user in insert mode,
> but if the user doesn't type anything for 'updatetime' after this, no
> CursorHoldI event is generated. I tried doing an explicit :doauto right
> after :startinsert!, but Vim ignores it, probably because the command
> only schedules for an insert mode (doesn't immediate change it).
> 
> Note that the CursorMovedI gets triggered correctly in this case, but I
> don't want to use that as I don't want to know about every character
> that user types, but only when the user is holding.
> 
> Any suggestions for a workaround?
> 
> I have Vim7 upto the patch 146.

It works just fine for me.  After typing "i" and waiting a little while
the CursorHoldI event is triggered.  I used this:

au! CursorHoldI * echomsg 'hi' | sleep 2

-- 
I AM THANKFUL...
...for the clothes that fit a little too snug because it
means I have more than enough to eat.

 /// 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: missing setbufline()?

2006-10-23 Thread Yegappan Lakshmanan

Hi Hari,

On 10/22/06, Yegappan Lakshmanan <[EMAIL PROTECTED]> wrote:

Hi Hari,

On 10/22/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:
> > On 10/22/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:
> > >
> > > I see functions for creating new unlisted buffers (bufnr() with {create}
> > > option), and for reading the lines from the buffer using getbufline(),
> > > all without having to change the current buffer, but I don't see a
> > > setbufline() so there is no way to set the lines without having to
> > > switch to it. Is there a reason to leave this circle incomplete?
> > >
> >
> > Yes. I had a patch for the setbufline() function last year. There were
> > several problems with it. So it was not included in Vim7 and only
> > the getbufline() function was included.
> >
> > The setbufline() function worked only for loaded buffers. The undo
> > history was not updated correctly.
> >
> > But I agree that it will be good to have the setbufline() function.
> >
> > - Yegappan
>
> Nice, so it will be included at some point after resolving these issues.
>

You can try the attached patch against the latest Vim7 sources.



With this patch you should not see the above mentioned problems
with undo. Let me know if you see any other problems in using
the setbufline() function with this patch. If there are no problems,
then I will send this to Bram for inclusion in a future Vim release.

- Yegappan


The syntax of the new function is:

setbufline({expr}, {lnum}, {line})

where, {expr} specifies the loaded buffer name/number, {lnum} specifies
a valid line number in that buffer and {line} is either a single line
or a List of lines.

Note. The patch also includes the new gettabvar() and settabvar()
functions.

- Yegappan


Re: GNU Screen and Vim

2006-10-23 Thread Fabien Meghazi

I uses screen under rxvt-unicode, in my .vimrc, I map the Shift-Up key
combination like this:
noremap ^[[a zc
As soon as I'm under screen it doesn't work anymore.


Found the reason why my keymapping doesn't work with vim under screen.
I guess vim interprets the escape sequence differently according to
the TERM's environment variable and in my case it's "screen".
If I do export TERM=rxvt under screen then the key binding is ok with vim

What makes vim reacting differently between TERM=rxvt and TERM=screen ?
Is there a way to make things work properly or should I export
TERM=rxvt each time I run screen  ?


want :move to keep position

2006-10-23 Thread Yakov Lerner

How can I make :move command keep position ?
By default, it moves to the target line. I want it to remain
where I was.
I made my :M command that does it, but how do I
remap m command to behave like my M ?

Thanks
Yakov


Changing omnicomplete lifetime?

2006-10-23 Thread Bill Mill

Hello,

I love python omnicomplete for vim. However, I'd like to change its
behavior a bit in a way that I'm not sure is even possible.

When I type:

cherrypy.^x^or

, the menu pops up with cherrypy options, then gets limited to those
starting with r. However, if I follow that with a backspace, I lose my
completion menu, and I have to hit ^x^o again.

I already have omnicomplete bound to tab via supertab, I know that I
can just hit tab again, but it's not the way I'd like it to work. I'd
like the menu to be active until I backspace *past* the original
insertion point or hit esc.

How would you recommend getting this to work? Should I try and edit
supertab? Is there an easy way to change it?

Thanks
Bill Mill
bill.mill at gmail.com


Re: what are blue "signs" appearing in vimdiff panes ?

2006-10-23 Thread Jean-Rene David
* Yakov Lerner [2006.10.23 07:00]:
> If you look at lines 879-884 of the left pane,
> and lines 1583-1588 of the right pane  you can
> see blue "signs" near line numbers. What do they
> signify ?

They mean those lines are an open diff fold. 

> I just did "vimdiff" and no special options.
> What do they mean, those spooky "signs", in the
> middle of no-difference region ?

Precisely that there are no differences in that
region, which is why it can be safely folded away
by the "fold" commands.

I notice you have the default 'context:6' in your
'diffopt', since there are 6 lines between the
delimited fold and the adjacent differences.

-- 
JR


Re: Need help about 3 questions

2006-10-23 Thread A.J.Mechelynck

Raymond wrote:
Hello all, 


I'm new to Vim, now i'm using GVim 7.0 on Windows system.
Here is my questions.


[...]


2. Now I know how to install *.vim plugin. Then I encounter VISINCR.VBA plugin 
(http://www.vim.org/scripts/script.php?script_id=670). How to install this kind 
of *.vba
plugin?


[...]

That's a "vimball". Load it into Vim, and it will tell you to source it to 
install its contents.


For more info, see ":help pi_vimball.txt".


Best regards,
Tony.


lines modified in the buffer

2006-10-23 Thread Yakov Lerner

Is there any plugin that marks with "signs" lines
modifies in the buffer  ?

Yakov


what are blue "signs" appearing in vimdiff panes ?

2006-10-23 Thread Yakov Lerner

http://xs308.xs.to/xs308/06431/screenshot.png

If you look at lines 879-884 of the left pane, and lines
1583-1588 of the right pane  you can see blue "signs"
near line numbers. What do they signify ?

I just did "vimdiff" and no special options. What do they
mean, those spooky "signs", in the middle of no-difference region ?

Yakov


Re: Quickfix behaviour

2006-10-23 Thread Marius Roets

On 10/20/06, Yegappan Lakshmanan <[EMAIL PROTECTED]> wrote:


The above problem with the quickfix window and the 'switchbuf' option
set to 'usetab' is now fixed by patch 7.0.146.

- Yegappan


This works perfectly now. Thanks a million.

Marius