Friday, November 4, 2011

Re: [Suggestion] New functions iskeywordchar(), isfnamechar(), isprintchar(), and isidentchar()

Am 04.11.2011 16:43, schrieb Axel Bender:
> Addendum:
>
> Is there a UTF-8-safe version? The following doesn't work for a UTF-8 file
> (both enc and fenc):
>
> :echo getline(".")[col(".") ] =~ '\k'
>>
>
> when over an "ü" (i.e. an character that - if in Latin-1 - would be in the
> default iskeyword option range).
>
> Note: The inspected character is the *second* character of the UTF-8
> character "ü" (0xC3, 0xBC).
>
> Background: I'd like to move characterwise in a given string, starting at
> an arbitrary position within it, skipping over e.g. keyword characters.

:echo matchstr(getline("."), ".", col(".")-1)

Similar functions: matchstr(), match(), matchend()

"-1": col() is 1-based, match() is 0-based

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

No comments:

Post a Comment