Re: using filereadable function

2006-08-17 Thread A.J.Mechelynck

Jürgen Krämer wrote:

Hi,

SHANKAR R-R66203 wrote:

I am trying to use the filereadable function.

My code looks like given below (This code is part of a function) -
 
if (!filereadable("a:dataFile")

^  ^
remove the quotes.


let @/ = rs_searchString
keepjumps exec rs_ori_lineNum
echohl Todo
echomsg a:dataFile " Cannot open file for reading"
echohl NONE
return
endif

a:dataFile is the argument passed to the function, while calling the
function.
This does not seem to work.
Eventhough the file is present, the function reports, the file is not
present.


Regards,
Jürgen



Also, if your function wants to refer to variables defined outside the 
function, the variable's name should be prefixed by g: (for a global 
variable) or s: (for a script-local variable), otherwise a 
function-local variable will be assumed -- and you will get "Error: 
Undefined variable rs_searchString" and/or "Error: Invalid expression". 
Outside of any function, a variable name with no prefix refers to a 
global variable.



Best regards,
Tony.


cross-platform mappings

2006-08-17 Thread Eric Leenman

Hi,

I'm trying to expand my use of GVIM also to Linux .
And I see that my mappings with CTRL and/or ALT and/or ARROW keys are 
handled

differently on because of the linux windows manager.

Does somebody knows which keys or key-combinations to avoid to create 
mappings

that work on WXP and Linux?
Should you never use ALT and/or CTRL in cross-platform mappings?

For example:
How should I remap


noremap   b
inoremap  

noremap  w
inoremap  


" ALT <- to make from current pos till begin-of-line everything lower case
" To keep the cursor position it's prepend with mz (mark pos with z)
" and append with `z (go to mark z) (notice the backtick `[located under
" the ESC-key] is used, not a single quote sign ')
noremap   mzgu0`z
inoremap  

" ALT -> to make from current pos till eol everything lower case "
noremap  mzgu$`z
inoremap  

" ALT-SHIFT <- to make from current pos till bol everything upper case
noremap   mzgU0`z
inoremap  

"ALT-SHIFT -> to make from current pos till eol everything upper case
noremap  mzgU$`z
inoremap  



Best regards,
Eric

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




Re: cross-platform mappings

2006-08-17 Thread A.J.Mechelynck

Eric Leenman wrote:

Hi,

I'm trying to expand my use of GVIM also to Linux .
And I see that my mappings with CTRL and/or ALT and/or ARROW keys are 
handled

differently on because of the linux windows manager.

Does somebody knows which keys or key-combinations to avoid to create 
mappings

that work on WXP and Linux?
Should you never use ALT and/or CTRL in cross-platform mappings?

For example:
How should I remap

[...]

I think the safest keys to use are F2-F9, F11-F12, and Shift-F1 to 
Shift-F12 (that's 22 possibilities). (Yes, there used to be keyboards 
without F11-F12 but it's been decades since I've seen one.) F1 is of 
course Help, and F10 is the Menu key on some systems. Alt- appears as 
Esc in some terminals; and many Alt-Fn and Ctrl-Fn combinations are 
preempted by some window managers such as KDE's kwm (even with ":set 
winaltkeys=no") so that they are never seen by gvim but produce some 
other action such as "switch to virtual desktop 4" (Ctrl-F4) or "Run 
command or open URL" (Alt-F2). Printable keys and their Ctrl- variations 
are mostly already in use by Vim itself; and Alt+ printable key, when it 
isn't seen as Esc + something, can also be confused with the key for 
some printable character in the range 128-255 (accented letters etc.)


Now _which_ particular shortcut you assign to which particular function 
remains of course your own choice; and if 22 mappings aren't enough, you 
can also use one (or more) of them as a prefix for an unlimited number 
of additional multikey mappings (where all keys except the first can be 
anything, even letters and digits).



Best regards,
Tony.


_viminfo on walkabout

2006-08-17 Thread o1792
Hi,

I'm using vim7 for win32, but actually I've had the
following prob with vim6.3.

The prob is that _viminfo goes on walkabout when I'm
connected to my corp's network. It thinks it should be
stored in a networked drive, which is read-only, so I
get errors.

Probably isn't a vim problem, but may be my win32
which is telling the interface vim4win32 uses that
_viminfo should lose itself in a networked drive.

When I use the pc standalone, this problem does not
occur.

Has anybody had similar problems and sorted it out?
Advice welcome. Thanks in advance.



___ 
Copy addresses and emails from any email account to Yahoo! Mail - quick, easy 
and free. http://uk.docs.yahoo.com/trueswitch2.html


Re: _viminfo on walkabout

2006-08-17 Thread Yongwei Wu

On 8/17/06, o1792 <[EMAIL PROTECTED]> wrote:

Hi,

I'm using vim7 for win32, but actually I've had the
following prob with vim6.3.

The prob is that _viminfo goes on walkabout when I'm
connected to my corp's network. It thinks it should be
stored in a networked drive, which is read-only, so I
get errors.

Probably isn't a vim problem, but may be my win32
which is telling the interface vim4win32 uses that
_viminfo should lose itself in a networked drive.

When I use the pc standalone, this problem does not
occur.

Has anybody had similar problems and sorted it out?
Advice welcome. Thanks in advance.


Just one thought, try typing "set HOME" in a Command Prompt to check
the values of the environment variables HOME, HOMEDRIVE, and HOMEPATH.

--
Wu Yongwei
URL: http://wyw.dcweb.cn/


Re: _viminfo on walkabout

2006-08-17 Thread A.J.Mechelynck

Yongwei Wu wrote:

On 8/17/06, o1792 <[EMAIL PROTECTED]> wrote:

Hi,

I'm using vim7 for win32, but actually I've had the
following prob with vim6.3.

The prob is that _viminfo goes on walkabout when I'm
connected to my corp's network. It thinks it should be
stored in a networked drive, which is read-only, so I
get errors.

Probably isn't a vim problem, but may be my win32
which is telling the interface vim4win32 uses that
_viminfo should lose itself in a networked drive.

When I use the pc standalone, this problem does not
occur.

Has anybody had similar problems and sorted it out?
Advice welcome. Thanks in advance.


Just one thought, try typing "set HOME" in a Command Prompt to check
the values of the environment variables HOME, HOMEDRIVE, and HOMEPATH.



Also, you can tell Vim to put the viminfo at any place of your choice by 
using the "n" suboption to 'viminfo'. Beware: that suboption must be 
_last_ in 'viminfo.


Example, to write the viminfo in the root directory of the filesystem:

if has("viminfo")
if has("unix")
set viminfo='50,<1000,s100,:0,n/.viminfo
else " Windows
set viminfo='50,<1000,s100,:0,nC:\\_viminfo
endif
endif


Best regards,
Tony.


[EMAIL PROTECTED]: failure notice]

