Thursday, August 23, 2012

Re: Vim perl highlighting doesn't understand UTF-8? (vimRE needs perlRE enhancing)

Benjamin R. Haskell wrote:
> Possibly. Another possibility is that Perl-syntax gurus use the
> Perl-specific Vim group: https://groups.google.com/group/vim-perl
---
Possibly, but I doubt it -- since the only posts there since Apr
are a month old relating to a build problem in vim 7.3 when building
in perl support.

Given the traffic on that list, anyone who knows how vim
does perl-syntax would be on this list, as they'd have to have
a fairly good knowledge of vim -- and that list doesn't have the
traffic to support such knowledge, by itself.
>
> There's also the fact that UTF-8 isn't widely used in Perl
> identifiers. Despite the option's availability, inertia means that
> programmers tend to stick with backwards-compatible ASCII
> identifiers. (I've been mostly out of the Perl game since 5.12.x, but
> I certainly stuck to ASCII id's to stay compatible.)
----
I stick with Perl ID's for ease, not compatibility since UTF-8 support
was added over 10 years ago with the release of Perl 5.8. However,
I'm finding that some of the symbols / letters in unicode can make the
source easier to read and understand.

Like using the unicode symbol for function, 'ƒ' , can allow
me to use a "sub" name that documents it as a function rather than an
OO method, as I have had OO classes where I wanted to define a function
rather and make it clear that it was so by glancing at the code as well
as to callers. I rarely remember how my subroutines are called or
even what they do unless I make it clear in the code -- and I hate
putting comments in... they mess up the beauty of the structure, but worse
they can be out of sync with the code.

It comes down to a choice between ease of use (a frequently used
function, I likely would not name with a hard to type UTF-8 char), but
if it is only called a few times, and I wanted to document its being
different from surrounding subs, what better way than to use a a scripted
ƒ that is documented to be used as short for function?
> Vim's regular expressions aren't great for character sets that don't
> fit into (single) 8-bit characters.

Yikes -- it doesn't work at all with UTF-8 -- it's only ASCII compat!
I didn't know that.

While I've found Vim's RE difficult to memorize all of it's special cases,
I didn't know it was also incompatible with it's default text mode.

I don't suppose now would be a good time to ask, again, for perl-RE
support as a built-in optional replacement for the vim-RE? :-)
Only been on my wish list for vim for ~4-5 years, at least...

> I'll take a stab at it if I get some "tuit's", but no promises.
Sorry, I didn't know it was broken due to the RE-engine not supporting it,
so please don't throw away good time kludging support for broken features,
when it's the feature that needs fixing.

This sounds like an even better reason to add-in such support.








--
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

No comments: