R: R: matchit doesn't work for php

2006-07-19 Thread Cesar Romani

 -Messaggio originale-
 Da: Benji Fisher [mailto:[EMAIL PROTECTED]
 Inviato: mercoledì 19 luglio 2006 15.17
 A: vim
 Oggetto: Re: R: matchit doesn't work for php
 
 On Fri, Jul 14, 2006 at 04:16:44AM +0200, Cesar Romani wrote:
 
  Thanks a lot, it works but I also notice that else if is not part of
 the
  matching, although else if is a valid expression in php:
  It matches if, else, elseif
  but it doesn't match if, else, else if
  How can I include else if in the matching?
  Many thanks in advance.
 
  Cesar
 
  First of all, it is not clear to me that everyone would want to
 treat else if the same as elseif.  From the PHP manual,
 
   In PHP, you can also write 'else if' (in two words) and the
   behavior would be identical to the one of 'elseif' (in a single
   word). The syntactic meaning is slightly different (if you're
   familiar with C, this is the same behavior) but the bottom line
   is that both would result in exactly the same behavior.
 
 Personally, I would use elseif for something like the example given
 there,
 
   if ($a  $b) {
   echo a is bigger than b;
   } elseif ($a == $b) {
   echo a is equal to b;
   } else {
   echo a is smaller than b;
   }
 
 but I might write else if for something like
 
   if ($a  $b) {
   echo a is bigger than b;
   } else  if ($a == $b) { # This is the complicated case!
   # Many lines of code
   } else {
   echo a is smaller than b;
   }
 
 and then I would be annoyed if else if were treated the same as
elseif.
 
  If you still want to treat them the same, then replace 'elseif' in
 the
 matchit patterns with 'else\s*if'.  Then test it:  you should get
 different
 results depending on whether you start with the cursor on the first or
 second
 word of else if, and you may like it.  If you really want the two cases
 treated identically, then you have to make sure that the second part of
 else
 if is not treated as an if, so replace '\if' in the matching patterns
 with
 '\%(\else\s*\)\@!\if' (untested).  That should do it.
 
 if (help for matchit not yet installed)
   :help matchit-install
 
 :help matchit-spaces
 
 HTH   --Benji Fisher

In the following code, if from line 2 doesn't match else from line 7

 
 1 ?php
 2 if($a  $b)
 3 {
 4   echo a is bigger than b;
 5   if($a=10) $b=5;
 6 }
 7 else
 8 {
 9   echo a is smaller than b;
10 }
11 ?


Many thanks in advance.

Cesar



R: matchit doesn't work for php

2006-07-13 Thread Cesar Romani

 -Messaggio originale-
 Da: Benji Fisher [mailto:[EMAIL PROTECTED]
 Inviato: giovedì 13 luglio 2006 15.35
 A: vim
 Cc: Dan Sharp
 Oggetto: Re: matchit doesn't work for php
 
 On Thu, Jul 13, 2006 at 06:42:43AM +0200, Cesar Romani wrote:
 
  In the following function the bracket at 3 doesn't match the bracket at
 17
  And the bracket at 5 doesn't match the bracket at 8
 
   1 ?php
   2   function test1($a,$b,$c,$d,$e,$f)
   3   {
   4 if($e=='hola')
   5 {
   6   if($f=='') $f='1000';
   7   $s='{'.$d.':'.$f.'}amigo';
   8 }
   9 else
  10 {
  11   $s='{'.$d.':'.$f.'}amiga';
  12 }
  13 $this-s=$s;
  14 $this-a=$a;
  15 $this-b=$b;
  16 $this-c=$c;
  17   }
  18 ?
 
  Many thanks in advance.
 
  Cesar
 
  The problem is that { is included in the 'matchpairs' option but
 not in b:match_words.  The matchit script recognizes that { is a
 matching character, but does not have a rule for it, so it defaults to
 the built-in % matching behavior.  You can confirm this with
 
 :normal! %
 
  The solution is to add '{:}' to b:match_words ; probably also '(:)'
 and '[:]' while you are at it.  Also, I notice that ftplugin/php.vim
 :source's ftplugin/html.vim and so inherits the HTML setting of
 b:match_skip .  I think that PHP would do better with the default skip
 behavior, so it should :unlet this variable.
 
  I am cc'ing the maintainer of ftplugin/php.vim .
 
 HTH   --Benji Fisher

Thanks a lot, it works but I also notice that else if is not part of the
matching, although else if is a valid expression in php:
It matches if, else, elseif
but it doesn't match if, else, else if
How can I include else if in the matching?
Many thanks in advance.

Cesar



open Explore in new tab

2006-07-12 Thread Cesar Romani
How to open a new tab with Explore?
I've read about :tab {cmd} but it works only when cmd is split or
help.
Anyway I can open a new tab with :tabe or :tabnew and then I can run
:Explore on it but I wanted to do it in one step. Is it possible?
Many thanks in advance.

Cesar



matchit doesn't work for php

2006-07-12 Thread Cesar Romani
 
In the following function the bracket at 3 doesn't match the bracket at 17
And the bracket at 5 doesn't match the bracket at 8

 1 ?php
 2   function test1($a,$b,$c,$d,$e,$f)
 3   {
 4 if($e=='hola')
 5 {
 6   if($f=='') $f='1000'; 
 7   $s='{'.$d.':'.$f.'}amigo'; 
 8 }
 9 else
10 {
11   $s='{'.$d.':'.$f.'}amiga'; 
12 }
13 $this-s=$s;
14 $this-a=$a;
15 $this-b=$b;
16 $this-c=$c;
17   }
18 ?

Many thanks in advance.

Cesar



R: language menu

2006-07-11 Thread Cesar Romani

 -Messaggio originale-
 Da: Yakov Lerner [mailto:[EMAIL PROTECTED]
 Inviato: martedì 11 luglio 2006 11.08
 A: Cesar Romani
 Cc: vim
 Oggetto: Re: language menu
 
 On 7/11/06, Cesar Romani [EMAIL PROTECTED] wrote:
  Normally the language of my vim's menu is Italian.
  How can I change it to English?
  Many thanks in advance,
 
 Which OS is that ?
 
 Yakov

I use vim 7.0 on WinXP and I'd also be interested to know the solution
on Linux.
Many thanks in advance,

Cesar



R: R: language menu

2006-07-11 Thread Cesar Romani

 -Messaggio originale-
 Da: Yakov Lerner [mailto:[EMAIL PROTECTED]
 Inviato: martedì 11 luglio 2006 16.01
 A: Cesar Romani
 Cc: vim
 Oggetto: Re: R: language menu
 
 On 7/11/06, Cesar Romani [EMAIL PROTECTED] wrote:
 
   -Messaggio originale-
   Da: Yakov Lerner [mailto:[EMAIL PROTECTED]
   Inviato: martedì 11 luglio 2006 11.08
   A: Cesar Romani
   Cc: vim
   Oggetto: Re: language menu
  
   On 7/11/06, Cesar Romani [EMAIL PROTECTED] wrote:
Normally the language of my vim's menu is Italian.
How can I change it to English?
Many thanks in advance,
 
 It's described in :help mlang.txt
 
 You either define $LANG environment variable to someting like
  C,en,or en_US
 
 or you add this to your ~/.gvimrc(or .vimrc):
   :language mes C
   :language mes en
   :language mes en_US
 
 Yakov

It doesn't work. The menu and the menu's entries are always in Italian.
Many thanks in advance.

Cesar



language menu

2006-07-10 Thread Cesar Romani
Normally the language of my vim's menu is Italian.
How can I change it to English?
Many thanks in advance,

Cesar



R: Launch a browser from url in text

2006-07-05 Thread Cesar Romani

 -Messaggio originale-
 Da: Bittner, Stefan [mailto:[EMAIL PROTECTED]
 Inviato: lunedì 3 luglio 2006 19.19
 A: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Oggetto: WG: Launch a browser from url in text
 
 Hi Cesar,
 
 if you consider to use the Utl-plugin mentioned by Tom below, please don't
 hesitate to contact me if you have any questions. I think Utl.vim can do
 what you need.
 
 With the mapping
 
   :nmap 2-LeftMouse Leadergu
 
 you can doubleclick an URL. It would also be possible to use URLs without
 embeddings, e.g. execute
 
   http://www.vim.org/scripts/script.php?script_id=293
 
 instead of
 
   URL:http://www.vim.org/scripts/script.php?script_id=293
 
 
 Regards,
 Stefan (Creator of utl.vim plugin)
 
 -Ursprüngliche Nachricht-
 Von: Tom Purl [mailto:[EMAIL PROTECTED]
 Gesendet: Sonntag, 2. Juli 2006 04:30
 An: Cesar Romani
 Cc: Vim
 Betreff: Re: Launch a browser from url in text
 
 Check out the utl plugin:
 
 * http://www.vim.org/scripts/script.php?script_id=293
 
 It may not be exactly what you want, but it's very close.
 
 HTH!
 
 Tom Purl
 
 On Sun, Jul 02, 2006 at 04:19:10AM +0200, Cesar Romani wrote:
  Is it possible to doubleclick a highlighted URL in a text and thus
 launch a
  browser, f.e. internet explorer or firefox?
  The command gf allows to open a file under a cursor. Isn't there
  anything similar for URLS?
  Many thanks in advance,
 
  Andalou
 
I'm using utl.vim to open url under the cursor.
When I press \gu under an url, it opens the url but it appears at the
bottom:
:call Utl_goUrl('edit')

How can it be hidden?
Many thanks in advance,

Cesar




Launch a browser from url in text

2006-07-01 Thread Cesar Romani
Is it possible to doubleclick a highlighted URL in a text and thus launch a
browser, f.e. internet explorer or firefox?
The command gf allows to open a file under a cursor. Isn't there any
similar for URLS?
Many thanks in advance,

Andalou



***SPAM*** Error detected while processing function SNR1_BMShow

2006-06-13 Thread Cesar Romani
I use vim 7.0 on Windows XP compiled with MS Visual C.
If I do: gvim -u NONE -U NONE -c set verbosefile=C:/vim.log
I get:

--
Error detected while processing function SNR1_BMShow:
line   12:
E329: No menu Buffer
Error detected while processing function SNR1_BMShow:
line   14:
E328: Menu only exists in another mode
Tear off this menu
---

Many thanks in advance,

Andalou



***SPAM*** Vim doesn't open files with chinese file names

2006-06-09 Thread Cesar Romani
If I have a file with a chinese file name, f.e. 感情包袱.txt
It won’t open but it throws the message: E303: Unable to open swap file for
“.txt”, recovery impossible

Instead with notepad I can open the file.

Many thanks in advance,

Andalou