2006-08-17 Thread Tom Purl
When I send e-mail using my mail hosting company as my SMTP host, it 
gets bounced by the list.  I'm using a different SMTP host now, 
which is why I can send this message to the list.  The problem is 
that I don't have the option of using an alternate SMTP host most of 
the day, so it would be really nice if I could use my mail hosting
company (Zettai.net').

The error message below says that my mail hosting company's mail
servers are blocked by Sorbs.  I forwarded this on to their tech
support, and they said that Sorbs forces you to pay to get your name
removed from their black list, which my mail hosting company 
believes is unethical.

Is there anything that can be done by someone on this list to
re-allow e-mail from my mail hosting company?  Any help at all would
be greatly appreciated!

Tom Purl

- Forwarded message from [EMAIL PROTECTED] -

X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on theta.zettai.net
X-Spam-Report: 
*  1.0 NO_REAL_NAME From: does not include a real name
* -0.0 NO_RELAYS Informational: message was not relayed via SMTP
*  2.0 BIZ_TLD URI: Contains an URL in the BIZ top-level domain
* -1.1 BAYES_05 BODY: Bayesian spam probability is 1 to 5%
*  [score: 0.0206]
*  3.4 AWL AWL: From: address is in the auto white-list
X-Spam-Status: Yes, score=5.2 required=5.0 tests=AWL,BAYES_05,BIZ_TLD,
NO_REAL_NAME,NO_RELAYS autolearn=no version=3.1.0
X-Spam-Level: *
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: failure notice

Hi. This is the qmail-send program at a.mx.zettai.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

:
217.73.17.21 does not like recipient.
Remote host said: 554 5.7.1 Service unavailable; Client host [205.234.172.66] 
blocked using dnsbl.sorbs.net; Spam Received See: 
http://www.sorbs.net/lookup.shtml?205.234.172.66
Giving up on 217.73.17.21.

--- Below this line is a copy of the message.

Return-Path: <[EMAIL PROTECTED]>
Received: (qmail 20923 invoked by uid 80); 16 Aug 2006 16:00:02 -
Received: from 159.53.46.143
(SquirrelMail authenticated user [EMAIL PROTECTED])
by mail.zoper.com with HTTP;
Wed, 16 Aug 2006 11:00:01 -0500 (CDT)
Message-ID: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Date: Wed, 16 Aug 2006 11:00:01 -0500 (CDT)
Subject: Re: netrw Uses Single Quotes On Windows
From: "Tom Purl" <[EMAIL PROTECTED]>
To: "Charles E Campbell Jr" <[EMAIL PROTECTED]>
Cc: vim@vim.org
User-Agent: SquirrelMail/1.4.7
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal

Oh duh.  Thanks for the help!

> Tom Purl wrote:
>
>>I'm trying to use the netrw plugin with Vim 7 on Windows to edit files
>>using the scp protocol.  My scp client of choice is pscp.  ..snip..
>>
>>
> Please use a more up-to-date version of netrw.  There's one on
> vim.sf.net, and there's an even more
> up-to-date one at my website.
>
>   http://vim.sourceforge.net/scripts/script.php?script_id=1075
>   http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs , see
> "Network Oriented Reading, Writing, and Browsing".
>
> Regards,
> Chip Campbell
>
>


- End forwarded message -


Re[2]: windows unicode (iso10646-1) font for vim

2006-08-17 Thread Alan G Isaac
On Mon, 31 Jul 2006, (BST) Georg Dahn apparently wrote: 
> I personally need Latin only and use Consolas: 
> http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displaylang=en
>  
> which (IMHO) is a great font. 

"This package is only intended for licensed users of 
Microsoft Visual Studio 2005."  I'm not sure what
that means here ...
("intended for" vs. "licensed to"?)

Cheers,
Alan Isaac






comments in vimrc

2006-08-17 Thread Uri Moszkowicz

I'm in the process of updating from vim 6.3 to vim 7.0 and am having
trouble getting comments to work to support Doxygen. I add the
following line to my vimrc file (~/.vimrc):

set comments=s1:/*!,mb:\
,ex:*/,f://!,://,b:#,:%,:XCOMM,n:>,fb:-,s1:/*,mb:*,ex:*

When I run vim and ":set comments", though, I see the following:
comments=sO:* -,mO:*  ,exO:*/,s1:/*,mb:*,ex:*/,://

Some change in vim 7.0 results in changing the comments line. In the
documentation there is a hint about some file-specific comments but
the standard method of setting file specific options doesn't help
either:

autocmd BufNewFile *.cc set
comments=s1:/*!,mb:\,ex:*/,f://!,://,b:#,:%,:XCOMM,n:>,fb:-,s1:/*,mb:*,ex:*

Anyone have any idea how I can get my comment options to work correctly
again? Or some documentation that I can read about how vim 7 changed
this feature?

Thanks,
Uri



Re: [EMAIL PROTECTED]: failure notice]

