Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to replace 'LEFT-TO-RIGHT MARK' (U+200E) - <200e> with vim

Tags:

linux

vim

Thats is how this special character is displayed in vim:

LEFT-TO-RIGHT MARK

Ive tryed with /\x20(\x0e|\x0f)/ and /\xe2\x80[\x8e\x8f]/ without results.

like image 997
panchicore Avatar asked Mar 03 '11 04:03

panchicore


2 Answers

First, if you want to replace byte 0x20 (it is space, if I am not mistaking), you need to use \%x20, not \x20 because \x designates a hex digit (unless used inside a collection, there \x20 means what expected). But if you want to replace given unicode character, you should use \%u200E (\u200E inside a collection).

Second, both \%x20 and [\x20] will match character with unicode code 0x20, not byte with code 0x20. It does not matter for the space, but makes difference for code points >0x7F.

like image 91
ZyX Avatar answered Sep 17 '22 22:09

ZyX


Try to replace \u200e :)

You can test this works by inserting that character into your buffer, and seeing that it appears as <200e>, if you type this in while in insert mode: <C-R>="\u200e"<CR> (that's CTRL+R and <CR> means ENTER)

like image 36
Dan Avatar answered Sep 21 '22 22:09

Dan