Re: Esperanto dictionary

2007-04-04 Thread Hugh Sasse
On Wed, 4 Apr 2007, Cyril Slobin wrote:

 Seems like this letter doesn't reached the list. Reposting. I'm sorry
 if it appears twice.
 
 On 4/2/07, A.J.Mechelynck [EMAIL PROTECTED] wrote:
 
  Well, I suppose both uppercase and titlecase should be supported then. Cxu
 ne?
  CXU VERE NE? (Kompreneble, ??iukaze mi preferas verajn ??apelitajn
 literojn.)
 
 CXU, Cxu and cxu are all passed cheking, CXu doesn't. And I believe
 this is a Right Thing.

I'll concede this: I'm hardly an expert! :-)
 
  I suppose texts written in ??Fundamenta?? h-stilo could emphasise the
 radical
  break when needed, as in flug-haveno, chas-hundo, danc-halo, ktp. (er,
 etc.).
 
 Just checked -- translation table used by my plugin knows about
 flughaveno and chashundo, but not about danchalo. I don't write this
 table myself, but borrow it from UniRed (another opensource editor).
 Anyway you can easy add danchalo and any other such word in the table
 by yourself -- it is in simple text format.
 
 BTW x-style is not free from such problems. Pure Esperanto text is OK,
 but consider you use the word Linux in it!

:-)  Linukso, (tiel Vindozo, Unikso...) I think

http://fagot.alain.free.fr/KompLeks/UTF8/INDL.html
Hugh

Re: Esperanto dictionary

2007-04-03 Thread Hugh Sasse
On Mon, 2 Apr 2007, A.J.Mechelynck wrote:

 Cyril Slobin wrote:
  On 4/2/07, Hugh Sasse [EMAIL PROTECTED] wrote:

[Info about plugin trimmed. Thank you.

   Also isn't your example often written CXirkaux because the CX is
   (effectively) one character, capitalized?
  
  I've newer seen this form, and I believe it is ugly. And in unicode
  terms, this one character is not capitalized, but title-cased.

I've seen it used on the web, but it's net easy to search for :-).
  
 
 Well, I suppose both uppercase and titlecase should be supported then. Cxu ne?