2006-08-17 Thread Bram Moolenaar

Tom Purl wrote:

> When I send e-mail using my mail hosting company as my SMTP host, it 
> gets bounced by the list.  I'm using a different SMTP host now, 
> which is why I can send this message to the list.  The problem is 
> that I don't have the option of using an alternate SMTP host most of 
> the day, so it would be really nice if I could use my mail hosting
> company (Zettai.net').
> 
> The error message below says that my mail hosting company's mail
> servers are blocked by Sorbs.  I forwarded this on to their tech
> support, and they said that Sorbs forces you to pay to get your name
> removed from their black list, which my mail hosting company 
> believes is unethical.

Paying money to be removed from a blacklist?  If this is correct then
this blacklist system must immediately be removed from spam checkers.
It's like blackmail.  I actually think this would be illegal.

> Is there anything that can be done by someone on this list to
> re-allow e-mail from my mail hosting company?  Any help at all would
> be greatly appreciated!

I'll ask someone to look into this.

-- 
hundred-and-one symptoms of being an internet addict:
169. You hire a housekeeper for your home page.

 /// 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: [EMAIL PROTECTED]: failure notice]

2006-08-17 Thread Tom Purl
On Thu, Aug 17, 2006 at 11:00:01PM +0200, Bram Moolenaar wrote:

> Paying money to be removed from a blacklist?  If this is correct then
> this blacklist system must immediately be removed from spam checkers.
> It's like blackmail.  I actually think this would be illegal.

Here's the offcial response from my mail hosting service:

* http://www.zettai.net/Weblog/sorbs

Thanks a ton for the help!

Tom Purl


Re: comments in vimrc

2006-08-17 Thread Gary Johnson
On 2006-08-17, Uri Moszkowicz <[EMAIL PROTECTED]> wrote:
> I'm in the process of updating from vim 6.3 to vim 7.0 and am having
> trouble getting comments to work to support Doxygen. I add the
> following line to my vimrc file (~/.vimrc):
> 
> set comments=s1:/*!,mb:\
> ,ex:*/,f://!,://,b:#,:%,:XCOMM,n:>,fb:-,s1:/*,mb:*,ex:*
> 
> When I run vim and ":set comments", though, I see the following:
> comments=sO:* -,mO:*  ,exO:*/,s1:/*,mb:*,ex:*/,://
> 
> Some change in vim 7.0 results in changing the comments line. In the
> documentation there is a hint about some file-specific comments but
> the standard method of setting file specific options doesn't help
> either:
> 
> autocmd BufNewFile *.cc set
> comments=s1:/*!,mb:\,ex:*/,f://!,://,b:#,:%,:XCOMM,n:>,fb:-,s1:/*,mb:*,ex:*
> 
> Anyone have any idea how I can get my comment options to work correctly
> again? Or some documentation that I can read about how vim 7 changed
> this feature?

As far as I know, vim 7 did not change that feature.  I only went 
back as far as vim 6.4, but the behavior I tested was the same in 
both 6.4 and 7.

I can think of two reasons you're having this problem.  The first is 
that you put the autocommand before the "filetype plugin on" in your 
.vimrc.  Any BufNewFile or BufRead autocommands in your .vimrc need 
to be after any "filetype [...] on" commands or else their settings 
will be overridden by any setting of the same options in the 
filetype plugins.

The second is that when I execute your "set comments" command, I get 
the following error:

E525: Zero length string: 
comments=s1:/*!,mb:\,ex:*/,f://!,://,b:#,:%,:XCOMM,n:>,fb:-,s1:/*,mb:*,ex:*

When that command is executed in an autocommand, it comes and goes 
pretty quickly, so if that's the problem, you may not have seen the 
message.  After opening a new .cc file, you can execute

:message

to see if that's what happened.

I didn't look closely at your 'comments' setting, but the backslash 
immediately followed by the comma looked suspicious, so I inserted a 
space there, 

set comments=s1:/*!,mb:\ 
,ex:*/,f://!,://,b:#,:%,:XCOMM,n:>,fb:-,s1:/*,mb:*,ex:*

and the command executed without error.

One more thing:  When you're testing this, you can execute

:verbose set comments?

to see where the 'comments' option was last set.

HTH,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


use '/' to find both upper and lower case instances

2006-08-17 Thread Luke Vanderfluit
Hi.

I have a need to use '/' to find something in a file, but I wish it to ignore 
case.

So say I'm looking for 'foo' then I want to find all instances for 'foo' and 
'FOO'

Thanks.
Kind regards.
Luke


Re: use '/' to find both upper and lower case instances

2006-08-17 Thread Luke Vanderfluit
Hi Luke.

18Aug2006 @ 10:14 Luke Vanderfluit thusly spake
> Hi.
> 
> I have a need to use '/' to find something in a file, but I wish it to ignore 
> case.
> 
> So say I'm looking for 'foo' then I want to find all instances for 'foo' and 
> 'FOO'

:set ignorecase
then do your usual search.
HTH.

Kind regards.
Luke (-:

> 
> Thanks.
> Kind regards.
> Luke


Re: use '/' to find both upper and lower case instances

2006-08-17 Thread Stefan Karlsson

> I have a need to use '/' to find something in a file, but I wish it to
> ignore case.
>
> So say I'm looking for 'foo' then I want to find all instances for 'foo'
> and 'FOO'
>


Use "\c" (for instance "/\cfoo"). If you want this behavior most of the time 
you could set the 'ignorecase' option.

By the way, "\C" works oppositite to "\c".

-- 
Stefan


Re: use '/' to find both upper and lower case instances

2006-08-17 Thread Alan G Isaac
On Fri, 18 Aug 2006, Luke Vanderfluit apparently wrote: 
> I have a need to use '/' to find something in a file, but I wish it to ignore 
> case. 

:h \c

hth,
Alan Isaac





Re: [unclassified] Re: use '/' to find both upper and lower case instances

2006-08-17 Thread Luke Vanderfluit
Hi.

17Aug2006 @ 20:53 Dimitriy V. Masterov thusly spake
> Luke,
> 
> Have you tried using :set ignorecase before your search?

Yes. And that worked.
Thanks (-:

Kind regards.
Luke.

> 
> DVM


How to insert text via script/function call ?

2006-08-17 Thread Meino Christian Cramer
Hi,

 I often need to place a header above a function defintion (C-source)
 fpr documentational purposes.

 What I treid is to write a short function for vim, which dioes insert
 the text skeleton -- but I did not find any already existing function
 in the API which does this for me. With :i I got weird effects --
 sure my fault, but... .

 How can I insert text via a script ?

 Kind regards,
 mcc


 


Re: How to insert text via script/function call ?

2006-08-17 Thread A.J.Mechelynck

Meino Christian Cramer wrote:

Hi,

 I often need to place a header above a function defintion (C-source)
 fpr documentational purposes.

 What I treid is to write a short function for vim, which dioes insert
 the text skeleton -- but I did not find any already existing function
 in the API which does this for me. With :i I got weird effects --
 sure my fault, but... .

 How can I insert text via a script ?

 Kind regards,
 mcc


 





If your text is in a file on its own, you can use ":r" with a line 
number (the number of the line after which to insert, or 0 for "before 
first line", or . for "after cursor line", or $ for "after last line"; 
default is after cursor line) in the "range" position, i.e. just before 
the r. The file name comes as an argument at the end.


Example (after line 5):

5r ~/template.txt

If your text is in a register, you can use ":put" with a line number 
(again) in the range position and the register name (including ", which 
must be escaped as \", for the default register; or + for the system 
clipboard) after the ":put".


Example (before cursor line):

.-1put \"


See
:help :read
:help :put


Best regards,
Tony.