Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [unicode]

Question about using Unicode character set, how to insert them, how to display them and general use of the UTF8 encoding.

Filter by
Sorted by
Tagged with
1 vote
0 answers
25 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 ...
user avatar
  • 337
1 vote
0 answers
57 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. ...
user avatar
1 vote
1 answer
42 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 ...
user avatar
  • 113
1 vote
1 answer
89 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 ...
user avatar
  • 389
2 votes
1 answer
29 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 ...
user avatar
  • 1,572
3 votes
1 answer
99 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 ...
user avatar
  • 211
1 vote
0 answers
55 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 ...
user avatar
  • 387
6 votes
1 answer
238 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 ...
user avatar
  • 161
2 votes
1 answer
198 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 ...
user avatar
2 votes
2 answers
398 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 ...
user avatar
  • 2,603
2 votes
1 answer
70 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 ...
user avatar
2 votes
0 answers
31 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): ℹ ⌨ ⏏ ⏭ ⏮ ⏯ ⏱ ⏲ ⏸ ⏹ ⏺ ☀ ☁ ☂ ☃ ☄ ☎ ☑ ☝ ☠ ☠️ ☢ ☣ ☦ ☪...
user avatar
  • 746
1 vote
1 answer
110 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 ...
user avatar
  • 820
1 vote
1 answer
1k 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: ...
user avatar
  • 820
3 votes
0 answers
158 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 ...
user avatar
  • 163
2 votes
0 answers
53 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 ...
user avatar
  • 121
1 vote
1 answer
164 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 ...
user avatar
1 vote
1 answer
52 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 ...
user avatar
0 votes
1 answer
251 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). ...
user avatar
  • 383
0 votes
1 answer
59 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. ...
user avatar
  • 894
2 votes
1 answer
1k 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 ...
user avatar
  • 894
1 vote
1 answer
240 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, ...
user avatar
  • 825
0 votes
1 answer
50 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>...
user avatar
  • 1,643
1 vote
0 answers
83 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 ...
user avatar
  • 343
5 votes
4 answers
3k 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 ...
user avatar
  • 163
2 votes
1 answer
250 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 ...
user avatar
  • 63
0 votes
1 answer
66 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! ...
user avatar
  • 820
0 votes
1 answer
140 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?
user avatar
  • 820
5 votes
0 answers
646 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 ...
user avatar
  • 621
1 vote
1 answer
635 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?
user avatar
  • 121
6 votes
1 answer
4k 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 ...
user avatar
  • 1,643
10 votes
1 answer
8k 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 ...
user avatar
2 votes
1 answer
717 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: ...
user avatar
  • 23
2 votes
1 answer
369 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 ...
user avatar
  • 383
0 votes
2 answers
79 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-...
user avatar
1 vote
0 answers
91 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 ...
user avatar
2 votes
3 answers
1k 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.)
user avatar
23 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 ...
user avatar
0 votes
1 answer
523 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 ...
user avatar
  • 117
6 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 ...
user avatar
2 votes
1 answer
206 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 ...
user avatar
3 votes
1 answer
556 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
user avatar
  • 3,383
5 votes
1 answer
3k views

(How) can I convert full-width characters to half-width ones?

I need to transform the full-width characters(NBA) in the following sentence to half-width ones. NBA中曾有“怒吼天尊”之称的已退役球员是谁? 拉希德·华莱士 H5N2疫苗可对抗H5禽流感病毒 I know I can realize it in Python using ...
user avatar
1 vote
1 answer
95 views

Replace base character, retaining combining characters

I have a vocalized Hebrew text; most letters are followed by one or more combining characters. I would like to replace some of the base characters, leaving the combining characters intact. It seems ...
user avatar
0 votes
2 answers
764 views

Use visual mode to convert text to unicode bold formats?

How can I make it so when in visual mode, pressing b will toggle highlighted text to its bold unicode counterpart? This is what I mean by its Unicode counterpart: http://qaz.wtf/u/convert.cgi?text=...
user avatar
  • 825
0 votes
1 answer
97 views

Can I specify the encoding of a sourced file?

When vim sources a file (vimrc, or :so ...), how does it know in what encoding the file was written? Can I specify the encoding with which it should source the file?
user avatar
1 vote
0 answers
154 views

Is Vim's filename completion broken in Windows when using uppercase u umlaute (Ü)?

In a vim buffer, I want to insert the path to a file named blablabla\barbar-Überbar\bazbazbaz.txt which exists under the current working directory - and I am running gvim in a MS-Windows environment. ...
user avatar
0 votes
1 answer
723 views

How to enter and display German Umlauts on a Windows 10 machine with Russian locale?

I want to be able to write German texts using my Vim 7.4 installed on a Windows 10 machine with Russian locale and German keyboard layout. My .vimrc file looks like this: set encoding=utf-8 set ...
user avatar
  • 217
7 votes
3 answers
4k views

Can I write Japanese (SKK) text in Vim?

I need to be break it to you guys, I use emacs. But just for one little thing. Recently I've been working with a good deal of Japanese people (the company is Japanese) and I got some idea of the ...
user avatar
  • 1,596
4 votes
1 answer
189 views

Latin Capital Letter Thorn

I want to insert the unicode character Thorn Þ into my document. http://www.fileformat.info/info/unicode/char/00de/index.htm The character seems to be inserted when I type i<C-v>u00DE<esc&...
user avatar
  • 5,770