Re: minor feature request: let!

2006-07-09 Thread Bram Moolenaar

Justin Constantino wrote:

 Currently, if you try to assign a value to a variable with a different
 type, you get:
 
 E706: Variable type mismatch
 
 To make it work, you have to first unlet the variable, which is kind
 of annoying if the expression you are assigning references that
 variable.  For example, to split a string in-place, you have to do:
 
 let foo = one,two,three
 let temp = split(foo, ',')
 unlet foo
 let foo = temp
 unlet temp
 
 As a minor improvement, I think it would be nice if you could do:
 
 let foo = one,two,three
 let! foo = split(foo, ',')

Suppose someone asks you what the foo variable is for, what are you
going answer?

The point is: let the variable name reflect what it contains, don't
re-use the same variable for something else.  That way your code will be
a lot more readable.

 let fooline  = one,two,three
 let foowords = split(fooline, ',')

-- 
For large projects, Team Leaders use sophisticated project management software
to keep track of who's doing what.  The software collects the lies and guesses
of the project team and organizes them in to instantly outdated charts that
are too boring to look at closely.  This is called planning.
(Scott Adams - The Dilbert principle)

 /// 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: Terminal-based auto-paste.

2006-07-09 Thread Sean Reifschneider
On Sat, Jul 08, 2006 at 11:57:48PM +0200, Pierre Habouzit wrote:
'*' works iff your vim is linked against X.
same is true for shift right mouse button.

The ideal solution for me would be to detect more than X characters
received during the last, say, 100ms, and turn on paste then.

However, I have rebuilt the Fedora Core 6 test 1 RPMs --with-x=yes, and
that's a workable solution.  It's still annoying how clicking and selecting
text causes vim to move my cursor around and requires me to press escape
when I'm done selecting.  But I can try to remember to shift-select, which
works as I'd like.  A pain, but workable and gives me proper pasting.

I've submitted a but against FC6 core suggesting that they either build the
non-gvim version with X enabled, or provide a third option in the vim-x11
package like xvim, which is text mode but with X enabled.

what you are searching for is :
:he pastetoggle

Not really, but thanks for the pointer.  I'm not much of a key mapping
person.  Typing :set paste or :set nopaste is no terrible burden, so
that's what I used to do when I had to paste indented text.

Thanks,
Sean
-- 
 Having computers is a lot like having kids, except it's not as much of a
 problem if they die while you're away.  -- Sean Reifschneider, 1997
Sean Reifschneider, Member of Technical Staff [EMAIL PROTECTED]
tummy.com, ltd. - Linux Consulting since 1995: Ask me about High Availability