I've not encountered titlecase before this thread, so I don't
understand its semantics yet.

 CXU VERE NE? (Kompreneble, ??iukaze mi preferas verajn ??apelitajn
 literojn.)
 
 I suppose texts written in ??Fundamenta?? h-stilo could emphasise the
 radical break when needed, as in flug-haveno, chas-hundo, danc-halo, ktp. (er,
 etc.). Anyway, I anticipate that all substitution schemes will become less and
 less necessary as Unicode generalizes: e.g., my fr_BE keyboard supports
 consonants with circumflex out of the box in openSUSE Linux 10.2 (thus going
 back to the universality of the French typewriters of Zamenhof's time ;-) ).

My problem is that I mainly work through Windows systems (often ssh into 
Solaris, but still) and I don't have a clue what to do with fonts for all
this, E.g. in PuTTY.  I'm not entirely clear how to do this in gvim for that
matter.  I've read some of the help on UTF8 but I'm still rather confused
being very much at the Beginner stage for this in terms of the Dreyfus
model of skills aquistion
http://www.pragmaticprogrammer.com/articles/cook_until_done.html
so if someone has a really gentle introduction to all this I'd be grateful.
I've noticed that Word stores things in UTF-16 (LOTS of nulls :-)) so
this should be achievable, but

 
 Best regards,
 Tony.

Thank you,
Hugh

Re: Esperanto dictionary

2007-04-03 Thread Hugh Sasse
On Tue, 3 Apr 2007, A.J.Mechelynck wrote:

 
 Some years ago, I wrote the chapter of the Vim FAQ about Unicode: browse to
 http://vimdoc.sourceforge.net/htmldoc/vimfaq.html and scroll to the last
 section, e.g. by searching the page for the string SECTION 37 (which happens
 twice, once in the table of contents and once at the head of the section
 itself).

Yes, there's good stuff there.  I'm not entirely sure how all those things
will interact but having them all together gives me scope for experimentation.
Thank you.

Hugh


Re: Esperanto dictionary

2007-04-02 Thread Hugh Sasse
On Sat, 31 Mar 2007, Cyril Slobin wrote:

 Hi all!
[...] 
 I have complied my own eo.utf-8.spl from ispell sources by Sergio
 Pokrovskij found in Debian 3.1 distribution. It understands both real
 Unicode and surrogate Cxirkaux-style (if you don't speak Esperanto,

It might be useful to also support C^irkau^ as well.  I'm not sure
how often the h form is used given the exception(s?) (flughaveno...)
Also isn't your example often written CXirkaux because the CX is 
(effectively) one character, capitalized?

Anyway, nice to see someone working on this stuff.  

Hugh



Re: Telnet commands from Vim ?

2007-03-02 Thread Hugh Sasse
On Thu, 1 Mar 2007, Eric Roberts wrote:

 A.J.Mechelynck wrote:
  Eric Roberts wrote:
   Hi,
   
   I'm interested in being able to send/recieve telnet messages. It's for a
   debugger that is used over telnet. I know this is a fairly esoteric
   problem, and as far as I can tell there's no direct way of doing this but
   I thought I'd might ask to be sure.
   If there isn't any direct support for this - what's the best method of
   extending Vim to do this? I've looked at the the vimsh plugin - which does
   nearly what I need it too, except interactive programs like the telnet
   client program on windows doesn't work.
   The gdbvim and the clewn project seem to demonstrate that is definately
   possible to communicate between different processes and Vim.
   
   I don't mind a learning curve, I'm just interested in where would I start?
   ;)
   
   Thanks for your time in advance,
   
   - Eric
   
  
  Why do you want to use Vim to send and receive telnet messages? Vim is a
  text editor, not a front-end for an interactive program like a shell (see
  :help shell-window) or the telnet program.
  
  Start gvim in one (MS-Windows) window and telnet from a Dos Box in another
  window, and you'll have Vim and telnet on the same screen.
  
  Or if you're dead set on launching interactive sessions in an editor window,
  use emacs (withing a Cygwin shell if necessary).
  
  
  Best regards,
  Tony.
 As stated above, it's for a telnet debugger. Vim is a programmer friendly text

I'd agree that this still seems like the wrong question :-)  Is the
debugger running on the same machine as vim?  Why does it use
telnet? Else, can you make it not do that, and [telnet to the remote
machine and ] just use the debugger with vim, without vim knowing
abut telnet, on the remote host?

Most vim use of things like :compiler and :make are non-interactive.
I think if you need to do this then you should use Expect, and/or
Perl/Ruby/???'s expect-like library to turn the telnet interaction
into something scripted and non-interactive.   Getting the
interaction right is about the trickiest part of using Expect-like
programs.

Maybe the debugger has an API so you can drive it programmatically?
That could save you some of the pain of handling interaction for
humans by machine.  Maybe someone knows about this debugger already,
and if you tell people what it is they can help better?

 editor and there seems to be a fair amount of effort to extend it to work with
 debuggers and I was curious about extending it to a specific one in my case. I
 would think that the existing extensions to use Vim with gdb would be somewhat
 analogous to my situation.
 
 - Eric
 
Hugh


Re: hi Comment guifg=white guibg=black in ~/.vimrc ignored

2007-03-01 Thread Hugh Sasse
On Thu, 1 Mar 2007, Alexander Farber wrote:

 Hello,
 
 I've spent several hours, but just can't figure out,
 why wouldn't Vim 7.0 on my english Win Xp Pro PC
 execute the highlight commands from my .vimrc.
 
 I'd like to have my Comments inverted and thus I have:
   hi Commentguifg=white  guibg=black

If I recall correctly, this will affect gvim, because
you have have used GUIfg and GUIbg (caps for emphasis).
What happens if you supplement these:

  hi Comment  ctermfg=white guifg=white ctermbg=black guibg=black

Then it should affect vim invoked from the command prompt, I think.
This is based on your talking about vim rather than gvim and not
discussing how you invoked it.  Sorry if this is irrelevant .

Hugh


Re: hi Comment guifg=white guibg=black in ~/.vimrc ignored

2007-03-01 Thread Hugh Sasse
On Thu, 1 Mar 2007, Alexander Farber wrote:

 no, unfortunately this doesn't change anything.
 I've had those in my ~/.vimrc originally:
[...] 

Then try 
:scriptnames
to see which scripts have been loaded in what order, that way
you'll have an idea what is picked up after your .vimrc and 
for the case of syntax files there are likely things which bend
your colourscheme to their will, so to speak.

And you might want to put the comment highlights in
%HOME%/vimfiles/after/syntax/something.vim

see the results of 

:set runtimepath?

for where this might be.

 Regards
 Alex
 
 
 -- 
 http://preferans.de
 



Re: hi Comment guifg=white guibg=black in ~/.vimrc ignored

2007-03-01 Thread Hugh Sasse
On Thu, 1 Mar 2007, Alexander Farber wrote:

 Hello Hugh,
 
 On 3/1/07, Hugh Sasse [EMAIL PROTECTED] wrote:
  :scriptnames
 
  1: C:\Documents and Settings\afarber\.vimrc
  2: C:\Program Files\Vim\vim70\syntax\syntax.vim
  3: C:\Program Files\Vim\vim70\syntax\synload.vim
  4: C:\Program Files\Vim\vim70\syntax\syncolor.vim
[...]
 18: C:\Program Files\Vim\vim70\syntax\actionscript.vim

Those at least could do it.
 
 so ok, my ~/.vimrc is getting executed (I could also see
 that because all my other setting like font size do work)
 but then the highlight colors get overwritten by something
 (like Yakov told me several times).
 
  And you might want to put the comment highlights in
  %HOME%/vimfiles/after/syntax/something.vim
 
 Actually I edit .sh, .pl, .c, .h, .java and .as files
 and like to have similar colors (like inverted comments)
 everywhere. So probably this is not the best way?

Then I'm not really sure what is, hopefully someone else will
jump in here
 
  :set runtimepath?
 
  runtimepath=~/vimfiles,C:\Program Files\Vim/vimfiles,C:\Program
 Files\Vim\vim70,C:\Program Files\Vim/vimfiles/after,~/vimfiles/after

I know that 
:set verbose=10
would tell you where varaiables were set, but I don't know how to find
out when a command like `hi comment ...` was used

 
 Regards
 Alex
 
Hugh


Re: Selecting a part of a line and then copy or cut it and then paste is somewhere.

2007-02-26 Thread Hugh Sasse
On Mon, 26 Feb 2007, Eric Leenman wrote:

 Hi,
 
 I'm trying to learn new vim habbits by
 - not sourcing mswin.vim
 - not setting behave mswin.
 to migrate easier to linux.
 
[...]
 What I now miss is the SELECT-MODE.
 Not sure if this is done in mswin.vim and behave mswin.
 I used to select a part of a line by pressing shift and one of the arrow keys.
 It then showed SELECT-MODE, and what was selected you could easily cut and
 past or copy and paste.
 

Sounds like you want visual mode,
:he visual-use
explains it well.

HTH
Hugh


Re: paste staircasing

2007-02-09 Thread Hugh Sasse
On Fri, 9 Feb 2007, Ben K. wrote:

 
 Hi,
 
 Whenever I paste something into vim, it gets staircased. Is there a way to
 avoid copy/paste being staircased even when I have ai, cin or si turned on? I

Yes, set paste.  See 
:he paste
for more on this.  Also 
:he pastetoggle
is good

I have in my .vimrc:

nmap M-R :exe :undo|:set paste|:normal .:set nopaste
set pastetoggle=f1


The first line of which is to redo a botched paste, the second of
which is to make the F1 key turn this on an off.  For me that only
works in inset mode.  Maybe someone can improve on this.

[...]
 Since pasting usually has dedicated or no keystrokes (shift+insert/control+v
 or middle/right mouse button), is there a way for me to tell vim that ai, cin,
 or si should not interfere when I do pasting?

I think the above will do what you want.
 
 I mostly work on unix platforms, so unix-only solution also works for me.

This works in vim6 and 7.  Definitely 7, pretty sure about 6.
 
 
 Thanks.
 
 Ben K.
 Developer
 http://benix.tamu.edu
 
HTH
Hugh



Re: vim return code

2007-02-09 Thread Hugh Sasse
On Fri, 9 Feb 2007, Martin Krischik wrote:

 Am Freitag 09 Februar 2007 schrieb Charles E Campbell Jr:
  :q  :wq  :q!   -- these are normal quits (:wq also writes)
  :
  :cq  -- quits, but Vim will return an error code
 
 
 Thats exactly as far as I came without help. Now, what I was looking for 
 was quit without error code - or better, since there is allways an error 
 code, quit with error code 'success'.

I don't know the answer to that, but...
 
 Currently Vim is seems to me that randomly chooses an error code to return - 
 which is not good for bash scripts running in set -o errexit mode.

... would something like 
( $(vim -E ...) || true ) 
solve this?  Given (starting in tcsh) :

brains hgs 17 % bash3
brains hgs ~ 61 $ set -o errexit
brains hgs ~ 62 $ false
brains hgs 18 % bash3
brains hgs ~ 61 $ set -o errexit
brains hgs ~ 62 $ ( false || true )
brains hgs ~ 63 $ exit
exit
brains hgs 19 %

 
 BTW: Any bash script author should at least consider to use set -o errexit 
 it is a really usefull debugging tool.

Well, you don't seem to get much in thw way of diagnostics from it, but
thank you for mentioning it.
 
 Martin
 
HTH
Hugh


g?vim and bizarre font request.

2007-01-04 Thread Hugh Sasse
I am interested in exploring Lisp before too long.  However, I 
have a physical problem with the parentheses.  My nystagmus
means that just outside the subitizing range my time to count
parentheses increases dramatically.  According to wikipedia
it should increase at roughly 100ms below 4 and 250 milliseconds for
every item above 4.  So this code from Wikipedia:

(defun factorial (n)
  (if (= n 1)
1
(* n (factorial (- n 1)

should mean it takes about 650ms for someone to see there are 5
close parentheses at the end.  It takes me about 3 seconds of
concious effort to reach that number.  Moving the cursor over them
is one option, but it is slower.  I think another might be if I can
find a font and a means of displaying it which slightly disturbs the
spacing, position or shape of successive parentheses, so the pattern is
irregular. Then when the characters appear to move about for me I
won't mix them up and come to a wrong count. I'm thinking of the
way text used to be just a bit wobbly with the line printers of the
1980's.

Given my preferred editor is Vim, and I'm using it on Windows, mostly
with PuTTY talking to a Unix box, does anyone know if I can do this?
Maybe there's another solution?

Thank you
Hugh



Re: g?vim and bizarre font request.

2007-01-04 Thread Hugh Sasse
On Thu, 4 Jan 2007, Tim Chase wrote:

  (* n (factorial (- n 1)
  
[3 secs for me to count, moving cursor over is slower]
  find a font and a means of displaying it which slightly disturbs the
  spacing, position or shape of successive parentheses, so the pattern is
[...]
  
  Given my preferred editor is Vim, and I'm using it on Windows, mostly
  with PuTTY talking to a Unix box, does anyone know if I can do this?
  Maybe there's another solution?
 
 Well, when coming in over a SSH connection, there's not much you can do to
 make the font itself change.  However, you can colorize differently.  Toying

But if there is a wobbly font I could switch to manually for
everything, at the Windows end,  that would suffice.

 around, I came up with this:
 
   :match Error /)\zs)/
 
 which seems to correctly highlight alternating adjacent parents (using the
 Error group, which I tend to use, but adjust according to taste).  My

I'll probably need another group for that, but this looks a useful technique.
[...] Spellcap looks good to me.

 original though was to try and do something of the form
 \%1c(\|%3c(\|%5c(\|... for alternating screen columns, but I like the
 compactness of the actual solution I gave, as well as its ability to work
 regardless of the number of columns in your terminal window.

Thank you.
 
 -tim
 
Hugh
 
 
 



Re: g?vim and bizarre font request.

2007-01-04 Thread Hugh Sasse
On Thu, 4 Jan 2007, Charles E Campbell Jr wrote:

 Hugh Sasse wrote:
 
  I am interested in exploring Lisp before too long.  However, I have a
  physical problem with the parentheses.
  
 You may find rainbow.vim helpful; see
 
  http://mysite.verizon.net/astronaut/vim/index.html#RAINBOW

that looks interesting.  Done the vimball bit then I try to install
rainbow.vba (having gunzipped it);

vim rainbow.vba gives:
***vimball***  Source this file to extract it! (:so %)
Error detected while processing BufEnter Auto commands for *.vba:
E119: Not enough arguments for function: vimball#ShowMesg
Press ENTER or type command to continue

So I try to extract it anyway:
Vimball Archive
extracted after/syntax/c/rainbow.vim: 100 lines
wrote /home/hgs/.vim/after/syntax/c/rainbow.vim

Press ENTER or type command to continue

So that means it only applies to C files out of the box?
I think it would be more useful it it were setup as a plugin
one could use for Perl, Ruby, (your later message covers lisp), etc
I don't consider myself fluent in vim internals, so maybe I've
missed something with this paragraph.

Your web page has:

brlia href=vbafiles/RunView.vba.gzRndm/a a name=RUNVIEW/a !-- 
{{{2 --
 table bgcolor=#005533 border=0 
cellspacing=0tbodytrtdfont size=-1font 
color=#aaemUpdated Dec 15, 2005 (v1e)/em


I think that should be (written as if this were a patch):
-brlia href=vbafiles/RunView.vba.gzRndm/a a name=RUNVIEW/a !-- 
{{{2 --
+brlia href=vbafiles/RunView.vba.gzRunView/a a name=RUNVIEW/a 
!-- {{{2 --
  table bgcolor=#005533 border=0 
cellspacing=0tbodytrtdfont size=-1font 
color=#aaemUpdated Dec 15, 2005 (v1e)/em
 
 It colorizes brackets [] {} () based on nesting level.

Thank you,
Hugh


Re: g?vim and bizarre font request.

2007-01-04 Thread Hugh Sasse
On Thu, 4 Jan 2007, Charles E Campbell Jr wrote:

 Hugh Sasse wrote:
 
  On Thu, 4 Jan 2007, Charles E Campbell Jr wrote:
  
   
   Hugh Sasse wrote:
   
  
I am interested in exploring Lisp before too long.  However, I have a
physical problem with the parentheses.

 
   You may find rainbow.vim helpful; see
   
   http://mysite.verizon.net/astronaut/vim/index.html#RAINBOW
  
  
  that looks interesting.  Done the vimball bit then I try to install
  rainbow.vba (having gunzipped it);
  
[Error reports trimmed]
  
  So that means it only applies to C files out of the box?
   
 
 Its been awhile since I wrote the rainbow stuff; I'd forgotten that I'd
 already included it with vim 7.0's syntax/lisp.vim.
 Just put
 
   let g:lisp_rainbow= 1
 
 in your .vimrc and it'll be enabled for Lisp.

Thank you.
 
  I think it would be more useful it it were setup as a plugin
  one could use for Perl, Ruby, (your later message covers lisp), etc
   
 The rainbow highlighting needs to be attuned to the specific syntax
 highlighting files for each language.
 Its done by assigning a region which begins with ( and ends with ).  To retain
 normal highlighting inside
 such syntax highlighting regions, the region must contain language-specific
 highlighting regions.

Oh, right. I hadn't explored the internals.  I'll have a look later...
 
 So, Perl and Ruby would need specialized versions of rainbow.vim.  I use Perl
 but seldom, and don't know Ruby,

I use Ruby much more than Perl these days, so I'll see if I can do anything
useful along these lines.  I've done small things with the syntax files
before, so I'll see if I'm biting off more than I can chew here :-)
It will be useful to learn how you've made this user selectable, rather
than the default, so I can separate concerns in future.

 and yours is the first request for rainbow highlighting for those languages
 I've received.

I don't know how big the intersect is between the set of vim users and
the set of people with nystagmus :-)  Ruby is light on parentheses in 
the way that Perl is, but sometimes
 
[...]
  Your web page has:
[...]
   
 
 Yep!  Definitely a mistake.  Thank you for catching it!

glad I could help.
 
 Regards,
 Chip Campbell
 
Thank you,
Hugh


Re: Debugging errorformat strings

2006-11-30 Thread Hugh Sasse
On Thu, 30 Nov 2006, Nikolai Weibull wrote:

 On 11/30/06, Hugh Sasse [EMAIL PROTECTED] wrote:
  On Wed, 29 Nov 2006, Nikolai Weibull wrote:
  
   On 11/29/06, Hugh Sasse [EMAIL PROTECTED] wrote:
This was originally posted to vim@vim.org but I've not
had a reply.  Maybe it's better posted here, anyway.  This
is the concise form of the message.  Longer versions are
in the archives, but I'll explain more if needed.
  
   Sorry about that.  I don't read vim@vim.org because it's
   signal-to-noise ratio is just terrible.
  
  That's understandable.  I'm the same with Ruby-Talk, but because there's
  too much signal to read.
 
 Sadly that's what happened to me too.
 
   Also, which version of gcc are you using.  I suspect that they changed
  gcc (GCC) 4.1.0
  
   the error message in the 4.X series, because I'm not getting this
  
  I think I saw it before.
 
 Yes, I recognize that message, but I'm not getting that anymore.  With my gcc:
 
 % gcc --version | head -n 1
 gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)

I have 4.10 on Solaris9
gcc (GCC) 4.1.0
 
 I get
 
 a.c:11: error: redefinition of 'minimal_function'
 a.c:6: error: previous definition of 'minimal_function' was here
 
 which works fine with the old format, as the errors are completely
 separate (in the output that is).
 
 How are you calling gcc?  I've done this with plain gcc file and
 gcc -Wall file and both give me the same result for this error.

In the original message to vim@vim.org I said
quote
This is being picked up correctly (I know because of introducing bugs
in it).  But when I get results like:
/home/hgs/fsv/rawimage.c:97: multiple definition of `image_check_is_png'
image.o:/home/hgs/fsv/image.c:97: first defined here

vim tries to pickup a file called image.o:/home/hgs/fsv/image.c which
clearly doesn't exist.
/quote

I was definitely getting this and it was pasted.  Pulling the old versions
of the generator script out of RCS I cannot regenerate this message.
Using old versions of the makefile doesn't help restore this.

I suppose I'll have to give up on this now.  I've updated sed, awk and grep
since then but I don't think those should come imto play.
 
  nikolai
 

Hugh


Re: Debugging errorformat strings

2006-11-30 Thread Hugh Sasse
On Thu, 30 Nov 2006, Nikolai Weibull wrote:

 On 11/30/06, Hugh Sasse [EMAIL PROTECTED] wrote:
 
  I was definitely getting this and it was pasted.  Pulling the old versions
  of the generator script out of RCS I cannot regenerate this message.
  Using old versions of the makefile doesn't help restore this.
 
 Yeah, I remember getting these messages as well, but since the only
 case I could think of where this would happen is of the type you gave
 an example of I'm guessing that they changed the error message in a
 very recent version (4.1.1) and I'd prefer not complicating the

I've not used 4.1.1 on my systems yet.  I've also updated binutils
in the past week, which may have made this go away.

 errorformat unnecessarily to conform to old versions of gcc.  But
 perhaps I'm wrong in my reasoning?  Anyway, I'll hold off on this
 until a working test-case can be produced.

OK.  Given the way linewise matching is done, I'm now confused as to 
the whole point of the %E %C %Z constructs now.  Since one can't 
put them into one expression (between commas), and as you said the
continuation line will be matched with the %f:%l:%m then I can't
be sure I used them correctly or what advantage they conveay.
 
  nikolai
 

Thank you,
Hugh


RE: Debugging errorformat strings

2006-11-29 Thread Hugh Sasse
On Wed, 29 Nov 2006, Eggum, DavidX S wrote:

 Hugh,
 
 Vim will use the first matching pattern in your efm, so put the more
 specific patterns at the beginning, the more general patterns at the
 end. So try putting the new lines at the front of the efm:

OK, so how does that interact with multiline patterns?  Is it something
like  (pseudocode):

   foreach line in input do
 foreach efm_item in errorformat do
   if efm_item matches line then
  if efm_item begins %E then
 multiline = true
  elseif efm_item begins %Z then
 multiline = true
  fi 
  if efm_item begins %C then
 next unless multiline
  fi
  return efm_line.match(line)
   fi  
 end
   end 

Because I was thinking that once the %E was matched then %C and %Z
lines would have priority.  

I might add that I was also puzzled about the multiline items
having to be separated by commas, i.e. not being able to have a
single multiline %E...%C...%C...%Z..., expression with no commas
in it.  But if the above model is used then that makes more sense.

I'll give this a try. 
 
\%E%f:%l:\ multiple\ definitions\ of\ %m,
\%Z%*\\s:%f:%l:\ first\ defined\ here,
\\%f\%*\\D%l:\ %m,
\%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\
 only\ once,
\%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
\%f:%l:\ %m,
\\%f\\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
 
 David
 
Thank you


Re: compile code from within vim

2006-11-27 Thread Hugh Sasse
On Mon, 27 Nov 2006, Bill Moseley wrote:

 I know the OP was asking about vim6, but in vim7 it seems like setting

I'm fairly sure they are the same in this respect
 
 :compiler perl
 
 has to be done to select the correct compiler script.  Is that
 expected?  Do I need to map, say, .pl and .pm to compiler perl in my
 .vimrc?

When you load a filetype with a given syntax, you may want to do 
different things with it when you 'compile' it.  You may have the 
file as part of a Make, Rake, or Ant setup, so you need to parse
the errors from that.  Or for C, you may need to push it through 
a compiler or through lint.  I think this is why :compiler doesn't
default to give just perl -w -c or similar.  

Hugh


Re: ViM7 spellchecking

2006-11-24 Thread Hugh Sasse
On Fri, 24 Nov 2006, Krzysztof Maj wrote:

 Hugh Sasse [EMAIL PROTECTED] napisa?(a):
  On Fri, 24 Nov 2006, Krzysztof Maj wrote:
  
[...]
  could be very usefull. But my question is how does it works on Mac OSX,
   how 
  
  Do you have reason to believe it works differently on Mac OSX compared
  to other platforms?  Or are you just telling us your platform?
 
 Well, my platform at home is currently Mac OSX and I've found that some 
 things work diffrent, that's why I asked. I didn't know before, that 
 spellcheking engine has been built in VIM. So I started to worry about it 
 since Mac OSX doesn't have ispell or aspell by default.

It is a unix, so it should have some spell checker available.  Maybe
just `spell`?  /usr/dict/words exists?  `man -k spell` might tell
you something if the whatis databases exist.  I don't have access
to Mac OSX to check.
 
  
  to configure it on this platform and choose the language which I wanna 
  
  
  :he spell
  :he spelllang
 
 OK, we'll see if VIM has iso-8859-2 or cp1250 or Mac syntax which I wanna 
 use...

Those are just font choices, I think, so the spell checking should be
orthogonal to that.
[...]
  prefer? Additionally, is it any chance to ommit special characters 
  during 
  the spellcheck in LaTeX files for instance?
  :he spell-syntax
  essentially, yes.
 
 Thanks for pointer, I'll read it for sure.

Probably don't need that level of detail, until you encounter a problem.
 
  Krzysztof Maj
 
Hugh

Rephrased: debugging errorformat strings.

2006-11-24 Thread Hugh Sasse
I'm resubmitting this, clarifying a few points and fixing a typo in
the process, because I've seen no responses.  Sorry if this
is premature: I know it could be due to people being busy.
Hopefully the parts I've rephrased will be clearer than my 
earlier post.

I have been trying to improve the quickfix facilities 
obtainable from gcc.   The file I have in vim7 is quoted
here for completeness, in case I should be using a later
version:

quote
 Vim compiler file
 Compiler: GNU C Compiler
 Maintainer:   Nikolai Weibull [EMAIL PROTECTED]
 Latest Revision:  2006-04-19

if exists(current_compiler)
  finish
endif
let current_compiler = gcc

let s:cpo_save = cpo
set cpo-=C

setlocal errorformat=
  \%*[^\]\%f\%*\\D%l:\ %m,
  \\%f\%*\\D%l:\ %m,
  \%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ 
once,
  \%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
  \%f:%l:\ %m,
  \\%f\\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
  \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
  \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
  \%DMaking\ %*\\a\ in\ %f

let cpo = s:cpo_save
unlet s:cpo_save
/quote

and I have modified it thusly:

--- /usr/local/share/vim/vim70/compiler/gcc.vim 2006-07-19 18:11:22.117752000 
+0100
+++ /home/hgs/.vim/compiler/gcc.vim 2006-11-22 18:33:39.269332000 +
@@ -16,6 +16,8 @@
   \\%f\%*\\D%l:\ %m,
   \%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ 
once,
   \%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
+  \%E%f:%l:\ multiple\ definitions\ of\ %m,
+  \%Z%*\\s:%f:%l:\ first\ defined\ here,
   \%f:%l:\ %m,
   \\%f\\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
   \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',

This is being picked up correctly (I know because of introducing bugs
in it, which I have fixed).  But when I get results like:

/home/hgs/fsv/rawimage.c:97: multiple definition of `image_check_is_png'
image.o:/home/hgs/fsv/image.c:97: first defined here

vim tries to pickup a file called image.o:/home/hgs/fsv/image.c 
for the second line (:cn) which clearly doesn't exist.

I have tried the following forms of this line in order to modify
what is detected before the %f (which seems to be greedy to its
left[!]):

  \%Z%*\\s:%f:%l:\ first\ defined\ here,
  \%Z%.%#:%f:%l:\ first\ defined\ here,
  \%Z%*[^:]:%f:%l:\ first\ defined\ here,
  \%Z%m:%f:%l:\ first\ defined\ here,
  \%Z%*f:%f:%l:\ first\ defined\ here,

The latter of which complains about 2 %f symbols in the line, despite the
first having a * in it.

%*{conv}any scanf non-assignable conversion

would seem to suggest I could do that.  I suspect now that this
only applies to the \\ based conversions, having looked at the 
C source, which I don't fully understand.

Also I can find no examples in the supplied help or supplied compiler files,
or on the web, how to use 
quote
%s  search text (finds a string)
  [...]
The %s conversion specifies the text to search for to locate the error line.
The text is used as a literal string.  The anchors ^ and $ are added to
the text to locate the error line exactly matching the search text and the
text is prefixed with the \V atom to make it very nomagic.  The %s
conversion can be used to locate lines without a line number in the error
output.  Like the output of the grep shell command.
When the pattern is present the line number will not be used.
/quote

Does the string come after the %s?  Does Vim, or the author of the
errorformat add the ^ and $, and if the latter, are they compulsory
delimiters of the string?  The C source suggests to me that this 
isn't fully implemented yet, and it may just mean one character for 
now, but I don't fully understand the intentions behind that code
from reading it.

Is there any way to get vim to log what happens when errrorformats are 
matched, so one can debug this stuff more easily?

How should I be tackling the access of just the source file I want?

I'd like to understand this better, because I can then contribute
my amended compiler file, and possibly other later.

Thank you
Hugh


Re: ViM7 spellchecking

2006-11-24 Thread Hugh Sasse
On Fri, 24 Nov 2006, Krzysztof MaJ wrote:

 
 On 2006-11-24, at 13:18, Krzysztof Maj wrote:
 
  Hugh Sasse [EMAIL PROTECTED] napisa??(a):
to configure it on this platform and choose the language which I wanna

   
   :he spell
   :he spelllang
  
  OK, we'll see if VIM has iso-8859-2 or cp1250 or Mac syntax which I wanna
  use...
 I've checked above and seems that VIM7 does not have iso-8859-2 and
 cp1250 files included in MacOSX dmg file and also in Windows distro.
 I had to download it from the internet and put it manually to spell
 directory at both Mac and Windows platforms.
 When I did :set spelllang=pl and then :set spell VIM said no file.
 
 So maybe I missed something or Polish support for spelling is not
 included in the VIM7 package.

try 
:he spell-load

I see that Polish is specifically mentioned.
What about my distro?  I know zero Polish so didn't do anything special
for that:

ls: No match.

OK...  what else is there?

cleanadd.vim
en.ascii.spl
en.ascii.sug
en.latin1.spl
en.latin1.sug
en.utf-8.spl
en.utf-8.sug
he.vim
yi.vim

So I'd need to download it, and 
:he spellfile.vim 
talks about that.  

HTH
Hugh

Re: Metaprogramming, mixed languages, and Vim.

2006-10-31 Thread Hugh Sasse
Here is what I ended up using, thanks to A.J.Mechelynck and A.
S. Budden on the Vim list and Doug Kearns (what he called a bit of
a '2 AM solution' -- and it works fine!) on the Vim-Ruby list.  The
first function highlights the %Q{} quotes in Ruby as C code, the
second does it for here documents of the form

-CSTRING
   ...
CSTRING

Here they are:

 To MetaProgram C using Ruby
function RubyMetaC1()
  :unlet! b:current_syntax
  :syntax include @CSTUFF ~/.vimrc_include_c_syn
  :syntax region rubyC1 matchgroup=String start=+%Q{+ end=+}+ keepend [EMAIL 
PROTECTED]
  :syntax region rubyC2 matchgroup=String start=+%Q(+ end=+)+ keepend [EMAIL 
PROTECTED]
  :syntax region rubyC3 matchgroup=String start=+%Q+ end=++ keepend [EMAIL 
PROTECTED]
  :syntax on
endfunction
function RubyMetaC2()
  unlet b:current_syntax
  syn include @cTop syntax/c.vim
  let b:current_syntax = ruby

  syn region rubyCString 
start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@!CSTRING\ze+hs=s+2
matchgroup=rubyStringDelimiter end=+^CSTRING$+ 
contains=rubyHeredocStart,@rubyStringSpecial,@cTop fold keepend
  syn region rubyCString 
start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@!CSTRING\ze+hs=s+2  
matchgroup=rubyStringDelimiter end=+^CSTRING$+ 
contains=rubyHeredocStart,@rubyStringSpecial,@cTop fold keepend
  syn region rubyCString 
start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@!'CSTRING'\ze+hs=s+2  
matchgroup=rubyStringDelimiter end=+^CSTRING$+ contains=rubyHeredocStart,@cTop  
fold keepend
  syn region rubyCString 
start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@!`CSTRING`\ze+hs=s+2  
matchgroup=rubyStringDelimiter end=+^CSTRING$+ 
contains=rubyHeredocStart,@rubyStringSpecial,@cTop fold keepend

  syn region rubyCString 
start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@!-CSTRING\ze+hs=s+3
matchgroup=rubyStringDelimiter end=+^\s*\zsCSTRING$+ 
contains=rubyHeredocStart,@rubyStringSpecial,@cTop fold keepend
  syn region rubyCString 
start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@!-CSTRING\ze+hs=s+3  
matchgroup=rubyStringDelimiter end=+^\s*\zsCSTRING$+ 
contains=rubyHeredocStart,@rubyStringSpecial,@cTop fold keepend
  syn region rubyCString 
start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@!-'CSTRING'\ze+hs=s+3  
matchgroup=rubyStringDelimiter end=+^\s*\zsCSTRING$+ 
contains=rubyHeredocStart,@cTop  fold keepend
  syn region rubyCString 
start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@!-`CSTRING`\ze+hs=s+3  
matchgroup=rubyStringDelimiter end=+^\s*\zsCSTRING$+ 
contains=rubyHeredocStart,@rubyStringSpecial,@cTop fold keepend

  syn cluster cCommentGroup contains=cTodo,rubyInterpolation
endfunction


and ~/.vimrc_include_c_syn is just:

runtime! syntax/c.vim

These seem to do much the same thing, i.e, they seem to handle C
equally well, so I may be able to recombine them, but it works for
me at the moment so I am content. And there may be subtleties in
behaviour I have so far not encountered. 

I have them as functions so I can :call them as needed.
I suspect the first may be easy to parameterize for other languages,
but for now I'll leave that for those who enjoy exploring such matters.

Thank you all again, this was way above my present skill level.
Hugh


Re: Metaprogramming, mixed languages, and Vim.

2006-10-27 Thread Hugh Sasse
On Thu, 26 Oct 2006, A.J.Mechelynck wrote:

 Hugh Sasse wrote:
  On Thu, 26 Oct 2006, A. S. Budden wrote:
   perl scripts embedded in a single Matlab script.  I have done similar
   things for C and others.
  
  Well, in my .vimrc I now have:
  
   To MetaProgram C using Ruby
  function RubyMetaC()
   :unlet! b:current_syntax
   :syntax include @CSTUFF syntax/c.vim
 
 Method I.
 
   syntax include @CSTUFF $VIMRUNTIME/syntax/c.vim
 
 This doesn't pick any local additions to C syntax, nor does it pick the
 local syntax script if you've completely replaced the default C syntax
 script by something else placed earllier in 'runtimepath'.
 
 Method II: if you want to search all 'vimruntime' directories
 
   if has(unix)
   silent! syn include @CSTUFF ~/.vim/syntax/c.vim
   else
   silent! syn include @CSTUFF ~/vimfiles/syntax/c.vim
   endif
   silent! syn include @CSTUFF $VIM/vimfiles/syntax/c.vim
   syn include @CSTUFF $VIMRUNTIME/syntax/c.vim
   silent! syn include @CSTUFF $VIM/vimfiles/after/syntax/c.vim
   if has(unix)
   silent! syn include @CSTUFF ~/.vim/after/syntax/c.vim
   else
   silent! syn include @CSTUFF ~/vimfiles/after/syntax/c.vim
   endif
 
 Method III (recommended): include into your @CSTUFF cluster a file
 containing only the single line
 
   runtime! syntax/c.vim
 
 This would be equivalent (with fewer keystrokes) to Method II above.

So all these will solve the my C syntax just looks white problem?
 
   :syntax region rubyC1 matchgroup=String start=+%Q{+ end=+}+ keepend
  [EMAIL PROTECTED]
   :syntax region rubyC2 matchgroup=String start=+%Q(+ end=+)+ keepend
  [EMAIL PROTECTED]
   :syntax region rubyC3 matchgroup=String start=+%Q+ end=++ keepend
  [EMAIL PROTECTED]
   :syntax on
  endfunction
  
[...]
  I saw in the tip#856 (earlier in the thread) the use of :hi-link, but can't
  figure out what to link it to so that it picks up all
  C code as C.
   Hope that is of some interest,
   
   Al
   
  Thank you
  Hugh
  
 
 
 You can probably leave the C highlight groups alone. If you were creating a

so I don't need hi-link.  OK.  I'll try those out
 new language, let's say foobar, you would define a number of syntax groups
 for your language, all of them with camel-case names starting foobar, and
 then use
 
   hi default link foobarFunction Function
   hi default link foobarIdentifier Identifier
   hi default link foobarComment Comment
 
 etc.

Thank you.
 
 
 Best regards,
 Tony.
 

Hugh


Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Hugh Sasse
If one searches for code that writes code OR programs that write
programs AND vim, one can turn up a number of references to this
kind of activity.   Dynamic languages are often more concise than
those with static typing, and while I don't want to get into the
debate on which is better, sometimes it makes sense to use a dynamic
language to generate code in a statically typed language.

So, we run into a problem: how does one syntax highlight mixed
language code?  I don't know how others do this.  Maybe they don't
and they just look at the generated code to see if it is OK.  I'd
like to be able to do syntax highlighting for arbitrary language
pairs, preferably without having to heavily hack the syntax files.
I'm thinking I could insert something into my .vimrc so that I could
invoke that and certain syntax regions would be treated as being in
the other language.  Is this possible, and is it relatively easy?
Usually it will be strings in the one language that must show up in
the other.

Thank you,
Hugh


Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Hugh Sasse
On Thu, 26 Oct 2006, Tim Chase wrote:

  those with static typing, and while I don't want to get into the
  debate on which is better, sometimes it makes sense to use a dynamic
  language to generate code in a statically typed language.
 
 It's like asking whether a hammer or a screwdriver is better. Both are suited
 well to particular tasks.

Precisely my point.  Doesn't stop acres of blog space being devoted
to the issue :-)
 
  So, we run into a problem: how does one syntax highlight mixed
  language code?  I don't know how others do this.  Maybe they don't
 
 While an arbitrary pairing of language N with embedded language M may not be a
 trivial task, you can look at the symbiosis between the existing HTML, PHP,
 and JavaScript syntax files which have something like what you describe.  That

Yes, I've looked at those and got a few feet forwards, but no great
distance.  I find that I have to understand too much of the
internals of syntax highlighting to make sufficient progress.  I'd
like to be fluent in syntax file language, but I don't get in there
often enough to make it worth the effort at the moment, so I'm
wondering if there's another layer of abstraction that I can get at.

 way, one might at least be able to do something like create a tweaked Lisp
 syntax file that recognizes embedded Assembler code, or some other such unholy

:-)

 matrimony. :)  (okay, I'm guilty of writing programs that write code to ensure
 that all combinations of N items were correctly accounted for in a massively
 ugly IF branch...so I know there are times one would want to do such a thing)

I've written code to embed decision tables in C programs, and then
expand them into 'ugly' if 'stacks' before now.
 
 -tim
 
Hugh


Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Hugh Sasse
On Thu, 26 Oct 2006, David S. wrote:

 Hugh Sasse hgs at dmu.ac.uk writes:
 
  So, we run into a problem: how does one syntax highlight mixed
  language code?  
 
 This works well for me, but needs delimters to indicate the appropriate 
 syntax.
 
 http://www.vim.org/tips/tip.php?tip_id=856

So with reference to that, :he :syn-include , I think get

   :syntax include @Cstuff sfilesyntax/c.vim
   :syntax region quotedC start=%Q{ end=} [EMAIL PROTECTED]

so if I stick that in my ~/.vim/after/ruby.vim  I think that
will allow me to have code like

   puts %Q{int main(int argc, char *argv[])}

and it should do what I want.  I'll give that a go.
 
 So in my Python code, for example, I might have:
 ...
 #{{{sql
 bar_sql = 
 Select foo, baz 
 From bar
 
 #sql}}}
 
 cur.execute(bar_sql)
 ...
 
 Peace,
 David S.
 
Thank you,
Hugh
 
 



Re: Metaprogramming, mixed languages, and Vim.

2006-10-26 Thread Hugh Sasse
On Thu, 26 Oct 2006, A. S. Budden wrote:

 On 26/10/06, Hugh Sasse [EMAIL PROTECTED] wrote:
 [snip]
  So, we run into a problem: how does one syntax highlight mixed
  language code?
 [snip]
 
 I don't know whether this is of any use, but I have often found
 situations where I need to embed code from one language in the comments
 of another.  For example, I have Matlab code that scans through its own
 source for some perl code, writes it to disk and then uses it to process
 text files (as Perl is MUCH better at text file handling).  This saves

Interesting idea.

 having multiple scripts for a single (relatively simple task).  In
 .vim/after/syntax/matlab.vim, I have (three lines):
 
 unlet! b:current_syntax
 syn include @matlabPerlScript $VIMRUNTIME/syntax/perl.vim
 syn region matlabPerlRegion matchgroup=matlabScriptDelim start=+^%
 PERL\d*: +hs=s+8 end=+$+ [EMAIL PROTECTED]

OK, this seems to make sense to me from what I have read so far.
 
 So any lines starting % PERL:  (with an optional number after PERL)
 are highlighted as perl code.  The number allows me to have multiple

matching to the end of the line. yes..

 perl scripts embedded in a single Matlab script.  I have done similar
 things for C and others.

Well, in my .vimrc I now have:

 To MetaProgram C using Ruby
function RubyMetaC()
 :unlet! b:current_syntax
 :syntax include @CSTUFF syntax/c.vim
 :syntax region rubyC1 matchgroup=String start=+%Q{+ end=+}+ keepend [EMAIL 
PROTECTED]
 :syntax region rubyC2 matchgroup=String start=+%Q(+ end=+)+ keepend [EMAIL 
PROTECTED]
 :syntax region rubyC3 matchgroup=String start=+%Q+ end=++ keepend [EMAIL 
PROTECTED]
 :syntax on
endfunction


The three :syntax region lines are needed to distinguish %Q, %Q() and 
%Q{} all of which are quoted strings in ruby.  I could not figure out
how to use \z to let me find the matching {angle,round,curly} bracket
for the one I'd opened.  I suspect that is possible

Without the syntax on line, the contents of the quoted string show up
as white, unhighlighted, when I do 

:call RubyMetaC()

Adding the syntax on line just gave me Ruby string quoting, and no 
C highlighting at all.  I was back at square 1.

Adding the :unlet! line made no difference at that stage.

I am now somewhat confused, but feel that I am nearer than I was.

I saw in the tip#856 (earlier in the thread) the use of :hi-link, 
but can't figure out what to link it to so that it picks up all
C code as C.
 
 Hope that is of some interest,
 
 Al
 
Thank you
Hugh


Anim8or scripting language.

2006-09-12 Thread Hugh Sasse
There is a free, but not open source, 3d modelling package called
Anim8or at http://www.anim8or.com/ which, in the new beta release
has a scripting language.  Anim8or also has modelling files, so 
there are really two different syntaxes associated with this.  
The modelling files are something I have not tried to make Vim 
support, so in the attached patch I have named the file a8s.vim
rather than anim8or.vim.

The patch is a clumsy hack (with a blunt instrument, so to speak) at
the C syntax file, to get it to support the a8s syntax.  It is definitely
buggy:   
#parameters(this, 
that,
the other)
fails with a syntax error on the last bracket and the colouring for
it doesn't work as I'd expect from hacking the #define directive in
C.  That may not even be the right approach, given the semantics.

I tried to provide support the highlighting $variables, but couldn't
understand how this was done in perl.vim or sh.vim to get it right,
so I've left that for now.

Anyway, I'm putting this forward in the hope that someone more fluent
in vim scripting, syntax, etc can [help me?] make something presentable
out of it, and the hope that others find it of some use.

I've created a small web page about this at

http://www.eng.cse.dmu.ac.uk/~hgs/anim8or/

from which you can get the attached patch and the syntax file itself.

Thank you,
Hugh
--- vim70/filetype.vim.orig 2006-05-07 15:13:38.0 +0100
+++ vim70/filetype.vim  2006-09-12 10:38:16.34575 +0100
@@ -95,6 +95,9 @@
  AMPL
 au BufNewFile,BufRead *.runsetf ampl
 
+ Anim8or Script
+au BufNewFile,BufRead *.a8ssetf a8s
+
  Ant
 au BufNewFile,BufRead build.xmlsetf ant
 
--- vim70/syntax/a8s.vim.orig   1970-01-01 00:01:00.0 +
+++ vim70/syntax/a8s.vim2006-09-12 11:33:58.62700 +0100
@@ -0,0 +1,268 @@
+ Vim syntax file
+ Language:Anim8or Script
+ Maintainer:  Hugh Sasse [EMAIL PROTECTED]
+ Last Change: 2006 Sep 11
+
+ Quit when a (custom) syntax file was already loaded
+if exists(b:current_syntax)
+  finish
+endif
+
+ A bunch of useful C keywords
+syn keyworda8sStatementbreak return continue 
+syn keyworda8sLabelcase default
+syn keyworda8sConditional  if else switch
+syn keyworda8sRepeat   while for to do
+
+syn keyworda8sTodo contained TODO FIXME XXX
+
+ a8sCommentGroup allows adding matches for special things in comments
+syn clustera8sCommentGroup contains=a8sTodo
+
+ String and Character constants
+ Highlight special characters (those which have a backslash) differently
+syn match  a8sSpecial  display contained \\\(x\x\+\|\o\{1,3}\|.\|$\)
+if !exists(a8s_no_utf)
+  syn matcha8sSpecial  display contained \\\(u\x\{4}\|U\x\{8}\)
+endif
+if exists(a8s_no_cformat)
+  syn region   a8sString   start=+L\=+ skip=+\|\\+ end=++ 
contains=a8sSpecial,@Spell
+   a8sCppString: same as a8sString, but ends at end of line
+  syn region   a8sCppStringstart=+L\=+ skip=+\|\\\|\\$+ excludenl 
end=++ end='$' contains=a8sSpecial,@Spell
+else
+  if !exists(a8s_no_c99)  ISO C99
+syn match  a8sFormat   display %\(\d\+\$\)\=[-+' 
#0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)
 contained
+  else
+syn match  a8sFormat   display %\(\d\+\$\)\=[-+' 
#0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)
 contained
+  endif
+  syn matcha8sFormat   display %% contained
+  syn region   a8sString   start=+L\=+ skip=+\|\\+ end=++ 
contains=a8sSpecial,a8sFormat,@Spell
+   a8sCppString: same as a8sString, but ends at end of line
+  syn region   a8sCppStringstart=+L\=+ skip=+\|\\\|\\$+ excludenl 
end=++ end='$' contains=a8sSpecial,a8sFormat,@Spell
+endif
+
+syn match  a8sCharacterL\='[^\\]'
+syn match  a8sCharacterL'[^']*' contains=a8sSpecial
+if exists(a8s_gnu)
+  syn matcha8sSpecialError L\='\\[^'\?\\abefnrtv]'
+  syn matcha8sSpecialCharacter L\='\\['\?\\abefnrtv]'
+else
+  syn matcha8sSpecialError L\='\\[^'\?\\abfnrtv]'
+  syn matcha8sSpecialCharacter L\='\\['\?\\abfnrtv]'
+endif
+syn match  a8sSpecialCharacter display L\='\\\o\{1,3}'
+syn match  a8sSpecialCharacter display '\\x\x\{1,2}'
+syn match  a8sSpecialCharacter display L'\\x\x\+'
+
+when wanted, highlight trailing white space
+if exists(a8s_space_errors)
+  if !exists(a8s_no_trail_space_error)
+syn match  a8sSpaceError   display excludenl \s\+$
+  endif
+  if !exists(a8s_no_tab_space_error)
+syn match  a8sSpaceError   display  \+\tme=e-1
+  endif
+endif
+
+catch errors caused by wrong parenthesis and brackets
+ also accept % for {, % for }, : for [ and : for ] (C99)
+ But avoid matching ::.
+syn clustera8sParenGroup   
contains=a8sParenError,a8sIncluded

Re: Updated files requested

2006-04-12 Thread Hugh Sasse
I've just been exploring AutoIT (for automating Windows GUI interaction):
http://www.autoitscript.com/autoit3/index.php
It comes with support for the Scite editor.  My probably stupid question
is this:  has anyone software to convert Scite syntax information (wherever
that's held, I've not explored in *any* depth) into Vim Syntax files?
Vim (XP) doesn't detect .au3 files as AutoIT, and obviously it would be
nice if the next release could do something like that for minimal effort.  

while (brainstorming  (wishes == horses)) {...}

Hugh

On Wed, 12 Apr 2006, Bram Moolenaar wrote:

 This is a message for all people who maintain syntax files, plugins,
 translations, etc.: Please send me updated files within a week. Thursday
 20 April the latest.  Then I can make a final beta testing version for
 Vim 7.


Re: Vim Job board?

2006-04-11 Thread Hugh Sasse
On Tue, 11 Apr 2006, Matthew Winn wrote:

 On Mon, Apr 10, 2006 at 09:14:33PM +0200, Bertram Scharpf wrote:
  
  first thank you all very much for the backings.  I'm on the
  way losing trust in my own mind.
  
  Could this be normal?  I've been in two jobs during the past
  year and not one of these well-paid colleagues calling
  themselves degreed software engineers does even know about
  Vim (neither Emacs).  None of them is having Linux at home.

I'd refer them to The Pragmatic Programmer, by Andrew Hunt
and David Thomas, from the books tips:

  Use a Single Editor Well
  The editor should be an extension of your hand; make sure your
  editor is configurable, extensible, and programmable.

http://www.pragmaticprogrammer.com/ppbook/extracts/rule_list.html

It's quite a thin book, but very good IMHO.  I've no financial
interest in its sales, in case you wondered :-)

  Extrapolating from this I don't expect my next job being
  much better.
 
 [begin rant]
 
 It's been my experience that many people working with computers want
 access to the very latest hardware but when it comes to the software
 they use they tend to stick with what they know and are extremely
 unadventurous.  I know many, many people who use Windows notepad as
[...]
 same with web browsers: count the number of people you know who use
 Internet Explorer, not because they're tried several browsers and find
 IE suits them best, but because they've never given any thought to
 trying an alternative.

See Edward de Bono's Thinking Course.  People just don't look for
alternatives.  Basically, because if something works then one is surviving.
Evolutionary psychologists would say more about that :-)  
Much of his work is about generating alternatives = lateral thinking.
 

Hugh


Retry: editing WinXP text files - multibyte?

2006-04-11 Thread Hugh Sasse
Nobody seems to have replied to this, so please excuse
me resubmitting it.  I've still not found a solution for this,
qnd would appreciate some help. Given the Vim Jobs List
thread, I'm not the only person trying to use vim effectively
on Windows :-)

Thank you,
Hugh

-- Forwarded message --
Date: Fri, 7 Apr 2006 12:08:23 +0100 (WEST)
From: Hugh Sasse [EMAIL PROTECTED]
To: Vim Help list vim@vim.org
Subject: editing WinXP text files - multibyte?

If, on WinXP, I do 

regedit /e regfile.reg

I get a file with the contents of the registry.  However, in my Gvim
(6.4) I see nulls for every other character (^@), which agrees with
remarks about ucs-2le in the docs.This is particularly
unpleasant to read and edit.  Notepad will display it to read, but
for editing I'd rather use gvim. Both
:he utf-16 | he ucs2-le
turn up nothing, and the utf-8 things don't seem relevant.  :he
encoding tells me I can't use that to edit a file that has loaded
incorrectly, so I'll have to re-open the file.  But that means
right-clicking the file to access vim won't work.

I think I'm doing this the hard way.  Could someone point me at the
right part of the docs, please?

Thank you,
Hugh


Re: Retry: editing WinXP text files - multibyte?

2006-04-11 Thread Hugh Sasse
On Tue, 11 Apr 2006, Yakov Lerner wrote:

 On 4/11/06, Hugh Sasse [EMAIL PROTECTED] wrote:
  On Tue, 11 Apr 2006, Yakov Lerner wrote:
 
Date: Fri, 7 Apr 2006 12:08:23 +0100 (WEST)
From: Hugh Sasse [EMAIL PROTECTED]
To: Vim Help list vim@vim.org
Subject: editing WinXP text files - multibyte?
   
If, on WinXP, I do
   
regedit /e regfile.reg
   
I get a file with the contents of the registry.  However, in my Gvim
(6.4) I see nulls for every other character (^@), which agrees with
remarks about ucs-2le in the docs.This is particularly
unpleasant to read and edit.  Notepad will display it to read, but
for editing I'd rather use gvim. Both
:he utf-16 | he ucs2-le
turn up nothing, and the utf-8 things don't seem relevant.  :he
encoding tells me I can't use that to edit a file that has loaded
incorrectly, so I'll have to re-open the file.  But that means
right-clicking the file to access vim won't work.
  
   I think you need to set option 'fileencodings' properly in
  set fileencodings+=utf-8,utf-16,ucs-2le
  set fileencoding=ucs-2le
  set bomb
 
  and trying
  set fileencoding=utf-16
  set fileencoding=ucs-bom
 
  seems to make no difference:- set fenc? always tells me it is blank
 
  and
  set fileencodings+=utf-8,utf-16,ucs-2le
  set fileencoding=ucs-2le
 
  doesn't help either, nor does removing the + and putting ucs-bom in
  there explicitly.
 
  So I'm still puzzled
 
 How about this:
 au BufReadPost *.reg set fenc=...

Possibly, but isn't there a way to trigger heuristics, similar to 
the detection of DOS/Unix line endings?
 
 What's value of your 'encoding' ?
   :set encoding?

Latin1.  Changing it to Unicode I see nothing at all in the reg file, 
and I can't edit my vimrc anymore without resetting it and doing :ereturn

 
 Yakov
 
Thank you
Hugh