Tuesday, May 31, 2011

Re: Some questions about using VIM on MAC

> > Try updating to the latest snapshot [1] and delete all other versions
> > of MacVim from your computer.
> > [1]https://github.com/b4winckler/macvim/wiki/ChangeLog
>
> I tried the latest snapshot57 from MACPort first. However, it's not a
> complete version. It doesn't support cscope. I have to change back to the
> relase version. Is there any complete version of latest snapshot?

Just follow the link I sent you and download the official snapshot
57. It has cscope support.

Björn

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: gf and new tab

Hi,

eNG1Ne wrote:
> Chuffed at remembering, after seeing it go past in the group, that gf
> opens the file under the cursor … less chuffed that when I use gf to
> check an include file, this closes the file I'm currently working on :-
> { Any workarounds out there?

there are also <Ctrl-W><f>, which opens the file under the cursor in a
new window, and <Ctrl-W><g><f>, which opens it in a new tab.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: gf and new tab

Am 01.06.2011 08:29, schrieb eNG1Ne:
> Chuffed at remembering, after seeing it go past in the group, that gf
> opens the file under the cursor … less chuffed that when I use gf to
> check an include file, this closes the file I'm currently working on :-
> { Any workarounds out there?
>

:help CTRL-W_gf


HTH,
Dennis Benzinger

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Different working directories in different tabs

Hello!

Am 01.06.2011 08:23, schrieb Martin Lundberg:
> On Tuesday, May 31, 2011 2:55:40 PM UTC+2, Christian Brabandt wrote:
>>
>> :h :lcd
>>
>> regards,
>> Christian
>>
> Hi Christian. To my understanding that is not what I'm talking about. The
> :lcd command changes it for the current window. I'm talking about creating a
> new tab and changing the working directory using :cd. It changes the cwd for
> that tab only (you can even see the filenames of the other tabs changing on
> the tabs). If you then change back to another tab it's cwd has not changed.

If you create the new tab and lcd to another directory the current
directory is set for the initial window on that tab. New windows opened
on this tab (e.g. via split or enew) then inherit the current directory
from the initial window.


Regards,
Dennis Benzinger

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

gf and new tab

Chuffed at remembering, after seeing it go past in the group, that gf
opens the file under the cursor … less chuffed that when I use gf to
check an include file, this closes the file I'm currently working on :-
{ Any workarounds out there?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Different working directories in different tabs

On Tuesday, May 31, 2011 2:55:40 PM UTC+2, Christian Brabandt wrote:

:h :lcd

regards,
Christian

Hi Christian. To my understanding that is not what I'm talking about. The :lcd command changes it for the current window. I'm talking about creating a new tab and changing the working directory using :cd. It changes the cwd for that tab only (you can even see the filenames of the other tabs changing on the tabs). If you then change back to another tab it's cwd has not changed.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: How to disable neocomplcache for preview window ?

Thank you.

2011/5/26 matsushita shougo <shougo.matsu@gmail.com>
Hi, Lenin.

> Hi,
> I have let g:neocomplcache_enable_at_startup=1, but this makes the preview
> window considerably slow when opened by :ptag.
> Is there a good way to disable neocomplcache only for preview window ?
> Thanks

I fixed this problem. Please update neocomplcache.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

[HELP]perl-support problem on gvim 7.3

The os is windows xp sp3, with gvim 7.3.

I am new to Perl, and want to use vim to edit perl, so I download perl-support and install it.

But when I start gvim to edit a file say, test.pl. it gives the error as follows:

can't locate Per/tags.pm  in @INC at (eval 9) line 1.

can't call method "process" on an undefined value at (eval 10) line 5

What should I do?

Thanks in advance~

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

Christian Brabandt wrote:

> On Tue, May 31, 2011 1:50 pm, Vsevolod Velichko wrote:
> > Christian, thanks for your answer.
> > Yes, all the files I've lost were created from scratch, so I suppose,
> > that undofile contains all the file history (undolevels=1000 should be
> > sufficient for every file).
>
> Ok then here is a patch. It allows to use :rundo! to let vim read in any
> undo file. You need to create a new empty file with more lines, than your
> original file had, e.g. 1000 empty lines. Then do :rundo! original_file.un~
> and you can move through the undo history using g- and g+ or using
> the :earlier :later commands.
> The histwin or gundo plugin may also come useful to see your different
> undo branches.

This is an interesting idea. Not only when the file was deleted, but
also when it was changed by another program.

Perhaps we can have a "starting point" marker in the undo file, where
the base file is completely empty. From there it's always possible to
repeat changes. With some command to do this, perhaps ":undorecover"?

When trying to load the undo file and the hash doesn't match, and there
is a starting point marker, we could give the user a hint that
:undorecover can be used.

--
I'm writing a book. I've got the page numbers done.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

syntax highlighting perl with large multiline html strings

Hi all,

I apologize if this has been asked before.  I do a lot of programming in perl as cgi files and such.  Many of the scripts I work on do a lot of html printing.  Frequently there are multi-line html sections such as this:
print <<HTML;
<html>
<body>
...
</body>
</html>
HTML

The problem is that vim will mixup (turn off/on) the syntax highlighting within the string if I start includes quotes such as in javascript or even just class='someclass'.  Everything between the <<HTML and the last HTML should be considered a string.  Vim in both the terminal and gVim will stop treating the whole block as a string.  Is this a known issue?  Is there a way to prevent this from happening or to quickly reset it?

Thanks.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

Reply to message «Re: Restore file from undo»,
sent 23:17:12 31 May 2011, Tuesday
by Christian Brabandt:

> Hm, if I remember correctly, the inodes are zeroed out, when a file is
> deleted for ext3 and ext4. That's why extundelete only works correctly
> with ext2.
According to description of sys-fs/extundelete package it works only for ext3
and ext4, not for ext2 filesystem. I don't know anything about zeroing inodes
and I use neither extundelete nor ext* filesystems.

Original message:
> Hi ZyX!
>
> On Di, 31 Mai 2011, ZyX wrote:
> > There are additional options: for ext* filesystems you may use
> > extundelete application and for every filesystem you may open its
> > device as a file and search for parts of the text you still remember.
> > Before doing the latter, ask somebody for application that is able to
> > do the job, Vim is not a good option for this. I once did something
> > similar with grep.
>
> Hm, if I remember correctly, the inodes are zeroed out, when a file is
> deleted for ext3 and ext4. That's why extundelete only works correctly
> with ext2.
>
>
> regards,
> Christian

Re: Restore file from undo

2011/5/31 Christian Brabandt <cblists@256bit.org>:
> Hm, if I remember correctly, the inodes are zeroed out, when a file is
> deleted for ext3 and ext4. That's why extundelete only works correctly
> with ext2.

Not exactly.

There is even utility ext3grep[1] written by Carlo Wood, which
performs all the lookup for you. It can help in some cases.

[1] http://code.google.com/p/ext3grep/

----
Best wishes and have a nice day,
Vsevolod Velichko

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

Hi ZyX!

On Di, 31 Mai 2011, ZyX wrote:

> There are additional options: for ext* filesystems you may use
> extundelete application and for every filesystem you may open its
> device as a file and search for parts of the text you still remember.
> Before doing the latter, ask somebody for application that is able to
> do the job, Vim is not a good option for this. I once did something
> similar with grep.

Hm, if I remember correctly, the inodes are zeroed out, when a file is
deleted for ext3 and ext4. That's why extundelete only works correctly
with ext2.


regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

Hi Vsevolod!

On Di, 31 Mai 2011, Vsevolod Velichko wrote:

> less than 1000 undolevels in each file, but files more than one :)

even if less then 1000 undolevels, it might still be valuable...

> The idea of grepping fs was the first one, but all the day (before I
> found that the code has been deleted) I had filled my hdd with the
> enormous dumps, so that there is no chance, that code is still placed
> somewhere in the free space.
> And, yes, the code was placed in the VCS working dir, just not
> commited&pushed yet.
>
> Christian,
> thanks for your patch.
> Unfortunately, it wasn't fully helpful, but I've recovered a lot of data.

I thought so. But even if it helped only a little bit, it's better than
nothing.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Searching for accented characters.

diff -r e9538cfd0d9c runtime/doc/pattern.txt
--- a/runtime/doc/pattern.txt Wed May 25 21:18:06 2011 +0200
+++ b/runtime/doc/pattern.txt Tue May 31 20:35:52 2011 +0200
@@ -1038,8 +1038,6 @@
have almost the same meaning, e.g., when ignoring accents. The form
is:
[=a=]
- Currently this is only implemented for latin1. Also works for the
- latin1 characters in utf-8 and latin9.
*/[[.* *[..]*
- A collation element. This currently simply accepts a single
character in the form:
diff -r e9538cfd0d9c src/regexp.c
--- a/src/regexp.c Wed May 25 21:18:06 2011 +0200
+++ b/src/regexp.c Tue May 31 20:35:52 2011 +0200
@@ -666,8 +666,10 @@
static void regc __ARGS((int b));
#ifdef FEAT_MBYTE
static void regmbc __ARGS((int c));
+# define REGMBC(x) regmbc(x)
#else
# define regmbc(c) regc(c)
+# define REGMBC(x) ((void)0)
#endif
static void reginsert __ARGS((int, char_u *));
static void reginsert_limits __ARGS((int, long, long, char_u *));
@@ -784,71 +786,300 @@
}
}
#else
+# ifdef FEAT_MBYTE
+# define CASEMBC(x) case x:
+# else
+# define CASEMBC(x)
+# endif
switch (c)
{
case 'A': case '\300': case '\301': case '\302':
+ CASEMBC(0x100) CASEMBC(0x102) CASEMBC(0x104) CASEMBC(0x1cd)
+ CASEMBC(0x1de) CASEMBC(0x1e0) CASEMBC(0x1ea2)
case '\303': case '\304': case '\305':
regmbc('A'); regmbc('\300'); regmbc('\301');
regmbc('\302'); regmbc('\303'); regmbc('\304');
regmbc('\305');
+ REGMBC(0x100); REGMBC(0x102); REGMBC(0x104);
+ REGMBC(0x1cd); REGMBC(0x1de); REGMBC(0x1e0);
+ REGMBC(0x1ea2);
+ return;
+ case 'B': CASEMBC(0x1e02) CASEMBC(0x1e06)
+ regmbc('B'); REGMBC(0x1e02); REGMBC(0x1e06);
return;
case 'C': case '\307':
+ CASEMBC(0x106) CASEMBC(0x108) CASEMBC(0x10a) CASEMBC(0x10c)
regmbc('C'); regmbc('\307');
+ REGMBC(0x106); REGMBC(0x108); REGMBC(0x10a);
+ REGMBC(0x10c);
+ return;
+ case 'D': CASEMBC(0x10e) CASEMBC(0x110) CASEMBC(0x1e0a)
+ CASEMBC(0x1e0e) CASEMBC(0x1e10)
+ regmbc('D'); REGMBC(0x10e); REGMBC(0x110);
+ REGMBC(0x1e0a); REGMBC(0x1e0e); REGMBC(0x1e10);
return;
case 'E': case '\310': case '\311': case '\312': case '\313':
+ CASEMBC(0x112) CASEMBC(0x114) CASEMBC(0x116) CASEMBC(0x118)
+ CASEMBC(0x11a) CASEMBC(0x1eba) CASEMBC(0x1ebc)
regmbc('E'); regmbc('\310'); regmbc('\311');
regmbc('\312'); regmbc('\313');
+ REGMBC(0x112); REGMBC(0x114); REGMBC(0x116);
+ REGMBC(0x118); REGMBC(0x11a); REGMBC(0x1eba);
+ REGMBC(0x1ebc);
+ return;
+ case 'F': CASEMBC(0x1e1e)
+ regmbc('F'); REGMBC(0x1e1e);
+ return;
+ case 'G': CASEMBC(0x11c) CASEMBC(0x11e) CASEMBC(0x120)
+ CASEMBC(0x122) CASEMBC(0x1e4) CASEMBC(0x1e6) CASEMBC(0x1f4)
+ CASEMBC(0x1e20)
+ regmbc('G'); REGMBC(0x11c); REGMBC(0x11e);
+ REGMBC(0x120); REGMBC(0x122); REGMBC(0x1e4);
+ REGMBC(0x1e6); REGMBC(0x1f4); REGMBC(0x1e20);
+ return;
+ case 'H': CASEMBC(0x124) CASEMBC(0x126) CASEMBC(0x1e22)
+ CASEMBC(0x1e26) CASEMBC(0x1e28)
+ regmbc('H'); REGMBC(0x124); REGMBC(0x126);
+ REGMBC(0x1e22); REGMBC(0x1e26); REGMBC(0x1e28);
return;
case 'I': case '\314': case '\315': case '\316': case '\317':
+ CASEMBC(0x128) CASEMBC(0x12a) CASEMBC(0x12c) CASEMBC(0x12e)
+ CASEMBC(0x130) CASEMBC(0x1cf) CASEMBC(0x1ec8)
regmbc('I'); regmbc('\314'); regmbc('\315');
regmbc('\316'); regmbc('\317');
+ REGMBC(0x128); REGMBC(0x12a); REGMBC(0x12c);
+ REGMBC(0x12e); REGMBC(0x130); REGMBC(0x1cf);
+ REGMBC(0x1ec8);
+ return;
+ case 'J': CASEMBC(0x134)
+ regmbc('J'); REGMBC(0x134);
+ return;
+ case 'K': CASEMBC(0x136) CASEMBC(0x1e8) CASEMBC(0x1e30)
+ CASEMBC(0x1e34)
+ regmbc('K'); REGMBC(0x136); REGMBC(0x1e8);
+ REGMBC(0x1e30); REGMBC(0x1e34);
+ return;
+ case 'L': CASEMBC(0x139) CASEMBC(0x13b) CASEMBC(0x13d)
+ CASEMBC(0x13f) CASEMBC(0x141) CASEMBC(0x1e3a)
+ regmbc('L'); REGMBC(0x139); REGMBC(0x13b);
+ REGMBC(0x13d); REGMBC(0x13f); REGMBC(0x141);
+ REGMBC(0x1e3a);
+ return;
+ case 'M': CASEMBC(0x1e3e) CASEMBC(0x1e40)
+ regmbc('M'); REGMBC(0x1e3e); REGMBC(0x1e40);
return;
case 'N': case '\321':
+ CASEMBC(0x143) CASEMBC(0x145) CASEMBC(0x147) CASEMBC(0x1e44)
+ CASEMBC(0x1e48)
regmbc('N'); regmbc('\321');
+ REGMBC(0x143); REGMBC(0x145); REGMBC(0x147);
+ REGMBC(0x1e44); REGMBC(0x1e48);
return;
case 'O': case '\322': case '\323': case '\324': case '\325':
- case '\326':
+ case '\326': case '\330':
+ CASEMBC(0x14c) CASEMBC(0x14e) CASEMBC(0x150) CASEMBC(0x1a0)
+ CASEMBC(0x1d1) CASEMBC(0x1ea) CASEMBC(0x1ec) CASEMBC(0x1ece)
regmbc('O'); regmbc('\322'); regmbc('\323');
regmbc('\324'); regmbc('\325'); regmbc('\326');
+ regmbc('\330');
+ REGMBC(0x14c); REGMBC(0x14e); REGMBC(0x150);
+ REGMBC(0x1a0); REGMBC(0x1d1); REGMBC(0x1ea);
+ REGMBC(0x1ec); REGMBC(0x1ece);
+ return;
+ case 'P': case 0x1e54: case 0x1e56:
+ regmbc('P'); REGMBC(0x1e54); REGMBC(0x1e56);
+ return;
+ case 'R': CASEMBC(0x154) CASEMBC(0x156) CASEMBC(0x158)
+ CASEMBC(0x1e58) CASEMBC(0x1e5e)
+ regmbc('R'); REGMBC(0x154); REGMBC(0x156); REGMBC(0x158);
+ REGMBC(0x1e58); REGMBC(0x1e5e);
+ return;
+ case 'S': CASEMBC(0x15a) CASEMBC(0x15c) CASEMBC(0x15e)
+ CASEMBC(0x160) CASEMBC(0x1e60)
+ regmbc('S'); REGMBC(0x15a); REGMBC(0x15c);
+ REGMBC(0x15e); REGMBC(0x160); REGMBC(0x1e60);
+ return;
+ case 'T': CASEMBC(0x162) CASEMBC(0x164) CASEMBC(0x166)
+ CASEMBC(0x1e6a) CASEMBC(0x1e6e)
+ regmbc('T'); REGMBC(0x162); REGMBC(0x164);
+ REGMBC(0x166); REGMBC(0x1e6a); REGMBC(0x1e6e);
return;
case 'U': case '\331': case '\332': case '\333': case '\334':
+ CASEMBC(0x168) CASEMBC(0x16a) CASEMBC(0x16c) CASEMBC(0x16e)
+ CASEMBC(0x170) CASEMBC(0x172) CASEMBC(0x1af) CASEMBC(0x1d3)
+ CASEMBC(0x1ee6)
regmbc('U'); regmbc('\331'); regmbc('\332');
regmbc('\333'); regmbc('\334');
+ REGMBC(0x168); REGMBC(0x16a); REGMBC(0x16c);
+ REGMBC(0x16e); REGMBC(0x170); REGMBC(0x172);
+ REGMBC(0x1af); REGMBC(0x1d3); REGMBC(0x1ee6);
+ return;
+ case 'V': CASEMBC(0x1e7c)
+ regmbc('V'); REGMBC(0x1e7c);
+ return;
+ case 'W': CASEMBC(0x174) CASEMBC(0x1e80) CASEMBC(0x1e82)
+ CASEMBC(0x1e84) CASEMBC(0x1e86)
+ regmbc('W'); REGMBC(0x174); REGMBC(0x1e80);
+ REGMBC(0x1e82); REGMBC(0x1e84); REGMBC(0x1e86);
return;
case 'Y': case '\335':
+ CASEMBC(0x176) CASEMBC(0x178) CASEMBC(0x1e8e) CASEMBC(0x1ef2)
+ CASEMBC(0x1ef6) CASEMBC(0x1ef8)
regmbc('Y'); regmbc('\335');
+ REGMBC(0x176); REGMBC(0x178); REGMBC(0x1e8e);
+ REGMBC(0x1ef2); REGMBC(0x1ef6); REGMBC(0x1ef8);
+ return;
+ case 'Z': CASEMBC(0x179) CASEMBC(0x17b) CASEMBC(0x17d)
+ CASEMBC(0x1b5) CASEMBC(0x1e90) CASEMBC(0x1e94)
+ regmbc('Z'); REGMBC(0x179); REGMBC(0x17b);
+ REGMBC(0x17d); REGMBC(0x1b5); REGMBC(0x1e90);
+ REGMBC(0x1e94);
return;
case 'a': case '\340': case '\341': case '\342':
case '\343': case '\344': case '\345':
+ CASEMBC(0x101) CASEMBC(0x103) CASEMBC(0x105) CASEMBC(0x1ce)
+ CASEMBC(0x1df) CASEMBC(0x1e1) CASEMBC(0x1ea3)
regmbc('a'); regmbc('\340'); regmbc('\341');
regmbc('\342'); regmbc('\343'); regmbc('\344');
regmbc('\345');
+ REGMBC(0x101); REGMBC(0x103); REGMBC(0x105);
+ REGMBC(0x1ce); REGMBC(0x1df); REGMBC(0x1e1);
+ REGMBC(0x1ea3);
+ return;
+ case 'b': CASEMBC(0x1e03) CASEMBC(0x1e07)
+ regmbc('b'); REGMBC(0x1e03); REGMBC(0x1e07);
return;
case 'c': case '\347':
+ CASEMBC(0x107) CASEMBC(0x109) CASEMBC(0x10b) CASEMBC(0x10d)
regmbc('c'); regmbc('\347');
+ REGMBC(0x107); REGMBC(0x109); REGMBC(0x10b);
+ REGMBC(0x10d);
+ return;
+ case 'd': CASEMBC(0x10f) CASEMBC(0x111) CASEMBC(0x1d0b)
+ CASEMBC(0x1e11)
+ regmbc('d'); REGMBC(0x10f); REGMBC(0x111);
+ REGMBC(0x1e0b); REGMBC(0x01e0f); REGMBC(0x1e11);
return;
case 'e': case '\350': case '\351': case '\352': case '\353':
+ CASEMBC(0x113) CASEMBC(0x115) CASEMBC(0x117) CASEMBC(0x119)
+ CASEMBC(0x11b) CASEMBC(0x1ebb) CASEMBC(0x1ebd)
regmbc('e'); regmbc('\350'); regmbc('\351');
regmbc('\352'); regmbc('\353');
+ REGMBC(0x113); REGMBC(0x115); REGMBC(0x117);
+ REGMBC(0x119); REGMBC(0x11b); REGMBC(0x1ebb);
+ REGMBC(0x1ebd);
+ return;
+ case 'f': CASEMBC(0x1e1f)
+ regmbc('f'); REGMBC(0x1e1f);
+ return;
+ case 'g': CASEMBC(0x11d) CASEMBC(0x11f) CASEMBC(0x121)
+ CASEMBC(0x123) CASEMBC(0x1e5) CASEMBC(0x1e7) CASEMBC(0x1f5)
+ CASEMBC(0x1e21)
+ regmbc('g'); REGMBC(0x11d); REGMBC(0x11f);
+ REGMBC(0x121); REGMBC(0x123); REGMBC(0x1e5);
+ REGMBC(0x1e7); REGMBC(0x1f5); REGMBC(0x1e21);
+ return;
+ case 'h': CASEMBC(0x125) CASEMBC(0x127) CASEMBC(0x1e23)
+ CASEMBC(0x1e27) CASEMBC(0x1e29) CASEMBC(0x1e96)
+ regmbc('h'); REGMBC(0x125); REGMBC(0x127);
+ REGMBC(0x1e23); REGMBC(0x1e27); REGMBC(0x1e29);
+ REGMBC(0x1e96);
return;
case 'i': case '\354': case '\355': case '\356': case '\357':
+ CASEMBC(0x129) CASEMBC(0x12b) CASEMBC(0x12d) CASEMBC(0x12f)
+ CASEMBC(0x1d0) CASEMBC(0x1ec9)
regmbc('i'); regmbc('\354'); regmbc('\355');
regmbc('\356'); regmbc('\357');
+ REGMBC(0x129); REGMBC(0x12b); REGMBC(0x12d);
+ REGMBC(0x12f); REGMBC(0x1d0); REGMBC(0x1ec9);
+ return;
+ case 'j': CASEMBC(0x135) CASEMBC(0x1f0)
+ regmbc('j'); REGMBC(0x135); REGMBC(0x1f0);
+ return;
+ case 'k': CASEMBC(0x137) CASEMBC(0x1e9) CASEMBC(0x1e31)
+ CASEMBC(0x1e35)
+ regmbc('k'); REGMBC(0x137); REGMBC(0x1e9);
+ REGMBC(0x1e31); REGMBC(0x1e35);
+ return;
+ case 'l': CASEMBC(0x13a) CASEMBC(0x13c) CASEMBC(0x13e)
+ CASEMBC(0x140) CASEMBC(0x142) CASEMBC(0x1e3b)
+ regmbc('l'); REGMBC(0x13a); REGMBC(0x13c);
+ REGMBC(0x13e); REGMBC(0x140); REGMBC(0x142);
+ REGMBC(0x1e3b);
+ return;
+ case 'm': CASEMBC(0x1e3f) CASEMBC(0x1e41)
+ regmbc('m'); REGMBC(0x1e3f); REGMBC(0x1e41);
return;
case 'n': case '\361':
+ CASEMBC(0x144) CASEMBC(0x146) CASEMBC(0x148) CASEMBC(0x149)
+ CASEMBC(0x1e45) CASEMBC(0x1e49)
regmbc('n'); regmbc('\361');
+ REGMBC(0x144); REGMBC(0x146); REGMBC(0x148);
+ REGMBC(0x149); REGMBC(0x1e45); REGMBC(0x1e49);
return;
case 'o': case '\362': case '\363': case '\364': case '\365':
- case '\366':
+ case '\366': case '\370':
+ CASEMBC(0x14d) CASEMBC(0x14f) CASEMBC(0x151) CASEMBC(0x1a1)
+ CASEMBC(0x1d2) CASEMBC(0x1eb) CASEMBC(0x1ed) CASEMBC(0x1ecf)
regmbc('o'); regmbc('\362'); regmbc('\363');
regmbc('\364'); regmbc('\365'); regmbc('\366');
+ regmbc('\370');
+ REGMBC(0x14d); REGMBC(0x14f); REGMBC(0x151);
+ REGMBC(0x1a1); REGMBC(0x1d2); REGMBC(0x1eb);
+ REGMBC(0x1ed); REGMBC(0x1ecf);
+ return;
+ case 'p': CASEMBC(0x1e55) CASEMBC(0x1e57)
+ regmbc('p'); REGMBC(0x1e55); REGMBC(0x1e57);
+ return;
+ case 'r': CASEMBC(0x155) CASEMBC(0x157) CASEMBC(0x159)
+ CASEMBC(0x1e59) CASEMBC(0x1e5f)
+ regmbc('r'); REGMBC(0x155); REGMBC(0x157); REGMBC(0x159);
+ REGMBC(0x1e59); REGMBC(0x1e5f);
+ return;
+ case 's': CASEMBC(0x15b) CASEMBC(0x15d) CASEMBC(0x15f)
+ CASEMBC(0x161) CASEMBC(0x1e61)
+ regmbc('s'); REGMBC(0x15b); REGMBC(0x15d);
+ REGMBC(0x15f); REGMBC(0x161); REGMBC(0x1e61);
+ return;
+ case 't': CASEMBC(0x163) CASEMBC(0x165) CASEMBC(0x167)
+ CASEMBC(0x1e6b) CASEMBC(0x1e6f) CASEMBC(0x1e97)
+ regmbc('t'); REGMBC(0x163); REGMBC(0x165); REGMBC(0x167);
+ REGMBC(0x1e6b); REGMBC(0x1e6f); REGMBC(0x1e97);
return;
case 'u': case '\371': case '\372': case '\373': case '\374':
+ CASEMBC(0x169) CASEMBC(0x16b) CASEMBC(0x16d) CASEMBC(0x16f)
+ CASEMBC(0x171) CASEMBC(0x173) CASEMBC(0x1b0) CASEMBC(0x1d4)
+ CASEMBC(0x1ee7)
regmbc('u'); regmbc('\371'); regmbc('\372');
regmbc('\373'); regmbc('\374');
+ REGMBC(0x169); REGMBC(0x16b); REGMBC(0x16d);
+ REGMBC(0x16f); REGMBC(0x171); REGMBC(0x173);
+ REGMBC(0x1b0); REGMBC(0x1d4); REGMBC(0x1ee7);
+ return;
+ case 'v': CASEMBC(0x1e7d)
+ regmbc('v'); REGMBC(0x1e7d);
+ return;
+ case 'w': CASEMBC(0x175) CASEMBC(0x1e81) CASEMBC(0x1e83)
+ CASEMBC(0x1e85) CASEMBC(0x1e87) CASEMBC(0x1e98)
+ regmbc('w'); REGMBC(0x175); REGMBC(0x1e81);
+ REGMBC(0x1e83); REGMBC(0x1e85); REGMBC(0x1e87);
+ REGMBC(0x1e98);
+ return;
+ case 'x': CASEMBC(0x1e8b) CASEMBC(0x1e8d)
+ regmbc('x'); REGMBC(0x1e8b); REGMBC(0x1e8d);
return;
case 'y': case '\375': case '\377':
+ CASEMBC(0x177) CASEMBC(0x1e8f) CASEMBC(0x1e99)
+ CASEMBC(0x1ef3) CASEMBC(0x1ef7) CASEMBC(0x1ef9)
regmbc('y'); regmbc('\375'); regmbc('\377');
+ REGMBC(0x177); REGMBC(0x1e8f); REGMBC(0x1e99);
+ REGMBC(0x1ef3); REGMBC(0x1ef7); REGMBC(0x1ef9);
+ return;
+ case 'z': CASEMBC(0x17a) CASEMBC(0x17c) CASEMBC(0x17e)
+ CASEMBC(0x1b6) CASEMBC(0x1e91) CASEMBC(0x1e95)
+ regmbc('z'); REGMBC(0x17a); REGMBC(0x17c);
+ REGMBC(0x17e); REGMBC(0x1b6); REGMBC(0x1e91);
+ REGMBC(0x1e95);
return;
}
#endif
@@ -2468,6 +2699,8 @@
regmbc(c)
int c;
{
+ if (!has_mbyte && c > 0xff)
+ return;
if (regcode == JUST_CALC_SIZE)
regsize += (*mb_char2len)(c);
else
@@ -2588,7 +2821,7 @@
else
offset = (int)(val - scan);
/* When the offset uses more than 16 bits it can no longer fit in the two
- * bytes avaliable. Use a global flag to avoid having to check return
+ * bytes available. Use a global flag to avoid having to check return
* values in too many places. */
if (offset > 0xffff)
reg_toolong = TRUE;
Dominique Pellé wrote:

> ...
> But I've just written a patch that makes it work with
> Unicode. Please try it and double check that it works
> as expected.
> ...

Sorry, I noticed a bug while reviewing the patch
for equivalence class with Unicode characters.

I attached another version of the patch where a
test "if (!enc_utf8)" has been changed into
"if (!has_mbyte && c > 0xff)" in function regmbc().

Regards
-- Dominique

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Weird auto-comment after 72 lines

On 2011-05-31, Fab wrote:
> Hi,
> I'm reporting a very strange behavior I have only noticed today on
> vim.
> If you open a C file (vim foo.c) and enter this text:
> /*
> then press ENTER
> vim will automatically align the comment and will insert automatically
> a space, star, space: ' * ' before every line.
>
> Unfortunately after 72 lines, this sort of convenient indentation
> capability stop working:
> vim insert only a star (no spaces), and sometimes (if previous text
> has some sort of indentation, it insert several spaces)
>
> If you have a simple (empty) comment with 72 empty lines is not too
> bad as after 1 wrong line it appears to recover, but on one case I
> have a long text with various text indented: in this case vim keep
> inserting several empty lines with no apparent reason. I had to break
> my long comment section into two sections...
>
> Tested with vim 7.0 on Linux (CentOS 5.x), MacVim 7.2, buit-in Mac OS
> vim, and gvim on Mac (7.1).
> To reproduce it, the simplest thing is to open a file called foo.c,
> enter '/*' + enter and repeat pressing enter until you see the
> problem.
>
> In my .vimrc I have:
> ------------------------------------
> filetype plugin on
> filetype indent on
> -----------------------------------------
>
> Any idea why?

Interesting. I don't know why it does that, but I did discover
this, using Vim 7.3.189 on a Linux system.

$ vim -N -u NONE
:set nu
:set fo+=r

Add "/*" then press and hold Enter. I stopped at 300 lines. All
lines after the first contained the desired " *". Restart vim.

$ vim -N -u NONE
:set nu
:set fo+=r
:let &rtp = $VIMRUNTIME
:filetype indent on
:set ft=c
:scriptnames
1: $VIMRUNTIME/filetype.vim
2: $VIMRUNTIME/indent.vim
3: $VIMRUNTIME/indent/c.vim

Again add "/*" and press and hold Enter. This time the comment
leader changes from " *" to "*" at line 72.

The culprit appears to be $VIMRUNTIME/indent/c.vim, but it contains
only

setlocal cindent

So,...

$ vim -N -u NONE
:set nu
:set fo+=r
:set cindent

Again add long comment block. Sure enough, after 71 lines the
comment leader changes from " *" to "*".

So, Vim formats C comments whether or not 'cindent' is set, but it
does so incorrectly if 'cindent' is set.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Vim scripts: insert new line staying with normal mode

On 2011-05-31, Steven Lee wrote:
> Hi all,
>
> It sounds like some vim users have asked similar question, but not
> exactly what I want.
>
> I attempt to write a function implementing insert new line which
> filled consecutive '=' :
>
> let len = 5
> let @x = '='
> exe 'normal! ' . 'o\\<Esc\\>0' . '"x' . len . 'p'
>
> My solution is below:
> 1. o -- enter new line below current line
> 2. <Esc> -- go back to normal mode
> 3. 0 -- go to head of line
> 4. "x5p -- copy 5 times using register x value, i.e. '='
>
> But with step 2, it did not work as I thought. It did not go back to
> normal mode.
>
> How can I correct above scripts?

It will work if you change the quoting of the <Esc> like this:

exe 'normal! ' . "o\<Esc>0" . '"x' . len . 'p'

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

ZyX,
less than 1000 undolevels in each file, but files more than one :)
The idea of grepping fs was the first one, but all the day (before I
found that the code has been deleted) I had filled my hdd with the
enormous dumps, so that there is no chance, that code is still placed
somewhere in the free space.
And, yes, the code was placed in the VCS working dir, just not
commited&pushed yet.

Christian,
thanks for your patch.
Unfortunately, it wasn't fully helpful, but I've recovered a lot of data.
Thanks for your help!

----
Best wishes and have a nice day,
Vsevolod Velichko

2011/5/31 ZyX <zyx.vim@gmail.com>:
> If files are so small that undolevels=1000 is sufficient, maybe you should
> retype them instead?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Weird auto-comment after 72 lines

Hi,
I'm reporting a very strange behavior I have only noticed today on
vim.
If you open a C file (vim foo.c) and enter this text:
/*
then press ENTER
vim will automatically align the comment and will insert automatically
a space, star, space: ' * ' before every line.

Unfortunately after 72 lines, this sort of convenient indentation
capability stop working:
vim insert only a star (no spaces), and sometimes (if previous text
has some sort of indentation, it insert several spaces)

If you have a simple (empty) comment with 72 empty lines is not too
bad as after 1 wrong line it appears to recover, but on one case I
have a long text with various text indented: in this case vim keep
inserting several empty lines with no apparent reason. I had to break
my long comment section into two sections...

Tested with vim 7.0 on Linux (CentOS 5.x), MacVim 7.2, buit-in Mac OS
vim, and gvim on Mac (7.1).
To reproduce it, the simplest thing is to open a file called foo.c,
enter '/*' + enter and repeat pressing enter until you see the
problem.

In my .vimrc I have:
------------------------------------
filetype plugin on
filetype indent on
-----------------------------------------

Any idea why?

Fab

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Vim scripts: insert new line staying with normal mode

On 05/31/2011 08:33 AM, Steven Lee wrote:
> I attempt to write a function implementing insert new line which
> filled consecutive '=' :
>
> How can I correct above scripts?

While it diverges from your original script, I'd go for something
more readable like:

:nnoremap <f4> :put=repeat('-',len)<cr>

which makes more sense to me.

I've occasionally used an "underline this" sequence of commands
to make the underline the same length as the line I'm currently on:

:nnoremap <f4> :t.|s/./-/g<cr>

This copies the current line below itself and replaces each
character with a "-" to create the underline. As an aside, that
formula works nicely with a :g command to underline all my
chapter headings:

:g/^CHAPTER/t.|s/./-/g

Hope this makes it easier for you. I believe the "norm" command
does odd things with escape characters, and escaping
escape-characters.

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Vim scripts: insert new line staying with normal mode

Hi all,

It sounds like some vim users have asked similar question, but not
exactly what I want.

I attempt to write a function implementing insert new line which
filled consecutive '=' :

let len = 5
let @x = '='
exe 'normal! ' . 'o\\<Esc\\>0' . '"x' . len . 'p'

My solution is below:
1. o -- enter new line below current line
2. <Esc> -- go back to normal mode
3. 0 -- go to head of line
4. "x5p -- copy 5 times using register x value, i.e. '='

But with step 2, it did not work as I thought. It did not go back to
normal mode.

How can I correct above scripts?

Thanks,
Steven.l

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: BufReadPost getfsize and scp

On 31 Mai, 15:09, Charles Campbell <Charles.E.Campb...@nasa.gov>
wrote:
> Are you using vim 7.0?  You really should update; vim is up to 7.3 now
> (with 206 patches available).

Yes I do. I guess in that case it is not an error at all.
I would really like to update, but I don't have root access on my work
computers.

Thanks!

David

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: collision

thanks for your comments. It's helpful.

This issue came from view setting in my vimrc
set viewoptions=folds,options,cursor,unix,slash
set viewdir=~/.vim/view
au BufWinLeave * silent! mkview
au BufWinEnter * silent! loadview

This issue disappeared once I rm ~/.vim/view/*, re-edit markdown file.

Thanks again.

Regards,
Steven.l

2011/5/31 ZyX <zyx.vim@gmail.com>:
> Reply to message «<leader> collision»,
> sent 18:12:20 31 May 2011, Tuesday
> by Steven Lee:
>
>> In my .vimrc,  I attempt to map ",,d" to a function call, see below:
>>
>> autocmd FileType markdown nmap <silent> ,,d :call <Sid>InsertMkdDate()<CR>
>>
>> But press ",,d", prompt E81: Using <SID> not in a script conext
> I cannot reproduce this, either with or without altering the mapleader.
>
> I can expect this error when markdown filetype is set, but not when you press
> ,,d. Does this function work when you call it manually using
>    :call <SNR>{sid}_InsertMkdDate()
> ? You can get {sid} value in the output of `scriptnames', if it is your only
> vimrc it will be 1, but if system vimrc is sourced before your it may be greater
> (I have 29, 1 for /etc/vimrc).
>
> And use nnoremap, not nmap.
>
>>
>> The issue might come from mapleader setting, it's let mapleader=',' in
>> my .vimrc.
> I do not see how can this be related. Try `verbose nmap ,,d` and see whether
> your mapping was defined and not overriden by some script. In any case, when you
> complain about problems, create a script that will show the problem that should
> work with `vim -u NONE'. If it is not a vim bug, then in most cases you will
> solve your problem while creating it.
>
> Original message:
>> Hi all,
>>
>> In my .vimrc,  I attempt to map ",,d" to a function call, see below:
>>
>> autocmd FileType markdown nmap <silent> ,,d :call <Sid>InsertMkdDate()<CR>
>>
>> But press ",,d", prompt E81: Using <SID> not in a script conext
>>
>> The issue might come from mapleader setting, it's let mapleader=',' in
>> my .vimrc.
>> Is there any way to resove this issue if I stick to let mapleader=','
>> and ,,d to call function?
>>
>> Thanks,
>> Steven.l
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: BufReadPost getfsize and scp

David wrote:
> On 18 Mai, 15:48, Charles Campbell<Charles.E.Campb...@nasa.gov>
> wrote:
>
>> I think v24i will now implement automatic large file handling via
>> scp/ftp. Please check my website again.
>>
> It is v5i, isn't it?
> But yes, it is working. Thank you very much!
>
> Another remark: there are two lines with [[[1 in them which cause the
> files to be named "LargeFile.vim [[[1" and "LargeFile.txt
> [[[1".
> is this an error on my side or just a folding typo?
>

Are you using vim 7.0? You really should update; vim is up to 7.3 now
(with 206 patches available).

Regards,
Chip Campbell

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

Reply to message «Re: Restore file from undo»,
sent 15:50:06 31 May 2011, Tuesday
by Vsevolod Velichko:

> Christian, thanks for your answer.
> Yes, all the files I've lost were created from scratch, so I suppose,
> that undofile contains all the file history (undolevels=1000 should be
> sufficient for every file).
If files are so small that undolevels=1000 is sufficient, maybe you should
retype them instead?

There are additional options: for ext* filesystems you may use extundelete
application and for every filesystem you may open its device as a file and
search for parts of the text you still remember. Before doing the latter, ask
somebody for application that is able to do the job, Vim is not a good option
for this. I once did something similar with grep.

And I guess you now know why people use backups. Mercurial+bitbucket.org or
something similar for your code can also serve for this need.

Original message:
> Hello,
>
> Christian, thanks for your answer.
> Yes, all the files I've lost were created from scratch, so I suppose,
> that undofile contains all the file history (undolevels=1000 should be
> sufficient for every file).
>
> ----
> Best wishes and have a nice day,
> Vsevolod Velichko
>
> 2011/5/31 Christian Brabandt <cblists@256bit.org>:
> > That would only work, if you had previously reloaded your whole buffer
> > using :e! and 'undoreload' was set to a negative number (or you file
> > contained less than that number of lines). If you know, the whole
> > file content was previously saved in your undofile and you'd like to
> > try out reloading your changes, let me know. I made a patch, that
> > enables you to force reloading the undo history, which you could try out
> > if you want. But that is not very useful by itself.
> >
> > regards,
> > Christian

Re: Different working directories in different tabs

On Tue, May 31, 2011 2:28 pm, Martin Lundberg wrote:
> I've read multiple times that you could have different working directories
> in different tabs and when testing it does work. I can't however find
> anything about this in the help docs. Is there nothing about it in the
> docs
> or is it a bug?

:h :lcd

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

diff --git a/src/ex_cmds.h b/src/ex_cmds.h
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -788,7 +788,7 @@
EX(CMD_rubyfile, "rubyfile", ex_rubyfile,
RANGE|FILE1|NEEDARG|CMDWIN),
EX(CMD_rundo, "rundo", ex_rundo,
- NEEDARG|EXTRA|XFILE),
+ BANG|NEEDARG|EXTRA|XFILE),
EX(CMD_rviminfo, "rviminfo", ex_viminfo,
BANG|FILE1|TRLBAR|CMDWIN),
EX(CMD_substitute, "substitute", do_sub,
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8551,7 +8551,7 @@
char_u hash[UNDO_HASH_SIZE];

u_compute_hash(hash);
- u_read_undo(eap->arg, hash, NULL);
+ u_read_undo(eap->arg, hash, NULL, eap->forceit);
}
#endif

diff --git a/src/fileio.c b/src/fileio.c
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2616,7 +2616,7 @@
char_u hash[UNDO_HASH_SIZE];

sha256_finish(&sha_ctx, hash);
- u_read_undo(NULL, hash, fname);
+ u_read_undo(NULL, hash, fname, FALSE);
}
#endif

diff --git a/src/proto/undo.pro b/src/proto/undo.pro
--- a/src/proto/undo.pro
+++ b/src/proto/undo.pro
@@ -9,7 +9,7 @@
void u_compute_hash __ARGS((char_u *hash));
char_u *u_get_undo_file_name __ARGS((char_u *buf_ffname, int reading));
void u_write_undo __ARGS((char_u *name, int forceit, buf_T *buf, char_u *hash));
-void u_read_undo __ARGS((char_u *name, char_u *hash, char_u *orig_name));
+void u_read_undo __ARGS((char_u *name, char_u *hash, char_u *orig_name, int force));
void u_undo __ARGS((int count));
void u_redo __ARGS((int count));
void undo_time __ARGS((long step, int sec, int file, int absolute));
diff --git a/src/undo.c b/src/undo.c
--- a/src/undo.c
+++ b/src/undo.c
@@ -1555,10 +1555,11 @@
* "hash[UNDO_HASH_SIZE]" must be the hash value of the buffer text.
*/
void
-u_read_undo(name, hash, orig_name)
+u_read_undo(name, hash, orig_name, force)
char_u *name;
char_u *hash;
char_u *orig_name;
+ int force; /* :rundo! */
{
char_u *file_name;
FILE *fp;
@@ -1675,8 +1676,9 @@
goto error;
}
line_count = (linenr_T)get4c(fp);
- if (memcmp(hash, read_hash, UNDO_HASH_SIZE) != 0
+ if ((memcmp(hash, read_hash, UNDO_HASH_SIZE) != 0
|| line_count != curbuf->b_ml.ml_line_count)
+ && !force)
{
if (p_verbose > 0 || name != NULL)
{On Tue, May 31, 2011 1:50 pm, Vsevolod Velichko wrote:
> Christian, thanks for your answer.
> Yes, all the files I've lost were created from scratch, so I suppose,
> that undofile contains all the file history (undolevels=1000 should be
> sufficient for every file).

Ok then here is a patch. It allows to use :rundo! to let vim read in any
undo file. You need to create a new empty file with more lines, than your
original file had, e.g. 1000 empty lines. Then do :rundo! original_file.un~
and you can move through the undo history using g- and g+ or using
the :earlier :later commands.
The histwin or gundo plugin may also come useful to see your different
undo branches.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Different working directories in different tabs

Hi,

I've read multiple times that you could have different working directories in different tabs and when testing it does work. I can't however find anything about this in the help docs. Is there nothing about it in the docs or is it a bug?

-Martin

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

Hello,

Christian, thanks for your answer.
Yes, all the files I've lost were created from scratch, so I suppose,
that undofile contains all the file history (undolevels=1000 should be
sufficient for every file).

----
Best wishes and have a nice day,
Vsevolod Velichko

2011/5/31 Christian Brabandt <cblists@256bit.org>:
> That would only work, if you had previously reloaded your whole buffer
> using :e! and 'undoreload' was set to a negative number (or you file
> contained less than that number of lines). If you know, the whole
> file content was previously saved in your undofile and you'd like to
> try out reloading your changes, let me know. I made a patch, that
> enables you to force reloading the undo history, which you could try out
> if you want. But that is not very useful by itself.
>
> regards,
> Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Any way to change cursor type when enter insert mode for terminal VIM on MAC?

Hi, All
 
I did a lot of serarch and seems mission is impossible. T_SI is not working on MAC. It's not so convinent to see same cursor in normal mode and insert mode.
 
Thanks!

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: highlight all words matching the word under the cursor

On 29.05.2011 11:31, Reuven Sayag wrote:
> Hi,
> I'm looking for a way to highlight words that match the word under the
> cursor.
> I tried to put in my vimrc the following:
> :autocmd CursorMoved *.cc,*.h,*.java exe printf('match IncSearch /\<%s
> \>/', expand('<cword>'))
>
> This works but it's a bit slow, and I don't really need it all the
> time, Can someone add some info about how to toggle this behavior on a
> function key (or a<Leader> h)?
>
> Thanks,
> Reuven.
>
Hi Reuven,

I have written a script that tries to mimic eclipse in this regard. I
have to say that it's not exactly as you want it because it highlights
in every filetype. But, I don't feel a slow down at all.

http://www.vim.org/scripts/script.php?script_id=1510

cu, Adam.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Syn region for VB syntax

Am 31.05.2011 10:35, schrieb Rajesh Kannan:
> G'Day,
>
> I put in the following couple of lines in vb syntax file.
>
> syn region vbSubFold start="^\c\s*\<sub\>" end="^\c\s*\<end\s*sub\>"
> transparent fold keepend
> syn region vbFunctionFold start="^\c\s*\<function\>"
> end="^\c\s*\<end\s*function\>" transparent fold keepend
>
> I set foldmethod=syntax in .vimrc and opened a vb file in vim.
> No folds were defined.
>
> Appreciate any pointers as to why this isn't working for me.
>
> --
> Kind Regards,
> Rajesh Kannan
> =============
> The best index to a person's character is
> a) how he treats people who can't do him any good and
> b) how he treats people who can't fight back.
> -- Abigail Van Buren
> =============

quick look at the $VIMRUNTIME/syntax/vb.vim file ...

"sub" and "function" are also defined with :syn-keyword,
they will take precedence over any syn-match, at least
at the very start of a line where both set of rules conflict
(your rules work with indented "sub" and "function").

--
Andy

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Restore file from undo

On Tue, May 31, 2011 12:23 am, Vsevolod Velichko wrote:
> Hello all!
>
> Please, help me with the following:
> I've accidentally lost the folder with source code I wrote, but I have
> vim undo-file for each file I've lost.
> However, when I try to create new file with the same name as it had
> before deletion, vim tells me that there's no undo/redo history.
>
> Is there any way to replay the history from undo-file to recreate all
> the files I had?
>
> Thanks in advance.

You can't. When reading the undo history, vim checks, that
the checksum between the undo-file and the current open file match and
that their line numbers are the same, if not, Vim will complain with
an error (if you have set verbose to a value larger than zero).

Even if you'd patch vim, to not check the hash size and number of lines
it wouldn't work, because the undo file does not contain the whole file
content, but only the content that changed between each file change.
So if you changed the source of vim, you could only recover the lines
that you actually changed, but all the lines that were not changed (and
therefore not recorded in the undofile) would still be lost.

That would only work, if you had previously reloaded your whole buffer
using :e! and 'undoreload' was set to a negative number (or you file
contained less than that number of lines). If you know, the whole
file content was previously saved in your undofile and you'd like to
try out reloading your changes, let me know. I made a patch, that
enables you to force reloading the undo history, which you could try out
if you want. But that is not very useful by itself.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Is vim 7.3 ready for compiling with ruby 1.9.2 support?

I found this post but it seems to relate to Windows vim/ruby?

http://groups.google.com/group/rubyinstaller/browse_thread/thread/946938ecd61b9454

Has anyone managed to compile VIM with Ruby 1.9.2 support on Mac Snow
Leopard?

thanks for any clues whatsoever :) !

On May 28, 12:21 pm, Ned <rails.n...@gmail.com> wrote:
> I am having the same issue
>
>    ./configure --enable-rubyinterp --enable-gui=no --disable-gpm
>
> Works ok... and I can see this in the make step output ...
>
>    checking --enable-rubyinterp argument... yes
>    checking --with-ruby-command argument... defaulting toruby
>    checking forruby... (cached) /usr/local/bin/ruby
>    checkingRubyversion... OK
>    checkingRubyheader files... /usr/local/Cellar/ruby/1.9.2-p180/
> include/ruby-1.9.1
>
> Make/install works without incident. But then...
>
>    vim --version | grepruby
>    +printer -profile -python +quickfix +reltime -rightleft -ruby
> +scrollbind
>
> So there was an issue. But I cannot see anything reported during the
> configure/make step?
>
> Have double checked I am running the correct vim command, too.
>
> My vim73/src/auto/config.mk file looks like this:
>
>    RUBY   = /usr/local/bin/ruby
>    RUBY_SRC  = if_ruby.c
>    RUBY_OBJ  = objects/if_ruby.o
>    RUBY_PRO  = if_ruby.pro
>    RUBY_CFLAGS = -I/usr/local/Cellar/ruby/1.9.2-p180/include/ruby-1.9.1 -I/usr/local/Cellar/ruby/1.9.2-p180/include/ruby-1.9.1/
> x86_64-darwin10.7.0 -DRUBY_VE
>    RUBY_LIBS = -lruby.1.9.1 -lpthread -ldl -lobjc
>
> Any ideas?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Some questions about using VIM on MAC

I tried the latest snapshot57 from MACPort first. However, it's not a complete version. It doesn't support cscope. I have to change back to the relase version. Is there any complete version of latest snapshot?

BTW, change the curser in terminal VIM for insert mode is impossible? It works well on Windows.

2011/5/31 bjorn.winckler <bjorn.winckler@gmail.com>
On May 31, 5:44 am, wei gao <njugao...@gmail.com> wrote:
>
> I tried MacVim and it works great for me. However, I have a problem. I need
> to execute a script when start MacVim. On windows, I'm using event GUIEnter.
> But, it seems not working for MacVim. And if I start MacVim from terminal, I
> always get this message:
> 2011-05-31 11:34:41.816 MacVim[52819:903] -[SUHost sharedFrameworksPath]:
> unrecognized selector sent to instance 0x103802920
> 2011-05-31 11:34:41.818 MacVim[52819:903] -[SUHost sharedFrameworksPath]:
> unrecognized selector sent to instance 0x103802920
>
> Do you know this issue?

Try updating to the latest snapshot [1] and delete all other versions
of MacVim from your computer.

Björn

[1] https://github.com/b4winckler/macvim/wiki/ChangeLog

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: collision

Reply to message «<leader> collision»,
sent 18:12:20 31 May 2011, Tuesday
by Steven Lee:

> In my .vimrc, I attempt to map ",,d" to a function call, see below:
>
> autocmd FileType markdown nmap <silent> ,,d :call <Sid>InsertMkdDate()<CR>
>
> But press ",,d", prompt E81: Using <SID> not in a script conext
I cannot reproduce this, either with or without altering the mapleader.

I can expect this error when markdown filetype is set, but not when you press
,,d. Does this function work when you call it manually using
:call <SNR>{sid}_InsertMkdDate()
? You can get {sid} value in the output of `scriptnames', if it is your only
vimrc it will be 1, but if system vimrc is sourced before your it may be greater
(I have 29, 1 for /etc/vimrc).

And use nnoremap, not nmap.

>
> The issue might come from mapleader setting, it's let mapleader=',' in
> my .vimrc.
I do not see how can this be related. Try `verbose nmap ,,d` and see whether
your mapping was defined and not overriden by some script. In any case, when you
complain about problems, create a script that will show the problem that should
work with `vim -u NONE'. If it is not a vim bug, then in most cases you will
solve your problem while creating it.

Original message:
> Hi all,
>
> In my .vimrc, I attempt to map ",,d" to a function call, see below:
>
> autocmd FileType markdown nmap <silent> ,,d :call <Sid>InsertMkdDate()<CR>
>
> But press ",,d", prompt E81: Using <SID> not in a script conext
>
> The issue might come from mapleader setting, it's let mapleader=',' in
> my .vimrc.
> Is there any way to resove this issue if I stick to let mapleader=','
> and ,,d to call function?
>
> Thanks,
> Steven.l

Syn region for VB syntax

G'Day,

I put in the following couple of lines in vb syntax file.

syn region vbSubFold start="^\c\s*\<sub\>" end="^\c\s*\<end\s*sub\>" transparent fold keepend
syn region vbFunctionFold start="^\c\s*\<function\>" end="^\c\s*\<end\s*function\>" transparent fold keepend

I set foldmethod=syntax in .vimrc and opened a vb file in vim.
No folds were defined.

Appreciate any pointers as to why this isn't working for me.

--
Kind Regards,
Rajesh Kannan
=============
The best index to a person's character is
a) how he treats people who can't do him any good and
b) how he treats people who can't fight back.
                        -- Abigail Van Buren
=============


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Some questions about using VIM on MAC

On May 31, 5:44 am, wei gao <njugao...@gmail.com> wrote:
>
> I tried MacVim and it works great for me. However, I have a problem. I need
> to execute a script when start MacVim. On windows, I'm using event GUIEnter.
> But, it seems not working for MacVim. And if I start MacVim from terminal, I
> always get this message:
> 2011-05-31 11:34:41.816 MacVim[52819:903] -[SUHost sharedFrameworksPath]:
> unrecognized selector sent to instance 0x103802920
> 2011-05-31 11:34:41.818 MacVim[52819:903] -[SUHost sharedFrameworksPath]:
> unrecognized selector sent to instance 0x103802920
>
> Do you know this issue?

Try updating to the latest snapshot [1] and delete all other versions
of MacVim from your computer.

Björn

[1] https://github.com/b4winckler/macvim/wiki/ChangeLog

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Monday, May 30, 2011

Re: Some questions about using VIM on MAC

I find one issue. I should start from mvim script. The GUIEnter is triggered successfully. However the error is still on the UI. Seems it's as expected as described in the script.

2011/5/31 wei gao <njugaowei@gmail.com>
Thanks,

I tried MacVim and it works great for me. However, I have a problem. I need to execute a script when start MacVim. On windows, I'm using event GUIEnter. But, it seems not working for MacVim. And if I start MacVim from terminal, I always get this message:
2011-05-31 11:34:41.816 MacVim[52819:903] -[SUHost sharedFrameworksPath]: unrecognized selector sent to instance 0x103802920
2011-05-31 11:34:41.818 MacVim[52819:903] -[SUHost sharedFrameworksPath]: unrecognized selector sent to instance 0x103802920

Do you know this issue?


2011/5/31 Alessandro Antonello <antonello.ale@gmail.com>
Hi, Wei.

> Hi, All
>
> I'm using VIM 7.2 on MAC. And I have 2 questions:
> 1. Could I change mouse icon in normal mode and insert mode. By default, the
> mouse icon is the sam in both normal and insert mode which could be a litte
> confuse. Could we make it different as on Window.

In terminal or not? Did you mean the cursor icon? Are you using MacVim? I'm
using MacVim for a while and I have different cursors for normal and insert
mode. But just on GUI version. In the terminal version the cursor is always
the same.

> 2. Seems 'set autochdir' is not working on MAC's VIM 7.2. Any work around to
> make sure the working directory is changed we I switch between buffers. I
> think I need add a autocmd when BufferEnter happened.

You should give a try to MacVim 7.3. It should solve that issue too.

Regards,
Alessandro

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Rails plugin menu

On Fri, 2011-05-27 at 17:38 -0700, LuisC wrote:
>
> I'am new to VIM. I would like to try VIM as IDE for Rails 3.0.7/
> Ruby1.9.2 on Windows XP Pro SP3. I Installed Cream 0.43 (Vim
> 7.3.107) and later installed rails.vim plugin. The problem is that
> there is a plugin menu for Rails while using Cream an Vim Easy, but
> using gVim, there is no menu!!! I want/need to use gVim because a
> want to use the ruby debugger plugin and I need to start it via ":" vi
> command (I have not found a way to start tge debugger (:Rdebugger) on
> Cream/Vim Easy.

You probably want to try the plugin in regular Vim, not Vim with
Cream. Most plugins assume a plain Vim setup and stumble on
customizations. (Cream sets numerous Vim features to non-default
settings, including menus.)


--
Steve Hall [ digitect dancingpaper com ]


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Some questions about using VIM on MAC

Thanks,

I tried MacVim and it works great for me. However, I have a problem. I need to execute a script when start MacVim. On windows, I'm using event GUIEnter. But, it seems not working for MacVim. And if I start MacVim from terminal, I always get this message:
2011-05-31 11:34:41.816 MacVim[52819:903] -[SUHost sharedFrameworksPath]: unrecognized selector sent to instance 0x103802920
2011-05-31 11:34:41.818 MacVim[52819:903] -[SUHost sharedFrameworksPath]: unrecognized selector sent to instance 0x103802920

Do you know this issue?

2011/5/31 Alessandro Antonello <antonello.ale@gmail.com>
Hi, Wei.

> Hi, All
>
> I'm using VIM 7.2 on MAC. And I have 2 questions:
> 1. Could I change mouse icon in normal mode and insert mode. By default, the
> mouse icon is the sam in both normal and insert mode which could be a litte
> confuse. Could we make it different as on Window.

In terminal or not? Did you mean the cursor icon? Are you using MacVim? I'm
using MacVim for a while and I have different cursors for normal and insert
mode. But just on GUI version. In the terminal version the cursor is always
the same.

> 2. Seems 'set autochdir' is not working on MAC's VIM 7.2. Any work around to
> make sure the working directory is changed we I switch between buffers. I
> think I need add a autocmd when BufferEnter happened.

You should give a try to MacVim 7.3. It should solve that issue too.

Regards,
Alessandro

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Problems with multi-line echo on autocommand

Hello,

Normally, when I ask vim to echo multiple lines of text (as in echo
"Test 1"|echo "Test 2"|echo "Test 3"|echo "Test 4"), it shows all of
them, and asks me to press enter to continue. I've been working on a
plugin in which I want vim to echo multiple lines of text in this
fashion under certain circumstances when an autocommand event is
triggered. However, when I do this, I find that vim only shows the
last line of text.

For instance, if I enter:
autocmd  CursorMoved * echo "Test 1"|echo "Test 2"|echo "Test 3"|echo "Test 4"

And then move my cursor, vim displays "Test 4". Is there any way
around this? (I am using vim 7.3).

Many thanks,
Daniel

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Some questions about using VIM on MAC

Hi, Wei.

> Hi, All
>
> I'm using VIM 7.2 on MAC. And I have 2 questions:
> 1. Could I change mouse icon in normal mode and insert mode. By default, the
> mouse icon is the sam in both normal and insert mode which could be a litte
> confuse. Could we make it different as on Window.

In terminal or not? Did you mean the cursor icon? Are you using MacVim? I'm
using MacVim for a while and I have different cursors for normal and insert
mode. But just on GUI version. In the terminal version the cursor is always
the same.

> 2. Seems 'set autochdir' is not working on MAC's VIM 7.2. Any work around to
> make sure the working directory is changed we I switch between buffers. I
> think I need add a autocmd when BufferEnter happened.

You should give a try to MacVim 7.3. It should solve that issue too.

Regards,
Alessandro

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Restore file from undo

Hello all!

Please, help me with the following:
I've accidentally lost the folder with source code I wrote, but I have
vim undo-file for each file I've lost.
However, when I try to create new file with the same name as it had
before deletion, vim tells me that there's no undo/redo history.

Is there any way to replay the history from undo-file to recreate all
the files I had?

Thanks in advance.

----
Best wishes and have a nice day,
Vsevolod Velichko

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Searching for accented characters.

diff -r e9538cfd0d9c runtime/doc/pattern.txt
--- a/runtime/doc/pattern.txt Wed May 25 21:18:06 2011 +0200
+++ b/runtime/doc/pattern.txt Mon May 30 23:46:47 2011 +0200
@@ -1038,8 +1038,6 @@
have almost the same meaning, e.g., when ignoring accents. The form
is:
[=a=]
- Currently this is only implemented for latin1. Also works for the
- latin1 characters in utf-8 and latin9.
*/[[.* *[..]*
- A collation element. This currently simply accepts a single
character in the form:
diff -r e9538cfd0d9c src/regexp.c
--- a/src/regexp.c Wed May 25 21:18:06 2011 +0200
+++ b/src/regexp.c Mon May 30 23:46:47 2011 +0200
@@ -666,8 +666,10 @@
static void regc __ARGS((int b));
#ifdef FEAT_MBYTE
static void regmbc __ARGS((int c));
+# define REGMBC(x) regmbc(x)
#else
# define regmbc(c) regc(c)
+# define REGMBC(x) ((void)0)
#endif
static void reginsert __ARGS((int, char_u *));
static void reginsert_limits __ARGS((int, long, long, char_u *));
@@ -784,71 +786,300 @@
}
}
#else
+# ifdef FEAT_MBYTE
+# define CASEMBC(x) case x:
+# else
+# define CASEMBC(x)
+# endif
switch (c)
{
case 'A': case '\300': case '\301': case '\302':
+ CASEMBC(0x100) CASEMBC(0x102) CASEMBC(0x104) CASEMBC(0x1cd)
+ CASEMBC(0x1de) CASEMBC(0x1e0) CASEMBC(0x1ea2)
case '\303': case '\304': case '\305':
regmbc('A'); regmbc('\300'); regmbc('\301');
regmbc('\302'); regmbc('\303'); regmbc('\304');
regmbc('\305');
+ REGMBC(0x100); REGMBC(0x102); REGMBC(0x104);
+ REGMBC(0x1cd); REGMBC(0x1de); REGMBC(0x1e0);
+ REGMBC(0x1ea2);
+ return;
+ case 'B': CASEMBC(0x1e02) CASEMBC(0x1e06)
+ regmbc('B'); REGMBC(0x1e02); REGMBC(0x1e06);
return;
case 'C': case '\307':
+ CASEMBC(0x106) CASEMBC(0x108) CASEMBC(0x10a) CASEMBC(0x10c)
regmbc('C'); regmbc('\307');
+ REGMBC(0x106); REGMBC(0x108); REGMBC(0x10a);
+ REGMBC(0x10c);
+ return;
+ case 'D': CASEMBC(0x10e) CASEMBC(0x110) CASEMBC(0x1e0a)
+ CASEMBC(0x1e0e) CASEMBC(0x1e10)
+ regmbc('D'); REGMBC(0x10e); REGMBC(0x110);
+ REGMBC(0x1e0a); REGMBC(0x1e0e); REGMBC(0x1e10);
return;
case 'E': case '\310': case '\311': case '\312': case '\313':
+ CASEMBC(0x112) CASEMBC(0x114) CASEMBC(0x116) CASEMBC(0x118)
+ CASEMBC(0x11a) CASEMBC(0x1eba) CASEMBC(0x1ebc)
regmbc('E'); regmbc('\310'); regmbc('\311');
regmbc('\312'); regmbc('\313');
+ REGMBC(0x112); REGMBC(0x114); REGMBC(0x116);
+ REGMBC(0x118); REGMBC(0x11a); REGMBC(0x1eba);
+ REGMBC(0x1ebc);
+ return;
+ case 'F': CASEMBC(0x1e1e)
+ regmbc('F'); REGMBC(0x1e1e);
+ return;
+ case 'G': CASEMBC(0x11c) CASEMBC(0x11e) CASEMBC(0x120)
+ CASEMBC(0x122) CASEMBC(0x1e4) CASEMBC(0x1e6) CASEMBC(0x1f4)
+ CASEMBC(0x1e20)
+ regmbc('G'); REGMBC(0x11c); REGMBC(0x11e);
+ REGMBC(0x120); REGMBC(0x122); REGMBC(0x1e4);
+ REGMBC(0x1e6); REGMBC(0x1f4); REGMBC(0x1e20);
+ return;
+ case 'H': CASEMBC(0x124) CASEMBC(0x126) CASEMBC(0x1e22)
+ CASEMBC(0x1e26) CASEMBC(0x1e28)
+ regmbc('H'); REGMBC(0x124); REGMBC(0x126);
+ REGMBC(0x1e22); REGMBC(0x1e26); REGMBC(0x1e28);
return;
case 'I': case '\314': case '\315': case '\316': case '\317':
+ CASEMBC(0x128) CASEMBC(0x12a) CASEMBC(0x12c) CASEMBC(0x12e)
+ CASEMBC(0x130) CASEMBC(0x1cf) CASEMBC(0x1ec8)
regmbc('I'); regmbc('\314'); regmbc('\315');
regmbc('\316'); regmbc('\317');
+ REGMBC(0x128); REGMBC(0x12a); REGMBC(0x12c);
+ REGMBC(0x12e); REGMBC(0x130); REGMBC(0x1cf);
+ REGMBC(0x1ec8);
+ return;
+ case 'J': CASEMBC(0x134)
+ regmbc('J'); REGMBC(0x134);
+ return;
+ case 'K': CASEMBC(0x136) CASEMBC(0x1e8) CASEMBC(0x1e30)
+ CASEMBC(0x1e34)
+ regmbc('K'); REGMBC(0x136); REGMBC(0x1e8);
+ REGMBC(0x1e30); REGMBC(0x1e34);
+ return;
+ case 'L': CASEMBC(0x139) CASEMBC(0x13b) CASEMBC(0x13d)
+ CASEMBC(0x13f) CASEMBC(0x141) CASEMBC(0x1e3a)
+ regmbc('L'); REGMBC(0x139); REGMBC(0x13b);
+ REGMBC(0x13d); REGMBC(0x13f); REGMBC(0x141);
+ REGMBC(0x1e3a);
+ return;
+ case 'M': CASEMBC(0x1e3e) CASEMBC(0x1e40)
+ regmbc('M'); REGMBC(0x1e3e); REGMBC(0x1e40);
return;
case 'N': case '\321':
+ CASEMBC(0x143) CASEMBC(0x145) CASEMBC(0x147) CASEMBC(0x1e44)
+ CASEMBC(0x1e48)
regmbc('N'); regmbc('\321');
+ REGMBC(0x143); REGMBC(0x145); REGMBC(0x147);
+ REGMBC(0x1e44); REGMBC(0x1e48);
return;
case 'O': case '\322': case '\323': case '\324': case '\325':
- case '\326':
+ case '\326': case '\330':
+ CASEMBC(0x14c) CASEMBC(0x14e) CASEMBC(0x150) CASEMBC(0x1a0)
+ CASEMBC(0x1d1) CASEMBC(0x1ea) CASEMBC(0x1ec) CASEMBC(0x1ece)
regmbc('O'); regmbc('\322'); regmbc('\323');
regmbc('\324'); regmbc('\325'); regmbc('\326');
+ regmbc('\330');
+ REGMBC(0x14c); REGMBC(0x14e); REGMBC(0x150);
+ REGMBC(0x1a0); REGMBC(0x1d1); REGMBC(0x1ea);
+ REGMBC(0x1ec); REGMBC(0x1ece);
+ return;
+ case 'P': case 0x1e54: case 0x1e56:
+ regmbc('P'); REGMBC(0x1e54); REGMBC(0x1e56);
+ return;
+ case 'R': CASEMBC(0x154) CASEMBC(0x156) CASEMBC(0x158)
+ CASEMBC(0x1e58) CASEMBC(0x1e5e)
+ regmbc('R'); REGMBC(0x154); REGMBC(0x156); REGMBC(0x158);
+ REGMBC(0x1e58); REGMBC(0x1e5e);
+ return;
+ case 'S': CASEMBC(0x15a) CASEMBC(0x15c) CASEMBC(0x15e)
+ CASEMBC(0x160) CASEMBC(0x1e60)
+ regmbc('S'); REGMBC(0x15a); REGMBC(0x15c);
+ REGMBC(0x15e); REGMBC(0x160); REGMBC(0x1e60);
+ return;
+ case 'T': CASEMBC(0x162) CASEMBC(0x164) CASEMBC(0x166)
+ CASEMBC(0x1e6a) CASEMBC(0x1e6e)
+ regmbc('T'); REGMBC(0x162); REGMBC(0x164);
+ REGMBC(0x166); REGMBC(0x1e6a); REGMBC(0x1e6e);
return;
case 'U': case '\331': case '\332': case '\333': case '\334':
+ CASEMBC(0x168) CASEMBC(0x16a) CASEMBC(0x16c) CASEMBC(0x16e)
+ CASEMBC(0x170) CASEMBC(0x172) CASEMBC(0x1af) CASEMBC(0x1d3)
+ CASEMBC(0x1ee6)
regmbc('U'); regmbc('\331'); regmbc('\332');
regmbc('\333'); regmbc('\334');
+ REGMBC(0x168); REGMBC(0x16a); REGMBC(0x16c);
+ REGMBC(0x16e); REGMBC(0x170); REGMBC(0x172);
+ REGMBC(0x1af); REGMBC(0x1d3); REGMBC(0x1ee6);
+ return;
+ case 'V': CASEMBC(0x1e7c)
+ regmbc('V'); REGMBC(0x1e7c);
+ return;
+ case 'W': CASEMBC(0x174) CASEMBC(0x1e80) CASEMBC(0x1e82)
+ CASEMBC(0x1e84) CASEMBC(0x1e86)
+ regmbc('W'); REGMBC(0x174); REGMBC(0x1e80);
+ REGMBC(0x1e82); REGMBC(0x1e84); REGMBC(0x1e86);
return;
case 'Y': case '\335':
+ CASEMBC(0x176) CASEMBC(0x178) CASEMBC(0x1e8e) CASEMBC(0x1ef2)
+ CASEMBC(0x1ef6) CASEMBC(0x1ef8)
regmbc('Y'); regmbc('\335');
+ REGMBC(0x176); REGMBC(0x178); REGMBC(0x1e8e);
+ REGMBC(0x1ef2); REGMBC(0x1ef6); REGMBC(0x1ef8);
+ return;
+ case 'Z': CASEMBC(0x179) CASEMBC(0x17b) CASEMBC(0x17d)
+ CASEMBC(0x1b5) CASEMBC(0x1e90) CASEMBC(0x1e94)
+ regmbc('Z'); REGMBC(0x179); REGMBC(0x17b);
+ REGMBC(0x17d); REGMBC(0x1b5); REGMBC(0x1e90);
+ REGMBC(0x1e94);
return;
case 'a': case '\340': case '\341': case '\342':
case '\343': case '\344': case '\345':
+ CASEMBC(0x101) CASEMBC(0x103) CASEMBC(0x105) CASEMBC(0x1ce)
+ CASEMBC(0x1df) CASEMBC(0x1e1) CASEMBC(0x1ea3)
regmbc('a'); regmbc('\340'); regmbc('\341');
regmbc('\342'); regmbc('\343'); regmbc('\344');
regmbc('\345');
+ REGMBC(0x101); REGMBC(0x103); REGMBC(0x105);
+ REGMBC(0x1ce); REGMBC(0x1df); REGMBC(0x1e1);
+ REGMBC(0x1ea3);
+ return;
+ case 'b': CASEMBC(0x1e03) CASEMBC(0x1e07)
+ regmbc('b'); REGMBC(0x1e03); REGMBC(0x1e07);
return;
case 'c': case '\347':
+ CASEMBC(0x107) CASEMBC(0x109) CASEMBC(0x10b) CASEMBC(0x10d)
regmbc('c'); regmbc('\347');
+ REGMBC(0x107); REGMBC(0x109); REGMBC(0x10b);
+ REGMBC(0x10d);
+ return;
+ case 'd': CASEMBC(0x10f) CASEMBC(0x111) CASEMBC(0x1d0b)
+ CASEMBC(0x1e11)
+ regmbc('d'); REGMBC(0x10f); REGMBC(0x111);
+ REGMBC(0x1e0b); REGMBC(0x01e0f); REGMBC(0x1e11);
return;
case 'e': case '\350': case '\351': case '\352': case '\353':
+ CASEMBC(0x113) CASEMBC(0x115) CASEMBC(0x117) CASEMBC(0x119)
+ CASEMBC(0x11b) CASEMBC(0x1ebb) CASEMBC(0x1ebd)
regmbc('e'); regmbc('\350'); regmbc('\351');
regmbc('\352'); regmbc('\353');
+ REGMBC(0x113); REGMBC(0x115); REGMBC(0x117);
+ REGMBC(0x119); REGMBC(0x11b); REGMBC(0x1ebb);
+ REGMBC(0x1ebd);
+ return;
+ case 'f': CASEMBC(0x1e1f)
+ regmbc('f'); REGMBC(0x1e1f);
+ return;
+ case 'g': CASEMBC(0x11d) CASEMBC(0x11f) CASEMBC(0x121)
+ CASEMBC(0x123) CASEMBC(0x1e5) CASEMBC(0x1e7) CASEMBC(0x1f5)
+ CASEMBC(0x1e21)
+ regmbc('g'); REGMBC(0x11d); REGMBC(0x11f);
+ REGMBC(0x121); REGMBC(0x123); REGMBC(0x1e5);
+ REGMBC(0x1e7); REGMBC(0x1f5); REGMBC(0x1e21);
+ return;
+ case 'h': CASEMBC(0x125) CASEMBC(0x127) CASEMBC(0x1e23)
+ CASEMBC(0x1e27) CASEMBC(0x1e29) CASEMBC(0x1e96)
+ regmbc('h'); REGMBC(0x125); REGMBC(0x127);
+ REGMBC(0x1e23); REGMBC(0x1e27); REGMBC(0x1e29);
+ REGMBC(0x1e96);
return;
case 'i': case '\354': case '\355': case '\356': case '\357':
+ CASEMBC(0x129) CASEMBC(0x12b) CASEMBC(0x12d) CASEMBC(0x12f)
+ CASEMBC(0x1d0) CASEMBC(0x1ec9)
regmbc('i'); regmbc('\354'); regmbc('\355');
regmbc('\356'); regmbc('\357');
+ REGMBC(0x129); REGMBC(0x12b); REGMBC(0x12d);
+ REGMBC(0x12f); REGMBC(0x1d0); REGMBC(0x1ec9);
+ return;
+ case 'j': CASEMBC(0x135) CASEMBC(0x1f0)
+ regmbc('j'); REGMBC(0x135); REGMBC(0x1f0);
+ return;
+ case 'k': CASEMBC(0x137) CASEMBC(0x1e9) CASEMBC(0x1e31)
+ CASEMBC(0x1e35)
+ regmbc('k'); REGMBC(0x137); REGMBC(0x1e9);
+ REGMBC(0x1e31); REGMBC(0x1e35);
+ return;
+ case 'l': CASEMBC(0x13a) CASEMBC(0x13c) CASEMBC(0x13e)
+ CASEMBC(0x140) CASEMBC(0x142) CASEMBC(0x1e3b)
+ regmbc('l'); REGMBC(0x13a); REGMBC(0x13c);
+ REGMBC(0x13e); REGMBC(0x140); REGMBC(0x142);
+ REGMBC(0x1e3b);
+ return;
+ case 'm': CASEMBC(0x1e3f) CASEMBC(0x1e41)
+ regmbc('m'); REGMBC(0x1e3f); REGMBC(0x1e41);
return;
case 'n': case '\361':
+ CASEMBC(0x144) CASEMBC(0x146) CASEMBC(0x148) CASEMBC(0x149)
+ CASEMBC(0x1e45) CASEMBC(0x1e49)
regmbc('n'); regmbc('\361');
+ REGMBC(0x144); REGMBC(0x146); REGMBC(0x148);
+ REGMBC(0x149); REGMBC(0x1e45); REGMBC(0x1e49);
return;
case 'o': case '\362': case '\363': case '\364': case '\365':
- case '\366':
+ case '\366': case '\370':
+ CASEMBC(0x14d) CASEMBC(0x14f) CASEMBC(0x151) CASEMBC(0x1a1)
+ CASEMBC(0x1d2) CASEMBC(0x1eb) CASEMBC(0x1ed) CASEMBC(0x1ecf)
regmbc('o'); regmbc('\362'); regmbc('\363');
regmbc('\364'); regmbc('\365'); regmbc('\366');
+ regmbc('\370');
+ REGMBC(0x14d); REGMBC(0x14f); REGMBC(0x151);
+ REGMBC(0x1a1); REGMBC(0x1d2); REGMBC(0x1eb);
+ REGMBC(0x1ed); REGMBC(0x1ecf);
+ return;
+ case 'p': CASEMBC(0x1e55) CASEMBC(0x1e57)
+ regmbc('p'); REGMBC(0x1e55); REGMBC(0x1e57);
+ return;
+ case 'r': CASEMBC(0x155) CASEMBC(0x157) CASEMBC(0x159)
+ CASEMBC(0x1e59) CASEMBC(0x1e5f)
+ regmbc('r'); REGMBC(0x155); REGMBC(0x157); REGMBC(0x159);
+ REGMBC(0x1e59); REGMBC(0x1e5f);
+ return;
+ case 's': CASEMBC(0x15b) CASEMBC(0x15d) CASEMBC(0x15f)
+ CASEMBC(0x161) CASEMBC(0x1e61)
+ regmbc('s'); REGMBC(0x15b); REGMBC(0x15d);
+ REGMBC(0x15f); REGMBC(0x161); REGMBC(0x1e61);
+ return;
+ case 't': CASEMBC(0x163) CASEMBC(0x165) CASEMBC(0x167)
+ CASEMBC(0x1e6b) CASEMBC(0x1e6f) CASEMBC(0x1e97)
+ regmbc('t'); REGMBC(0x163); REGMBC(0x165); REGMBC(0x167);
+ REGMBC(0x1e6b); REGMBC(0x1e6f); REGMBC(0x1e97);
return;
case 'u': case '\371': case '\372': case '\373': case '\374':
+ CASEMBC(0x169) CASEMBC(0x16b) CASEMBC(0x16d) CASEMBC(0x16f)
+ CASEMBC(0x171) CASEMBC(0x173) CASEMBC(0x1b0) CASEMBC(0x1d4)
+ CASEMBC(0x1ee7)
regmbc('u'); regmbc('\371'); regmbc('\372');
regmbc('\373'); regmbc('\374');
+ REGMBC(0x169); REGMBC(0x16b); REGMBC(0x16d);
+ REGMBC(0x16f); REGMBC(0x171); REGMBC(0x173);
+ REGMBC(0x1b0); REGMBC(0x1d4); REGMBC(0x1ee7);
+ return;
+ case 'v': CASEMBC(0x1e7d)
+ regmbc('v'); REGMBC(0x1e7d);
+ return;
+ case 'w': CASEMBC(0x175) CASEMBC(0x1e81) CASEMBC(0x1e83)
+ CASEMBC(0x1e85) CASEMBC(0x1e87) CASEMBC(0x1e98)
+ regmbc('w'); REGMBC(0x175); REGMBC(0x1e81);
+ REGMBC(0x1e83); REGMBC(0x1e85); REGMBC(0x1e87);
+ REGMBC(0x1e98);
+ return;
+ case 'x': CASEMBC(0x1e8b) CASEMBC(0x1e8d)
+ regmbc('x'); REGMBC(0x1e8b); REGMBC(0x1e8d);
return;
case 'y': case '\375': case '\377':
+ CASEMBC(0x177) CASEMBC(0x1e8f) CASEMBC(0x1e99)
+ CASEMBC(0x1ef3) CASEMBC(0x1ef7) CASEMBC(0x1ef9)
regmbc('y'); regmbc('\375'); regmbc('\377');
+ REGMBC(0x177); REGMBC(0x1e8f); REGMBC(0x1e99);
+ REGMBC(0x1ef3); REGMBC(0x1ef7); REGMBC(0x1ef9);
+ return;
+ case 'z': CASEMBC(0x17a) CASEMBC(0x17c) CASEMBC(0x17e)
+ CASEMBC(0x1b6) CASEMBC(0x1e91) CASEMBC(0x1e95)
+ regmbc('z'); REGMBC(0x17a); REGMBC(0x17c);
+ REGMBC(0x17e); REGMBC(0x1b6); REGMBC(0x1e91);
+ REGMBC(0x1e95);
return;
}
#endif
@@ -2468,6 +2699,8 @@
regmbc(c)
int c;
{
+ if (!enc_utf8)
+ return;
if (regcode == JUST_CALC_SIZE)
regsize += (*mb_char2len)(c);
else
@@ -2588,7 +2821,7 @@
else
offset = (int)(val - scan);
/* When the offset uses more than 16 bits it can no longer fit in the two
- * bytes avaliable. Use a global flag to avoid having to check return
+ * bytes available. Use a global flag to avoid having to check return
* values in too many places. */
if (offset > 0xffff)
reg_toolong = TRUE;
Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:

> On 30/05/11 09:58, Jürgen Krämer wrote:
>>
>> Hi,
>>
>> Beren Sanders wrote:
>>>
>>> On Sun, May 29, 2011 at 8:25 PM, Tim Chase<vim@tim.thechases.com>  wrote:
>>>>
>>>> On 05/29/2011 06:43 PM, Beren Sanders wrote:
>>>>>
>>>>> Is there an easy standard way to make accented characters match
>>>>> searches
>>>>> for
>>>>> their normal counterparts?
>>>>>
>>>>> For example, I obtain "é" by typing "<CTRL>-k ' e" and I would like to
>>>>> set
>>>>> it up so that searching for "Ajoute" will match both "Ajoute" and
>>>>> "Ajouté".
>>>>
>>>> It sounds like you might want Vim's equivalence classes:
>>>>
>>>>  /Ajout[[=e=]]
>>>>
>>>> which you can read about at
>>>>
>>>>  :help /[[=
>>>>
>>>> Note the caveat about Latin1 vs. other encodings.
>>>>
>>>> -tim
>>>
>>> Thanks Tim. Do you (or someone else) know someway of making the
>>> equivalence class [[=e=]] the default interpretation of an 'e' in the
>>> search string? In other words, although it is great that [[=e=]]
>>> matches all the versions of 'e', it involves typing seven characters
>>> instead of just one.
>>>
>>
>> I don't know of any way to make equivalence classes the default
>> interpretation, but you can always define mappings to expand a letter
>> into its equivalence class, e.g.:
>>
>>   cnoremap<expr>  e getcmdtype() =~ '[?/]' ? '[[=e=]]' : 'e'
>>
>> If you really need an 'e' you have to press Ctrl-V before 'e' then.
>>
>> Regards,
>> Jürgen
>>
>
> Of course, if you want to do it that way, you'll have to do it for every
> equivalence class you'll possibly encounter, e.g. for French:
>
> a       [[=a=]]         aàâ
> A       [[=A=]]         AÀÂ
> c       [[=c=]]         cç
> C       [[=C=]]         cÇ
> e       [[=e=]]         eéêèë
> E       [[=E=]]         eÉÊÈË
> i       [[=i=]]         iîï
> I       [[=I=]]         IÎÏ
> o       [[=o=]]         oô
> O       [[=O=]]         OÔ
> u       [[=u=]]         uùûü
> U       [[=U=]]         uÙÛÜ
> y       [[=y=]]         yÿ
> Y       [[=Y=]]         YŸ

Actually, this last character...
LATIN CAPITAL LETTER Y WITH DIAERESIS
... won't be matched with /[[=Y=]] since it is not in the
latin1 range (only the lower case version is a latin1
character). The equivalent class [[=x=]] only works
for characters that fall into the latin1 range as
documented in ":help \[==\]".

But I've just written a patch that makes it work with
Unicode. Please try it and double check that it works
as expected.

I've also noticed what looked like a bug: the letter
LATIN CAPITAL LETTER O WITH STROKE
was not in the same class as O. So [[=O=]] didn't
match ø (0xd8). Same remark for
LATIN SMALL LETTER O WITH STROKE
which was not in the same class as letter 'o'
Proposed patch also fixes this issue.

Regards
-- Dominique

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php