Monday, November 23, 2015

Re: Go to Japanese character

On Mon, Nov 23, 2015 at 8:24 PM, Charles E Campbell
<drchip@campbellfamily.biz> wrote:
> bob beckett wrote:
>> On Thursday, November 19, 2015 at 1:38:00 PM UTC-8, bob beckett wrote:
>>> I have created a Japanese-English vocabulary list for my personal use.
>>>
>>> Oftentimes I want to go to the first non-ASCII character in a line.
>>>
>>> Can anyone suggest a way to accomplish this? Maybe a remapping?
>>>
>>> Thanks
>> Sorry it took so long to reply.
>>
>> Thank you for your suggestion. Unfortunately, it finds all non-ASCII characters in the entire file, and it does not move the cursor to the first Japanese (i.e. non-ASCII) character in the current line.
>>
>> What I envisioned was some kind of modification of the f(ind) command. But I can't figure it out.
>>
> Modify Bob's suggestion: /^[^ -~] (ie. line beginning with non-ascii)
>
> Or, if you're using utf-8:
>
> /^[\u30A0-\u319f] for katakana
> /^[\u3040-\u309f] for hiragana
> [^[\u3040-\u319f] for either katakana or hiragana (since they're
> right next to one another in the utf-8 glyph table)
>
> Regards,
> Chip Campbell

However, due to a limitation in Vim search (just slightly above 256
characters IIRC) it is not possible to search for just any character
anywhere in the whole kanji range — except by the above-mentioned
"anything but" method, which may give false positives. It is even
possible (if you use UTF-8) to exclude the whole of Latin1 (not just
7-bit us-ascii) by searching on
/^[^\x01-\xff]
Or without the ^ outside the [ ] to find non-Latin1 characters even
when not at the start of a line. But you can't exclude much more than
that due to that Vim limitation.

Best regards,
Tony.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: