Questions tagged [unicode]
Question about using Unicode character set, how to insert them, how to display them and general use of the UTF8 encoding.
80
questions
0
votes
0
answers
31
views
How to match latin letters + their accented versions?
\a is equivalent to [A-Za-z] so it matches only non-accented letters.
I know of [=name-of-equivalence-class=], so I can clearly use something like \(\a\|[[=a=][=e=][=i=][=o=][=u=]]\), but I was ...
0
votes
2
answers
46
views
Greek beta code conversion within (n)vim
I would like to be able to use Greek Beta Code in vim so that I do not need to keep changing keyboard layouts while typing a mixture of Greek text, LaTeX commands, and vim normal-mode commands.
Is ...
0
votes
3
answers
130
views
Search and replace unicode character codes with actual characters
I've got a text file with unicode character codes in it. It looks like this in vim (utf-8[unix]):
Samuel i<81>ngel - Euro <80>25
Tomas i<81>lvaro - ©Coca-Cola and dagger <87>
...
0
votes
0
answers
121
views
Why does vim/neovim show the zero width space as <200b>?
When I copy a zero width space into vim, it is displayed as <200b>, instead of it being invisible:
I've tried this in multiple terminal emulators and in both vim and neovim, and the character ...
1
vote
1
answer
70
views
How to type math multipliction symbol (×) in insert mode?
The Unicode value of multiplication sign (×) is 00d7.
I can insert it using the key sequence: Ctrl-vu00d7.
I want another way to generate it.
In the webpage: Typing Vim math symbols in insert mode.
...
3
votes
1
answer
62
views
Vimscript to replace persian/arabic digits with english ones
I have a file that has so many persian/arabic digits in it. I would like to replace them with their English counterparts. How is that possible?
1
vote
1
answer
115
views
Vim's "ga" and utf-8 characters: What is <M-x>?
I pasted text A ∩ B into Vim in order to figure out how the "cap" character is represented.
Using its code, I would then figure out the right commands to print it out from a data analysis ...
3
votes
1
answer
47
views
mapping to toggle whether a vowel in Unicode has a macron and whether a consonant has a dot
When writing transliterated Arabic (which looks like this: lammā aktub naṣṣan ʿarabiyyan bi-ḥurūfin lātīniyyah) I sometimes leave off a macron that should go on a vowel (e.g., ā ē ī ō ū), or a dot ...
1
vote
0
answers
119
views
How to check for presence of a glyph?
I run vim under various terminals, supporting different sets of Unicode glyphs.
While I can make vimrc settings depend on the value of TERM, this is slightly error prone, since updates of glyph ...
1
vote
0
answers
83
views
Vim interpretation of Unicode Private Use Areas and fallback fonts
If I download this file and open it with GVim, here is what I see:
Now put the cursor on the "2" of "29" (after "Received" and before "December") and press g8.
...
1
vote
1
answer
48
views
Certain LaTeX not displayed in GVim
I use conceal and write some LaTeX files in the GVim 8.2 editor on windows. The conceal works fine most of the time but it is unable to display certain characters like ∈ and ⊆. It shows a box with a ...
1
vote
1
answer
240
views
Mapping arbitrary unicode characters?
I want to create a mapping that is ctrl+[some obscure unicode character], how can I do this for terminal vim using the actual unicode code?
Backstory: I'm trying to work around i3wm, where ctrl+hjkl ...
3
votes
1
answer
89
views
Inserting the content of a register where a macro is recorded results in control characters becoming unicode characters
If I hit Ctrl+V and then Escape while in insert or ex mode, I get ^[ as a single character.
If I hit qqEscapeq and then go see :registers, I see that q contains ^[<80><fd>a, which are ...
3
votes
1
answer
238
views
Display superscript of multiple characters to express a mathematical exponent
If in Vim I type CTRL-K followed by 1 and S, I can get a superscript such as 10¹.
How though do I write something like 10 to the power of 18?
Further info
I ask this on the assumption that there must ...
1
vote
0
answers
85
views
Getting the half of a glyph
while trying to add a unicode font, I am getting the half of the font, like in line 239 and 240 in the screenshot:
I have, in my vimrc:
set history=700 " How many line Vim ...
7
votes
1
answer
725
views
Matching any Unicode whitespace
I'd like to match in Vim any whitespace character, not only normal space (U+0020) and tab (U+0009) with \s, and the other ASCII ones like form feed (U+000C) with [[:space:]], but any Unicode ...
2
votes
1
answer
330
views
How do I work with vim9 and unicode?
I've found myself in a bit of an interesting situation.
I'm writing a plugin in which I need to do a tiny bit of line parsing.
Given a file:
æøå
It's easy to verify that col('.') returns 1, 3, and 5 ...
2
votes
2
answers
629
views
Highlight Unicode Characters
Is it possible to highlight unicode characters?
When I copy/paste a code sample I sometimes run into problems because the website uses ‐, ‑, ‒ or – instead of - or some other characters that are hard ...
2
votes
1
answer
159
views
How to get the encoded byte sequence for a character in the status line?
I want to display the hex byte sequence for the character under the cursor as it is actually stored on disk.
Currently my status line contains 0x%04.5B which works fine for ASCII/latin1 files but for ...
3
votes
0
answers
41
views
Wrong width for certain characters
Using this:
https://github.com/vim/vim-win32-installer/releases/download/v8.2.1505/gvim_8.2.1505_x64.zip
All of these characters (and perhaps others):
ℹ ⌨ ⏏ ⏭ ⏮ ⏯ ⏱ ⏲ ⏸ ⏹ ⏺ ☀ ☁ ☂ ☃ ☄ ☎ ☑ ☝ ☠
☠️ ☢ ☣ ☦ ☪...
1
vote
1
answer
212
views
Use unicode string to replace cjk characters
Create a sample text for testing.
cat > sample.txt << EOF
i and 你
EOF
Open sample.txt in vim,the cjk character 你 in unicode is 4f60,
%s/\%u4f60/you/g
%s/你/you/g # you can use it also
...
3
votes
1
answer
2k
views
Replace nbsp with none string in utf-8 encoding in vim
The nbsp(non breaking space)'s binary format in utf-8 encoding is c2a0.
Create a sample.txt this way :input it is a test then ctrl+v+u a0,then you get the sample test file.
xxd sample.txt
00000000: ...
4
votes
0
answers
284
views
Unicode in vimrc no longer displaying correctly
I'm using VIM 8.1.2234 with +multi_byte and +multi_lang
In my vimrc file, I have set listchars=tab:▸\ ,trail:· (Notice the "▸" and the "·")
When I cat or less my vimrc, the text ...
2
votes
0
answers
112
views
Tell vim to treat character as full width
I am wondering if it is possible to tell vim to treat an individial code point in the unicode plain. I am aware of the ambiwidth option, but it does not help with my current task because the relevant ...
1
vote
1
answer
190
views
Vim plugin for making source code pretty using unicode
A few months ago, someone in a programming class showed me a vim plugin he found that used Unicode to make source code "look pretty." I remember, specifically, that one of the things it did was make ...
2
votes
1
answer
79
views
How to conceal zerowidth special characters like <U200C>
That character is used so much in Persian writing. And it makes the text difficult to read. I tried to make my terminal display it correctly but I couldn't I was wondering maybe I could use vim syntax ...
0
votes
1
answer
434
views
On Windows some symbols are not displayed
I use 'DejaVu Sans Mono' as gui font both on Windows (7 and 10) and Linux. However, on Windows some characters are not displayed correctly (while many other Unicode characters are displayed normally). ...
0
votes
1
answer
77
views
Why does backslash-escaping a CJK character cause a very-magic regex match to fail?
My understanding of very-magic regexes is that you can escape any character outside [A-Za-z0-9_] with a backslash to make it match literally. However, I don't see that behaviour with CJK characters. ...
2
votes
1
answer
2k
views
How can I search for Unicode characters by hex code in very magic regexes in vimscript?
I am working on UTF-8 support for my editorconfig-core vimscript plugin. I have hit a strange snag.
This is in official GVim 7.4 Win32. I would like to get this working on 7.4, rather than ...
1
vote
1
answer
311
views
Can you match unicode blocks by name in vim?
\p{Cyrillic}
Works in my normal regular expressions. When trying to match in Vim or gvim however, I can not seem to get it to work.
I tried something like this:
\p\{Cyrillic}
Is it not supported, ...
0
votes
1
answer
66
views
Detect when at last character when character is multibyte
I have the following command for \ that jumps to the last character unless the cursor is under the last character, in which case it jumps to the start of the line.
nnoremap <silent> <expr>...
2
votes
0
answers
139
views
Can vim handle unicode line and paragraph separators?
Line endings differ between platforms; LF on unix, CRLF on windows, CR on Mac OS Classic. Unicode introduced LS (Line separator, U+2028) and PS (Paragraph separator, U+2029), as unambiguous ...
5
votes
4
answers
4k
views
How to show illegal whitespace (such as unbreakable space) in source code?
I sometimes type (by accident) shift-space, inserting unbreakable space into code. With c++, I get this:
error: stray ‘\302’ in program
error: stray ‘\240’ in program
while in other formats (like ...
2
votes
1
answer
302
views
How to deal with accented latin characters on neovim
I'm trying to find out how to configure neovim in order to edit texts with accented latin characters. I usually set ambiwidth to double so Jananese symbols are displayed properly, but then neovim ...
0
votes
1
answer
70
views
How to express an unicode code points set in match command?
My test.txt for this example.
unicode 3000 (whitespace in Chinese mark)
! unicode ff01
^ unicode ff3e
~ unicode ff5e
The command can match whitespace in Chinese mark(u3000).
hi! ...
0
votes
1
answer
186
views
How to input full width spacewhite in vim?
In cjk characters set, full width space has the unicode value is U+3000, the english space unicode (half width space) value is U+0020.
How to input full width space in Vim?
7
votes
0
answers
694
views
Unreadable display of Tamil characters in Vim
gVim seems to have problems displaying text in Tamil (and possibly other Indic languages), even when the font supports it. For eg., here's some text in Emacs and the same text in gVim (both under ...
1
vote
1
answer
714
views
Why some information can't been shown at status bar with iTerm2?
Installed vim with SpaceVim on macOS.
When ran vim in the iTerm2 terminal, the information can't been shown rightly at status bar. Much of them been shown as ?. Why?
7
votes
1
answer
5k
views
move forward by a certain number of chars or bytes?
Sometimes I need to move to a particular byte offset or move to the nth unicode rune in a file (utf-8).
Does vim expose a way to move to an absolute byte/char offset or to move the cursor forward a ...
10
votes
1
answer
10k
views
What does CTRL-K do in insertion mode?
When I press ^K in my vim while I'm in insertion mode a '?' appears and then if I press a and then another character some strange characters appear the following are a few of the characters I could ...
2
votes
1
answer
804
views
Detect if Vim can show utf8 characters
I have the line
set listchars=eol:↵,tab:▸-,trail:¤,nbsp:¤
in my .vimrc which I use on different machines. If the LC_CTYPE is not set to an UTF-8 map, I get the message
E474: Invalid argument: ...
2
votes
1
answer
469
views
How to interpret ASCII codes returned by "ga" command?
I'm cleaning data imported from Excel to Access, and ran across funny quotes that I'm having trouble getting unambiguous ASCII codes for.
They are the hooked single quotes ‘ and ’. Vim's ga command ...
0
votes
2
answers
103
views
Triggering automatic replacements of certain strings
I am using the Vim version 8.0 editor, mostly via GVim. I would like to be able to type unicode/greek characters like lambda, mu, alpha inside my Haskell scripts.
There is a vim plugin called latex-...
1
vote
0
answers
96
views
Unicode character does not show when entered using <C-q> with cp932
I am trying to get the unicode character '①' inserted in vim with the insert mode command but failed.
<CTRL-Q>u2460 --> result:$`
So I copied the unicode to vim and checked the hex value ...
3
votes
3
answers
2k
views
Printing unicode chars?
Is there a solution to printing unicode characters from gvim?
See this:
Results in this print result
(Using a Linux setup and Vim 8.0.)
24
votes
5
answers
4k
views
How do I keep accidentally creating a no break space before opening curly brace?
From time to time, let's say once a month, when I program, I introduce a No-Break space instead of a regular space, before opening a curly brace.
This happens let's say when I'm writing () {
This ...
0
votes
1
answer
753
views
How to replace a character with another character by character code
I want to write a command that replaces all of a line's spaces with figure spaces, and I want the code to not use those literal characters so it is more legible than :s/ / /g
So, naturally, I try ...
7
votes
4
answers
3k
views
How can I get the character at the cursor position in a multibyte aware manner?
Consider the following line:
€ €
This file is encoded in UTF-8 and between the two Euro marks is a Tab character (the Stack Exchange software expands this to spaces). The byte value is:
e2 82 ac ...
2
votes
1
answer
221
views
Some umlauts and extended Latin characters are shown as fullwidth
In Vim, I find each of ü and ß takes up fullwidth, i.e. twice as fat as ASCII characters.
I am writing some German-learning notes, and find this to be very confusing, since I have been mistaken that ...
3
votes
1
answer
670
views
Displaying terms as single character unicode symbols in VIM?
Does VIM have a way to show symbols as characters?
So lambda can be displayed as λ (yet keep its underlying ascii text) for example.
Something like emacs pretty-symbols